Download OpenAPI specification:Download
In order to start, one has to register either at https://testnet.digitexfutures.com for testnet (virtual funds trading) or at https://digitex.io - our mainnet (real money trading).
After registration you need to obtain your trading token in your account.
Direct links to the account page:
If you have already created your token, you can simply copy it, else click on "Create" in the API section of your account.
IMPORTANT NOTES!
Returns list of currencies that are available to use in the wallet
currency_id | integer Optional query parameter to return single currency info, if empty returns list of available currencies |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/currency/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}, - {
- "id": 4,
- "name": "Ethereum",
- "code": "ETH",
- "currency_scale": 8,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 6,
- "name": "USDT",
- "code": "USDT",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 7,
- "name": "USD Coin",
- "code": "USDC",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 32,
- "name": "Blockster",
- "code": "BXR",
- "currency_scale": 4,
- "withdraw_fee": "0.000000000000000000"
}
]
Utility endpoint to ping the server, If "pong" is in the response, then the service is working properly. Additionally there is a timestamp value of servers's internal time. Note all times are in UTC
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/ping', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "timestamp": 1234598990003,
- "datetime": "2021-09-19 17:18:44.820400",
- "message": "pong"
}
Returns exchange's order book for selected market
market_id required | integer Examples:
market_id |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/order_book/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "ticker_id": 24,
- "timestamp": 1632230927428280,
- "bids": [
- [
- "0.0025",
- "35043"
], - [
- "0.0024",
- "2953"
], - [
- "0.0023",
- "71863"
], - [
- "0.0022",
- "83771"
], - [
- "0.0021",
- "154382"
], - [
- "0.002",
- "113169"
], - [
- "0.0019",
- "151088"
], - [
- "0.0018",
- "65141"
], - [
- "0.0017",
- "78621"
], - [
- "0.0016",
- "38007"
], - [
- "0.0015",
- "41408"
], - [
- "0.0014",
- "146430"
], - [
- "0.0013",
- "118285"
], - [
- "0.0012",
- "15655"
]
], - "asks": [
- [
- "0.0026",
- "50143"
], - [
- "0.0027",
- "2970"
], - [
- "0.0028",
- "135368"
], - [
- "0.0029",
- "23598"
], - [
- "0.003",
- "100429"
], - [
- "0.0031",
- "70768"
], - [
- "0.0032",
- "112788"
], - [
- "0.0033",
- "156266"
], - [
- "0.0034",
- "62223"
], - [
- "0.0035",
- "171127"
], - [
- "0.0036",
- "156830"
], - [
- "0.0037",
- "168352"
], - [
- "0.0038",
- "183610"
], - [
- "0.0039",
- "103807"
], - [
- "0.01",
- "99997"
], - [
- "0.013",
- "198000"
], - [
- "0.0135",
- "1704"
], - [
- "5",
- "1000"
], - [
- "9",
- "300"
], - [
- "50",
- "501"
]
]
}
max_trades | integer Limit maximum number of recent trades. Default limit is 1000 |
market_id required | integer Examples:
market id |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/recent_trades/', qs: {max_trades: 'SOME_INTEGER_VALUE', market_id: 'SOME_INTEGER_VALUE'}, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "market_id": 1,
- "timestamp": 1625037107016692,
- "recent_trades": [
- {
- "trade_id": 165005958,
- "timestamp": 1632231256258892,
- "base_volume": "1",
- "quote_volume": "42980",
- "price": "42980",
- "side": 2
}, - {
- "trade_id": 165005961,
- "timestamp": 1632231256258892,
- "base_volume": "2",
- "quote_volume": "85950",
- "price": "42975",
- "side": 2
}
]
}
Returns open high low close volume aggregated data for selected market and timeframe.
In any case returns max 1k datapoints. Optionally datapoints can be filtered with date_from and date_to parameters
Available timeframes (resolutions):
date_from | integer Unix timestamp (UTC) of the leftmost required bar, including from. |
date_to | integer Unix timestamp (UTC) of the rightmost required bar, including to. It can be in the future. In this case, the rightmost required bar is the latest available bar. |
market_id required | integer int market_id |
top_n | integer number of records ohlcv, default 10000 |
resolution required | string Symbol resolution. Possible resolutions are daily (D or 1D, 2D ... ), weekly (1W, 2W ...), monthly (1M, 2M...) and an intra-day resolution – minutes(1, 2 ...). |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/history/ohlcv/', qs: { date_from: 'SOME_INTEGER_VALUE', date_to: 'SOME_INTEGER_VALUE', market_id: 'SOME_INTEGER_VALUE', top_n: 'SOME_INTEGER_VALUE', resolution: 'SOME_STRING_VALUE' }, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "market_id": 24,
- "resolution": "1D",
- "timestamp": 1632476201371805,
- "ohlcv": [
- {
- "timestamp": 1632475560000000,
- "open": "0.002400000000000000",
- "high": "0.002600000000000000",
- "low": "0.002400000000000000",
- "close": "0.002600000000000000",
- "volume": "24700.000000000000000000"
}, - {
- "timestamp": 1632475620000000,
- "open": "0.002400000000000000",
- "high": "0.002600000000000000",
- "low": "0.002400000000000000",
- "close": "0.002600000000000000",
- "volume": "9349.000000000000000000"
}, - {
- "timestamp": 1632475680000000,
- "open": "0.002600000000000000",
- "high": "0.002600000000000000",
- "low": "0.002400000000000000",
- "close": "0.002400000000000000",
- "volume": "40547.000000000000000000"
}, - {
- "timestamp": 1632475740000000,
- "open": "0.002300000000000000",
- "high": "0.002600000000000000",
- "low": "0.002300000000000000",
- "close": "0.002300000000000000",
- "volume": "29188.000000000000000000"
}, - {
- "timestamp": 1632475800000000,
- "open": "0.002600000000000000",
- "high": "0.002600000000000000",
- "low": "0.002400000000000000",
- "close": "0.002400000000000000",
- "volume": "11887.000000000000000000"
}, - {
- "timestamp": 1632475915281597,
- "open": "2910.000000000000000000",
- "high": "2910.000000000000000000",
- "low": "2910.000000000000000000",
- "close": "2910.000000000000000000",
- "volume": 5
}
]
}
This endpoint returns all metadata for the exchange, such as:
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/exchange_info/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "rate_limits": [
- {
- "interval": "SECOND",
- "limit": 50
}, - {
- "interval": "MINUTE",
- "limit": 500
}
], - "notifications": [ ],
- "server_time": 1632229225740173,
- "currencies": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
], - "markets": [
- {
- "id": 2,
- "name": "ETH/USD",
- "code": "ETHUSD",
- "market_type": 1,
- "base_currency": {
- "id": 4,
- "name": "Ethereum",
- "code": "ETH",
- "currency_scale": 8,
- "withdraw_fee": "100.000000000000000000"
}, - "quote_currency": {
- "id": 3,
- "name": "USD",
- "code": "USD",
- "currency_scale": 2,
- "withdraw_fee": "100.000000000000000000"
}, - "description": "ETH/USD Perpetual Futures",
- "contract_currency": {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - "funding": "0.0003"
}
], - "order_meta": {
- "type": {
- "LIMIT": 1,
- "MARKET": 2
}, - "duration": {
- "DURATION_UNDEFINED": 0,
- "GFD": 1,
- "GTC": 2,
- "GTF": 3,
- "IOC": 4,
- "FOK": 5
}, - "side": {
- "BUY": 1,
- "SELL": 2
}, - "position": {
- "UNDEFINED": 0,
- "LONG": 1,
- "SHORT": 2
}, - "status": {
- "PENDING": 1,
- "ACCEPTED": 2,
- "REJECTED": 3,
- "CANCELED": 4,
- "FILLED": 5,
- "PARTIAL": 6
}
}
}
Get list of markets
market_id | integer Optional query to return just one market_id |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/markets/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 2,
- "name": "ETH/USD",
- "code": "ETHUSD",
- "market_type": 1,
- "base_currency": "ETH",
- "quote_currency": "USD",
- "description": "ETH/USD Perpetual Futures",
- "tick_size": "1.000000000000000000",
- "tick_price": "1.000000000000000000",
- "tick_scale": 0,
- "pnl_scale": 0,
- "mark_price_scale": 2,
- "category": "Futures",
- "quantity_scale": 0,
- "large_scale": 0,
- "lot_size": "1.000000000000000000",
- "openPx": 2212,
- "highPx": 2332,
- "lowPx": 2203,
- "pxChange24h": 3.5340314136125652,
- "volume24h": 152110,
- "volume24hUsd": 910147.66152127,
- "lastTradePx": 2292,
- "usd_scale": 2,
- "liquidity_reward_currency": 1,
- "contract_currency": "DGTX",
- "funding_rate": 0.0002
}
]
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/currency_pair/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 0,
- "code": "string",
- "scale": 0,
- "name": "string",
- "base": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
], - "quote": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
]
}
]
Returns list of currencies that are available to use in the wallet
currency_id | integer Optional query parameter to return single currency info, if empty returns list of available currencies |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/currency/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}, - {
- "id": 4,
- "name": "Ethereum",
- "code": "ETH",
- "currency_scale": 8,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 6,
- "name": "USDT",
- "code": "USDT",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 7,
- "name": "USD Coin",
- "code": "USDC",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 32,
- "name": "Blockster",
- "code": "BXR",
- "currency_scale": 4,
- "withdraw_fee": "0.000000000000000000"
}
]
This endpoint returns all metadata for the exchange, such as:
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/exchange_info/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "rate_limits": [
- {
- "interval": "SECOND",
- "limit": 50
}, - {
- "interval": "MINUTE",
- "limit": 500
}
], - "notifications": [ ],
- "server_time": 1632229225740173,
- "currencies": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
], - "markets": [
- {
- "id": 2,
- "name": "ETH/USD",
- "code": "ETHUSD",
- "market_type": 1,
- "base_currency": {
- "id": 4,
- "name": "Ethereum",
- "code": "ETH",
- "currency_scale": 8,
- "withdraw_fee": "100.000000000000000000"
}, - "quote_currency": {
- "id": 3,
- "name": "USD",
- "code": "USD",
- "currency_scale": 2,
- "withdraw_fee": "100.000000000000000000"
}, - "description": "ETH/USD Perpetual Futures",
- "contract_currency": {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - "funding": "0.0003"
}
], - "order_meta": {
- "type": {
- "LIMIT": 1,
- "MARKET": 2
}, - "duration": {
- "DURATION_UNDEFINED": 0,
- "GFD": 1,
- "GTC": 2,
- "GTF": 3,
- "IOC": 4,
- "FOK": 5
}, - "side": {
- "BUY": 1,
- "SELL": 2
}, - "position": {
- "UNDEFINED": 0,
- "LONG": 1,
- "SHORT": 2
}, - "status": {
- "PENDING": 1,
- "ACCEPTED": 2,
- "REJECTED": 3,
- "CANCELED": 4,
- "FILLED": 5,
- "PARTIAL": 6
}
}
}
Get list of markets
market_id | integer Optional query to return just one market_id |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/markets/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 2,
- "name": "ETH/USD",
- "code": "ETHUSD",
- "market_type": 1,
- "base_currency": "ETH",
- "quote_currency": "USD",
- "description": "ETH/USD Perpetual Futures",
- "tick_size": "1.000000000000000000",
- "tick_price": "1.000000000000000000",
- "tick_scale": 0,
- "pnl_scale": 0,
- "mark_price_scale": 2,
- "category": "Futures",
- "quantity_scale": 0,
- "large_scale": 0,
- "lot_size": "1.000000000000000000",
- "openPx": 2212,
- "highPx": 2332,
- "lowPx": 2203,
- "pxChange24h": 3.5340314136125652,
- "volume24h": 152110,
- "volume24hUsd": 910147.66152127,
- "lastTradePx": 2292,
- "usd_scale": 2,
- "liquidity_reward_currency": 1,
- "contract_currency": "DGTX",
- "funding_rate": 0.0002
}
]
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/currency_pair/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "id": 0,
- "code": "string",
- "scale": 0,
- "name": "string",
- "base": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
], - "quote": [
- {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}
]
}
]
market_id | integer <int32> market id, can be found in markets instance |
side | integer (OrderSide) Enum: "0" "1" "2" Order sides
|
type | integer (OrderType) Enum: "1" "2" Order types
|
duration | integer (OrderDuration) Enum: "0" "1" "2" "3" "4" "5" Duration of the order
|
leverage | integer <int32> Leverage of the trades, only valid for futures market and will be ignored for spot |
quantity | string quantity of the order. If you are trading futures, this is - amount of contracts. for spot - it depends on your side. |
price | string price of the orders |
client_id | string user generated uidid. it is optional, the backend will generate one if nothing is provided |
{- "id": "986ca2aa-9f21-4a90-87f0-692b88c92bdf",
- "market_id": 24,
- "side": 1,
- "type": 2,
- "duration": 2,
- "leverage": 1,
- "quantity": 1234,
- "price": 0.0038
}
{- "id": "986ca2aa-9f21-4a90-87f0-692b88c92bdf",
- "market_id": 24,
- "trader_id": 12354,
- "side": 1,
- "type": 2,
- "duration": 2,
- "leverage": 1,
- "quantity": 1234,
- "price": 0.0038
}
Includes orders that are no longer active. These are orders that have the following status:
All query parameters are optional.
created_at_from | integer <int64> Examples:
Timestamp in microseconds. Filters for order created at or after this timestamp |
created_at_to | string Examples:
Timestamp in microseconds. Filters for orders created before this timestamp |
cursor | string Examples:
cursor for fetching pages |
market_id | integer Examples:
Id of a market |
page_size | integer Examples:
Amount of order displayed per page |
status | integer Examples:
orders status |
trader_id | number Examples:
Id of a users trader |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/order_history/', qs: { created_at_from: 'SOME_INTEGER_VALUE', created_at_to: 'SOME_STRING_VALUE', cursor: 'SOME_STRING_VALUE', market_id: 'SOME_INTEGER_VALUE', page_size: 'SOME_INTEGER_VALUE', status: 'SOME_INTEGER_VALUE', trader_id: 'SOME_NUMBER_VALUE' }, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "next": "cD0yMDIxLTA4LTIwKzEyJTNBNDYlM0ExOC40Mjg3ODclMkIwMCUzQTAw",
- "results": [
- {
- "id": "671de6fe-32fa-4816-8756-3b57a327798b",
- "market": "ETH/USDC",
- "side": 1,
- "type": 2,
- "status": 4,
- "price": "3211.250000000000000000",
- "quantity": "0.420000000000000000",
- "created_at": "2021-08-20T12:47:21.479712Z",
- "client_id": "f3dfd483-9de7-4cf4-ac5f-fe7c6153e1b5",
- "orig_quantity": "0.420000000000000000",
- "average_price": 0,
- "reduce_only": false,
- "duration": 2
}, - {
- "id": "656875b9-0f3e-4169-9236-da0a0531c512",
- "market": "ETH/USDC",
- "side": 1,
- "type": 2,
- "status": 2,
- "price": "3211.250000000000000000",
- "quantity": "1.618000000000000000",
- "created_at": "2021-08-20T12:47:21.471516Z",
- "client_id": "50aa5d48-5e93-4a72-85a3-d63ac3683c6f",
- "orig_quantity": "1.618000000000000000",
- "average_price": 0,
- "duration": 2
}
]
}
Get status of orders by query params
client_id required | string Examples:
uuid of the order |
trader_id | integer Examples:
optional trader's id. Works in case user has several trading accounts |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/order_status/', qs: {client_id: 'SOME_STRING_VALUE', trader_id: 'SOME_INTEGER_VALUE'}, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "created_at": 1566818724722,
- "client_id": "testOrder",
- "id": "22542179qwerqwetasdf",
- "quantity": "0",
- "orig_quantity": "10",
- "price": "0",
- "reduceOnly": false,
- "side": "BUY",
- "status": "NEW",
- "stopPrice": "9300",
- "market__code": "BTCUSDT",
- "timeInForce": "GTC",
- "type": "LIMIT",
- "executed_quantity": 12,
- "average_price": 123
}
]
Open orders are orders that have not been fully filled yet.
These are order with order_status:
Orders can be filtered with any of the query parameters. No query parameters means all open orders.
status | integer
|
cursor | string Examples:
Cursor for fetching. Pagination |
market_id | integer Examples:
id of a market |
page_size | integer Examples:
Size of a paginator page |
side | integer Examples:
Filter by order side |
trader_id | integer Examples:
Id of a trader |
type | integer Examples:
MARKET = 1 LIMIT = 2 |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/orders/', qs: { status: 'SOME_INTEGER_VALUE', cursor: 'SOME_STRING_VALUE', market_id: 'SOME_INTEGER_VALUE', page_size: 'SOME_INTEGER_VALUE', side: 'SOME_INTEGER_VALUE', trader_id: 'SOME_INTEGER_VALUE', type: 'SOME_INTEGER_VALUE' }, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "next": "cD0yMDIxLTA4LTIwKzEyJTNBNDYlM0ExOC40Mjg3ODclMkIwMCUzQTAw",
- "results": [
- {
- "id": "671de6fe-32fa-4816-8756-3b57a327798b",
- "market": "ETH/USDC",
- "side": 1,
- "type": 2,
- "status": 4,
- "price": "3211.250000000000000000",
- "quantity": "0.420000000000000000",
- "created_at": "2021-08-20T12:47:21.479712Z",
- "client_id": "f3dfd483-9de7-4cf4-ac5f-fe7c6153e1b5",
- "orig_quantity": "0.420000000000000000",
- "average_price": 0,
- "reduce_only": false,
- "duration": 2
}, - {
- "id": "656875b9-0f3e-4169-9236-da0a0531c512",
- "market": "ETH/USDC",
- "side": 1,
- "type": 2,
- "status": 2,
- "price": "3211.250000000000000000",
- "quantity": "1.618000000000000000",
- "created_at": "2021-08-20T12:47:21.471516Z",
- "client_id": "50aa5d48-5e93-4a72-85a3-d63ac3683c6f",
- "orig_quantity": "1.618000000000000000",
- "average_price": 0,
- "duration": 2
}
]
}
Get trade history of a trader
traded_at_from | integer <int64> Examples:
Timestamp in microseconds |
traded_at_to | integer <int64> Examples:
Timestamp in microseconds. Only return contracts traded before this time. |
cursor | string Examples:
Cursor for fetching pages in pagination |
market_id | integer Examples:
Id of a market |
page_size | integer size of a paginator page |
trader_id | integer Examples:
optional trader id |
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/trade_history/', qs: { traded_at_from: 'SOME_INTEGER_VALUE', traded_at_to: 'SOME_INTEGER_VALUE', cursor: 'SOME_STRING_VALUE', market_id: 'SOME_INTEGER_VALUE', page_size: 'SOME_INTEGER_VALUE', trader_id: 'SOME_INTEGER_VALUE' }, headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
{- "next": "cD0yMDIxLTA3LTIwKzEwJTNBMjglM0EzNS4yNTI3OTMlMkIwMCUzQTAw",
- "results": [
- {
- "trader_id": 119717,
- "market_id": 1,
- "traded_at": "2021-08-18T15:31:32.229211Z",
- "side": 1,
- "price": "45245.000000000000000000",
- "quantity": "1.000000000000000000",
- "contract_id": 130089258,
- "order_id": "19fba70e-9ea8-49fb-ad9f-553afa1c347c"
}, - {
- "trader_id": 119717,
- "market_id": 24,
- "traded_at": "2021-08-06T12:15:02.486081Z",
- "side": 1,
- "price": "0.002400000000000000",
- "quantity": "564.000000000000000000",
- "contract_id": 117694099,
- "order_id": "99244c53-9215-43fe-9e83-7bd3a84acd15"
}
]
}
client_id required | string order's client_id |
duration required | integer (OrderDuration) Enum: "0" "1" "2" "3" "4" "5" Duration of the order
|
leverage required | integer desired leverage for margin trades |
market_id required | integer market id |
price required | string Desired price of an order |
quantity required | string quantity of an order |
side required | integer (OrderSide) Enum: "0" "1" "2" Order sides
|
type required | integer (OrderType) Enum: "1" "2" Order types
|
{- "client_id": "3877a30e-6acb-49f5-a101-5c46656cd8a5",
- "duration": 1,
- "leverage": 1,
- "market_id": 1,
- "price": "51000.000000000000000000",
- "quantity": "1.000000000000000000",
- "side": 2,
- "type": 2
}
{- "timestamp": 1566818724722,
- "client_order_id": "90d26126-3b65-4274-9ecb-3365a54b0975",
- "order_id": "e76163a9-142d-43fa-b0d6-27c690b73676",
- "qty": 1,
- "exec_qty": 1,
- "avg_price": 0,
- "quantity": 1,
- "market_id": 1,
- "price": 48000,
- "reduce_only": false,
- "side": 1,
- "status": 2,
- "stop_price": 50000,
- "time_in_force": 1,
- "type": 2
}
to cancel an order(s) - send list of cliet_id(s) and the market for which you want to close orders, you can close orders only for one market at a time
to cancel all order(s) by market - send only market_id
to cancel all orders - send empty body
market_id | integer <int32> market_id |
orders_client_ids | Array of strings list of cliend_ids to cancel |
{- "market_id": 1,
- "orders_client_ids": [
- "client_id1",
- "client_id2",
- "..."
]
}
{- "market_id": 1,
- "orders_client_ids": [
- "client_id_1",
- "client_id_2",
- "..."
]
}
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/position/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- {
- "contractCurrency": "DGTX",
- "leverage": 1.8294143915246146,
- "market": "BTCUSD",
- "markPrice": 49587.53,
- "positionMargin": "0.000000000000000000",
- "quantity": 0,
- "timestamp": 1629797235
}, - {
- "contractCurrency": "DGTX",
- "entryPrice": 3216,
- "leverage": 1.8294143915246146,
- "liquidationPrice": 3164,
- "market": "ETHUSD",
- "markPrice": 3326.16,
- "positionMargin": "106.543400000000000000",
- "quantity": 1,
- "positionSide": "Long",
- "timestamp": 1629797235,
- "unrealizedPnl": 111
}, - {
- "contractCurrency": "USDC",
- "entryPrice": 47100,
- "leverage": 1.8294143915246146,
- "liquidationPrice": 23560,
- "market": "FS:BTCUSD",
- "markPrice": 49587.53,
- "positionMargin": "47.090197100000000000",
- "quantity": 1,
- "positionSide": "Long",
- "timestamp": 1629797235,
- "unrealizedPnl": 2.47
}, - {
- "contractCurrency": "USDC",
- "leverage": 1.8294143915246146,
- "market": "FS:BTC1USD",
- "markPrice": 49587.53,
- "positionMargin": "0.000000000000000000",
- "quantity": 0,
- "timestamp": 1629797235
}, - {
- "contractCurrency": "USDC",
- "leverage": 1.8294143915246146,
- "market": "FS:ETHUSD",
- "markPrice": 3326.16,
- "positionMargin": "0.000000000000000000",
- "quantity": 0,
- "timestamp": 1629797235
}
]
const request = require('request'); const options = { method: 'GET', url: 'https://testnet.digitexfutures.com/dapi/v1/exchange/bot/balances/', headers: {Authorization: 'REPLACE_KEY_VALUE'} }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); });
[- [
- {
- "currency": {
- "id": 32,
- "name": "Blockster",
- "code": "BXR",
- "currency_scale": 4,
- "withdraw_fee": "0.000000000000000000"
}, - "main_balance": "0",
- "trading_balance": "0",
- "total_balance": "0",
- "available_balance": "0"
}, - {
- "currency": {
- "id": 4,
- "name": "Ethereum",
- "code": "ETH",
- "currency_scale": 8,
- "withdraw_fee": "100.000000000000000000"
}, - "main_balance": "0",
- "trading_balance": "0.014990700000000000",
- "total_balance": "0.014990700000000000",
- "available_balance": "0.014990700000000000"
}, - {
- "currency": {
- "id": 7,
- "name": "USD Coin",
- "code": "USDC",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - "main_balance": "0",
- "trading_balance": "30.000071480000000000",
- "total_balance": "30.000071480000000000",
- "available_balance": "0.000071480000000000"
}, - {
- "currency": {
- "id": 6,
- "name": "USDT",
- "code": "USDT",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - "main_balance": "0",
- "trading_balance": "0",
- "total_balance": "0",
- "available_balance": "0"
}, - {
- "currency": {
- "id": 2,
- "name": "Bitcoin",
- "code": "BTC",
- "currency_scale": 8,
- "withdraw_fee": "0.000050000000000000"
}, - "main_balance": "0",
- "trading_balance": "0.000499750000000000",
- "total_balance": "0.000499750000000000",
- "available_balance": "0.000499750000000000"
}, - {
- "currency": {
- "id": 1,
- "name": "Digitex",
- "code": "DGTX",
- "currency_scale": 4,
- "withdraw_fee": "100.000000000000000000"
}, - "main_balance": "0",
- "trading_balance": "54977.006100000000000000",
- "total_balance": "54977.006100000000000000",
- "available_balance": "52758.016700000000000000"
}
]
]