DigiFinex
DigiFinex (Spot): DigiFinex spot trading over the REST endpoints of DigiFinex OpenAPI v3 (openapi.digifinex.com); private endpoints need an API key (Access Key and Secret Key). Spot only, with no simulated trading; use Futures_DigiFinex for perpetual contracts.
Futures_DigiFinex (Futures): DigiFinex perpetual contracts over the REST endpoints of the DigiFinex futures API (/swap/v2): USDⓈ-margined (e.g. BTC_USDT.swap) and coin-margined inverse contracts (e.g. BTC_USD.swap), with no delivery contracts. Private endpoints need an API key (Access Key and Secret Key); check Simulate to use DigiFinex futures simulated trading.
Names and Configuration
exchange.GetName() | Type |
|---|---|
DigiFinex | Spot |
Futures_DigiFinex | Futures |
✓ marks the exchange objects that have the field.
| Field | DigiFinex | Futures_DigiFinex | Required | Default |
|---|---|---|---|---|
| Access Key | ✓ | ✓ | Yes | — |
| Secret Key | ✓ | ✓ | Yes | — |
| Simulate | ✓ | No | Unchecked |
Trading Pairs and Contract Codes
DigiFinex (Spot)
Pair examples: BTC_USDT, ETH_USDT
Trading pairs are written BTC_USDT, matching the DigiFinex native code btc_usdt (lower case). This exchange object trades spot only; symbols with a contract suffix are rejected; use Futures_DigiFinex for perpetual contracts.
Futures_DigiFinex (Futures)
Pair examples: BTC_USDT, BTC_USD
The quote currency selects the contract family: BTC_USDT is USDⓈ-margined (native code BTCUSDTPERP), BTC_USD is a coin-margined inverse contract (native code BTCPERP).
| Contract code | Description |
|---|---|
swap | Perpetual contract, available as USDⓈ-margined and coin-margined. |
DigiFinex lists perpetual contracts only; other contract codes are rejected. Order amounts are in contracts; the size per contract is CtVal in exchange.GetMarkets() (unit in CtValCcy).
Exchange-specific IO Commands
DigiFinex (Spot)
| Command | Arguments | Description | Returns |
|---|---|---|---|
api | method, path[, params[, raw]] | Call a DigiFinex endpoint directly; path may be a full URL. (more below the table) | The whole exchange response; an error is raised when the response code is not 0. |
The rest of the longer descriptions in the table:
api: Requests are signed by default, withGETparameters in the query string andPOSTparameters as a form body; with the sign argument set tofalsethe request is unsigned, which only works forGET.rawis not a request body but a parameter table (a JSON object) that replacesparamsentirely when non-empty and is signed as usual; object or array values are JSON-encoded into a single field.
For the common commands base and currency see exchange.IO.
Futures_DigiFinex (Futures)
| Command | Arguments | Description | Returns |
|---|---|---|---|
simulate | bool | Switch between simulated (true) and live (false) trading; only changes the local setting. After switching, the ticker list (exchange.GetTickers()), contract list, account balance and position queries carry the simulated-trading parameter (type=1); orders, cancels and other endpoints do not. | Null on success. |
cross | bool[, symbol] | Cross (true) / isolated (false) margin, sent to the exchange per contract; applies to the current contract when no symbol is given. | The value that was set (false when switching to isolated); null when the exchange rejects it. |
api | method, path[, params[, raw]] | Call a DigiFinex futures endpoint directly; only GET and POST are supported, and path starts with / or is a full URL. (more below the table) | The whole exchange response (with code and data); an error is raised when the response code is not 0. |
The rest of the longer descriptions in the table:
api: Requests are signed by default, withGETparameters in the query string andPOSTparameters as a JSON body; with the sign argument set tofalsethe request is unsigned, which only works forGET.rawis not a request body but a parameter table (a JSON object or"a=1&b=2") that replacesparamsentirely when non-empty and is signed as usual.
For the common commands base and currency see exchange.IO.
Function Support
Not supported (the call fails with an error and returns null): exchange.ModifyOrder, exchange.CreateConditionOrder, exchange.ModifyConditionOrder, exchange.CancelConditionOrder, exchange.GetConditionOrder, exchange.GetConditionOrders, exchange.GetHistoryConditionOrders.
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 5m, 15m, 30m, 1h, 4h, 12h, 1d, 1w; other periods are synthesized by the docker.
Margin, Account and Simulation
Futures_DigiFinex (Futures)
Margin mode: Switch cross/isolated margin per contract with exchange.IO("cross", bool); it fails when the exchange's acknowledgement does not match the request. exchange.SetMarginLevel() sets leverage per contract and needs no extra arguments: cross-margin or one-way accounts are set in one request; isolated accounts in hedge mode need leverage per side, so when the exchange reports a position mode error the connector adds the margin mode and sets the same leverage on both the long and the short side (it fails if either side fails, and the error names the side that was already set). The margin mode it adds is the one exchange.IO("cross", bool) set for that contract during this run, or isolated when it was not set. The direction set by exchange.SetDirection() does not affect leverage.
Position mode: There is no command for switching the position mode (exchange.IO("dual", ...) reports it as unsupported). Orders use the four direction codes open long, open short, close long and close short, following the direction set by exchange.SetDirection().
Simulation: Check the Simulate box when adding the exchange to use DigiFinex futures simulated trading; exchange.IO("simulate", true) still switches at run time for older strategies. Simulated trading only affects the ticker list, contract list, account balance and position queries (they carry type=1).
Notes
DigiFinex (Spot)
DigiFinex spot has no simulated environment and its configuration has no Simulate option; only futures (Futures_DigiFinex) support simulated trading.
Futures_DigiFinex (Futures)
- Batch funding rate queries are not supported:
exchange.GetFundings()requires a concrete perpetual contract (for exampleBTC_USDT.swap) and fails when it is omitted or given a range (such asUSDT.swap).