DeepCoin
DeepCoin (Spot): DeepCoin spot trading through the DeepCoin API (api.deepcoin.com); everything is REST polling, with no market data or order push. The API KEY configuration needs the Access Key, Secret Key and Passphrase. Account and order calls use the spot account (SPOT) only. Spot only, with no simulated trading; use Futures_DeepCoin for perpetual contracts.
Futures_DeepCoin (Futures): DeepCoin USDT-margined and coin-margined perpetual contracts through the DeepCoin API (api.deepcoin.com); everything is REST polling, with no market data or order push. The API KEY configuration needs the Access Key, Secret Key and Passphrase. Perpetual contracts only, with no simulated trading.
Names and Configuration
exchange.GetName() | Type | Aliases |
|---|---|---|
DeepCoin | Spot | Deepcoin |
Futures_DeepCoin | Futures | — |
| Field | Required | Description |
| - | - | - |
| Access Key | Yes | — |
| Secret Key | Yes | — |
| Passphrase | Yes | The passphrase set when creating the API key; required for private endpoints. |
Trading Pairs and Contract Codes
DeepCoin (Spot)
Pair examples: BTC_USDT, ETH_USDT
Trading pairs are written BTC_USDT, matching the DeepCoin native code BTC-USDT. Symbols with a contract suffix (such as .swap) are rejected.
Futures_DeepCoin (Futures)
Pair examples: BTC_USDT, BTC_USD
The quote currency selects the contract family: BTC_USDT is USDT-margined (native code BTC-USDT-SWAP), BTC_USD is coin-margined (native code BTC-USD-SWAP).
| Contract code | Description |
|---|---|
swap | Perpetual contract, available as USDT-margined and coin-margined. |
DeepCoin 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
DeepCoin (Spot)
No exchange-specific commands; for the common commands see exchange.IO.
Futures_DeepCoin (Futures)
| Command | Arguments | Description | Returns |
|---|---|---|---|
cross | bool | Cross (true) / isolated (false) margin. Only changes the local setting without sending a request; subsequent orders, conditional orders and exchange.SetMarginLevel() carry it. Cross margin by default. | The value set. |
merge | bool | Merged positions (true) / split positions (false). Only changes the local setting without sending a request; subsequent orders, conditional orders and exchange.SetMarginLevel() carry it. Merged positions by default. | The value set. |
For the common commands api, base and currency see exchange.IO.
Common Usage
Set leverage and place an order in isolated margin with split positions (Futures_DeepCoin only)
javascript
function main() {
exchange.SetContractType("swap")
// Local settings only, no request; later orders, conditional orders and
// leverage settings carry them
Log(exchange.IO("cross", false)) // false: isolated margin
Log(exchange.IO("merge", false)) // false: split positions
exchange.SetMarginLevel(5)
var id = exchange.CreateOrder("BTC_USDT.swap", "buy", -1, 1)
Log("Order Id:", id)
}
Function Support
All exchange objects
Served through a fallback:
exchange.GetRecords: Native periods are 1m, 3m, 5m, 15m, 30m, 1h, 2h, 4h, 6h, 12h, 1d, 1w, 1M, 1y; other periods are synthesized by the docker.
DeepCoin (Spot)
Not supported (the call fails with an error and returns null): exchange.ModifyOrder.
Futures_DeepCoin (Futures)
No unsupported standard functions.
Margin, Account and Simulation
Futures_DeepCoin (Futures)
Margin mode: Choose cross/isolated margin with exchange.IO("cross", bool); it is a local setting carried with every order (cross by default), and the connector has no way to read the account's actual margin mode. exchange.SetMarginLevel() sets leverage per contract, carrying the current cross/isolated and merged/split settings, and fails when the exchange's acknowledgement does not match the request.
Position mode: Choose merged/split positions with exchange.IO("merge", bool) (merged by default). Orders carry the position side derived from the direction (long for opening long or closing short, short for opening short or closing long), which split-position mode needs to tell long and short positions apart.
Notes
All exchange objects
exchange.GetHistoryOrders()andexchange.GetHistoryConditionOrders()do not support thesinceargument (the exchange's history endpoints have no time-range parameter) and fail when it is given; only the most recent orders can be queried.
DeepCoin (Spot)
- Order amendment (
exchange.ModifyOrder()) is not supported; cancel and place again. Untriggered conditional orders can be modified withexchange.ModifyConditionOrder(), which keeps the order id. - The amount of a market buy order is the quote-currency sum to spend (DeepCoin's
tgtCcyisquote_ccy); a market sell order's amount is in the base currency. Limit orders support IOC, FOK and post-only (postOnly). - Conditional orders support take-profit and stop-loss only, not OCO (place the take-profit and stop-loss legs as two conditional orders). Conditional and regular order ids are not interchangeable; conditional orders can only be canceled with
exchange.CancelConditionOrder(). exchange.GetOrders()andexchange.GetConditionOrders()query one trading pair only: when omitted or empty they query the current trading pair. The untriggered conditional-order endpoint has no pagination and returns at most 100 orders per call; when the exchange returns exactly 100 orders,exchange.GetConditionOrders()reports an error (completeness cannot be confirmed).
Futures_DeepCoin (Futures)
- Order amendment (
exchange.ModifyOrder()) uses DeepCoin's cancel-replace endpoint (replace-order); the return value is the new order's Id, use it for later queries and cancellation. A changed amount is truncated to whole contracts. - Limit orders support IOC, FOK and post-only (
postOnly). - Conditional orders support take-profit and stop-loss only, not OCO (place the take-profit and stop-loss legs as two conditional orders), and cannot carry a custom order id (clientId); untriggered conditional orders can be modified with
exchange.ModifyConditionOrder(), which keeps the order id. Conditional and regular order ids are not interchangeable; conditional orders can only be canceled withexchange.CancelConditionOrder(). - The open-conditional-order endpoint requires a trading pair:
exchange.GetConditionOrders()without arguments queries the current contract only, and ranges (such asUSDT.swap) are not accepted. The endpoint has no pagination and returns at most 100 orders per call; a response of exactly 100 orders is an error (completeness cannot be confirmed). - Trading coin-margined contracts requires the account to have opened a coin-margined contract account on DeepCoin; otherwise orders are rejected by the exchange.