Public HTTP API
Check Server Time
GET /v1/time
Test connectivity to the Rest API and get the current server time.
Response:
{
"serverTime": 1655815554336
}
ExchangeInfo
GET /v1/exchangeInfo
Current exchange trading rules and markets information
Response
{
"assets": [ // assets information
{
"fullName": "USD Coin",
"name": "USDC"
},
{
"fullName": "Bitcoin",
"name": "BTC"
},
{
"fullName": "Ethereum",
"name": "ETH"
}
],
"dealerInfo": {
"creditDecimals": 6,
"insuranceAmount": "75222.0595",
"paperDecimals": 18,
"totalTraders": 41,
"totalVolume": "329816287.00515376"
},
"eip712": {
"EIP712_DOMAIN_SEPARATOR": "0xd7b17a5a26dec9eba4db2f741253b269c1d187011b4c05285fd0df213ca42084",
"EIP712_DOMAIN_TYPEHASH": "0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f",
"EIP712_ORDER_TYPE": "0x6ce22f1be37c24a60b088bc91a456d1ae077db421fa72ffe85abd6af245899e4",
"chainId": 97,
"domainName": "JOJO",
"domainVersion": "1",
"verifyingContract": "0xCA5c790268C06fa2Ed8850023Ac85EA55E1a7C24"
},
"gasFeeInfo": {
"gasLimit": "296605.2173913",
"gasPrice": "322500000",
"lastEthIndexPrice": "1900.15075976",
"waiveGasFeeMinimumAmount": "288.506774458558599871"
},
"markets": [
{
"OrderType": [
"LIMIT",
"MARKET"
],
"baseAssetName": "BTC",
"desc": "DESC",
"filters": [
{
"filterType": "PRICE_FILTER",
"maxPrice": "100000",
"minPrice": "1",
"tickSize": "0.1"
},
{
"filterType": "AMOUNT_FILTER",
"maxAmount": "1000",
"minAmount": "0.001",
"stepSize": "0.001"
},
{
"filterType": "MARKET_AMOUNT_FILTER",
"maxAmount": "1000",
"minAmount": "0.001",
"stepSize": "0.001"
},
{
"filterType": "MAX_OPEN_ORDERS_FILTER",
"limit": 200
}
],
"fundingIntervalSeconds": 28800,
"id": "btcusdc",
"indexPriceSource": {
"text": "Index Price Source",
"url": "https://google.com"
},
"liquidatedAt": null,
"liquidationLeverage": "33.33",
"makerFee": "0.0001",
"markPriceSource": {
"text": "Mark Price Source",
"url": "https://google.com"
},
"maxExposure": "1000000",
"maxLeverage": 20,
"pair": "btcusdc",
"perpetualContractAddress": "0x00De48310d77A4d56aa400248b0B1613508f5B73",
"quoteAssetName": "USDC",
"stage": "TRADING",
"status": "TRADING",
"suspendedAt": null,
"symbol": "btcusdc",
"takerFee": "0.0005",
"timeInForce": [
"GTC",
"IOC",
"FOK",
"POST_ONLY"
]
}
],
"rateLimits": [
{
"intervalSeconds": 60,
"limit": 2400,
"name": "COMMON"
},
{
"intervalSeconds": 60,
"limit": 1200,
"name": "ORDER"
}
],
"serverTime": 1655815563277,
"timezone": "UTC"
}
Order Book
GET /v1/orderbook
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
limit | INTEGER | NO | Depth. Valid values are 10,20,50,100,500,1000. Default 500 |
Response
{
"bids": [
[
"59561.12",
"0.1501"
],
[
"59555.16",
"0.1591"
],
[
"59554.66",
"0.1035"
],
[
"59553.12",
"0.1511"
],
[
"59550.76",
"0.0689"
]
],
"asks": [
[
"59600.14",
"0.1511"
],
[
"59598.17",
"0.1511"
],
[
"59597.33",
"0.1511"
],
[
"59597.13",
"0.1511"
],
[
"59597.03",
"0.1511"
]
],
"sequence": 373263871,
"ticker_id": "btcusdc",
"timestamp": 1724914545501
}
Get Market Recent Trades
GET /v1/trades
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
limit | INTEGER | NO | Result trades count, default is 100, maximum is 500 |
Response
[
{
"id": 181,
"price": "30020",
"amount": "0.023",
"quoteAmount": "690.46",
"time": 1655822152553,
"isBuyerMaker": false,
"status": "SETTLED"
},
{
"id": 180,
"price": "30017",
"amount": "0.003",
"quoteAmount": "90.051",
"time": 1655822152553,
"isBuyerMaker": false,
"status": "SETTLED"
},
{
"id": 218,
"price": "30007",
"amount": "0.058",
"quoteAmount": "1740.406",
"time": 1655822832751,
"isBuyerMaker": true,
"status": "SETTLED"
},
...
]
Get Market Historical Trades
GET /v1/historicalTrades
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
limit | INTEGER | NO | Result trades count, Default 100, max 500 |
fromId | INTEGER | NO | TradeId to fetch from(if pass fromId, will respond trades that order by ASC). Default gets most recent trades. |
Response
[
{
"id": 181,
"price": "30020",
"amount": "0.023",
"quoteAmount": "690.46",
"time": 1655822152553,
"isBuyerMaker": false,
"status": "SETTLED"
},
{
"id": 180,
"price": "30017",
"amount": "0.003",
"quoteAmount": "90.051",
"time": 1655822152553,
"isBuyerMaker": false,
"status": "SETTLED"
},
{
"id": 218,
"price": "30007",
"amount": "0.058",
"quoteAmount": "1740.406",
"time": 1655822832751,
"isBuyerMaker": true,
"status": "SETTLED"
},
...
]
Get Market Klines
GET /v1/klines
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
interval | ENUM | YES | One of 1M 5M 15M 30M 1H 2H 4H 6H 1D 1W 1MO |
startTime | INTEGER | NO | Timestamp millisecond INCLUSIVE |
endTime | INTEGER | NO | Timestamp millisecond EXCLUSIVE |
limit | INTEGER | NO | Default is 100, maximum is 500 |
Response
- The "time" field is timestamp in milliseconds.
- Data within each bar is based on the trading matching time, not the confirmation time on the blockchain. Therefore, the K-line generated from the transaction data on the blockchain may differ slightly from the data returned by this interface.
[
{
"time": 1656029700000,
"open": "2001",
"close": "2001",
"high": "2001",
"low": "2001",
"volume": "0"
},
...
]
Get Market Mark Price Klines
GET /v1/markPriceKlines
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
interval | ENUM | YES | One of 1M 5M 15M 30M 1H 2H 4H 6H 1D 1W 1MO |
startTime | INTEGER | NO | Timestamp millisecond INCLUSIVE |
endTime | INTEGER | NO | Timestamp millisecond EXCLUSIVE |
limit | INTEGER | NO | Default is 100, maximum is 500 |
Response
[
{
"time": 1656029700000,
"open": "2001",
"close": "2001",
"high": "2001",
"low": "2001",
"volume": "0"
},
...
]
Get Market FundingRates
GET /v1/fundingRate
Parameters:
Parameter | Type | Mandatory | Description |
---|---|---|---|
marketId | STRING | YES | Market id |
startTime | INTEGER | NO | Timestamp millisecond INCLUSIVE |
endTime | INTEGER | NO | Timestamp millisecond EXCLUSIVE |
limit | INTEGER | NO | Default is 100, maximum is 500 |
Response
[
{
"marketId": "btcusdc",
"fundingRate": "0.0000026",
"fundingTime": 1655902360000
},
{
"marketId": "btcusdc",
"fundingRate": "0.0000026",
"fundingTime": 1655902380000
},
{
"marketId": "btcusdc",
"fundingRate": "0.0000026",
"fundingTime": 1655902400000
},
...
]
Get High-Risk Account Positions
This interface will return position information of some high-risk accounts. When the risk level of an account is higher than 80%, it will appear here. Please note that this interface has a short cache, so you cannot simply rely on the "isSafe" returned by this interface to determine whether the position can be liquidated. Reliance solely on the return value of this interface for liquidation may cause you to miss the best liquidation timing. The correct approach is to use this interface to obtain the addresses that may be liquidated and then decide on the subsequent liquidation actions through direct interaction with the blockchain.
- To check whether an account is safe on blockchain in real time, you can use the isSafe interface.
- To liquidate a position, please refer to Liquidation.
GET /v1/riskyAccounts
Response
[
{
"account": "0x837Bcd683b8b08223f29A66A1665e43D79a0204F",
"isSafe": false,
"risk": "1.0000",
"positions": [
{
"marketId": "liqusdc",
"side": "LONG",
"status": "OPEN",
"size": "102.8",
"maxSize": "102.8",
"unrealizedPnl": "-5628.003915",
"realizedPnl": "0",
"entryPrice": "135.74712",
"exitPrice": "0",
"closedAt": null,
"sumOpen": "102.8",
"sumClose": "0",
"liquidationPrice": "130.208835",
"lastUpdatedAt": 1678206894000
}
]
}
]
Get Contracts
This interface will return provides a summary of all contracts traded on the exchange.
GET /v1/contracts
Response
{
"contracts": [
{
"ticker_id": "ethusdc",
"base_currency": "ETH",
"quote_currency": "USDC",
"last_price": "2543.6",
"base_volume": "5.788044",
"quote_volume": "14479.51189104",
"high": "2543.6",
"low": "2443.13",
"product_type": "PERP",
"open_interest": "434.139211",
"index_price": "2551.63163354",
"index_name": "ETH",
"index_currency": "USDC",
"start_timestamp": "1712305796599",
"end_timestamp": "1724914615859",
"funding_rate": "0.0001",
"next_funding_rate": "0.0001",
"next_funding_rate_timestamp": "1724918400000"
},
{
"ticker_id": "btcusdc",
"base_currency": "BTC",
"quote_currency": "USDC",
"last_price": "59600",
"base_volume": "11.196808",
"quote_volume": "662498.78267436",
"high": "60127.17",
"low": "57900",
"product_type": "PERP",
"open_interest": "21.077108",
"index_price": "59602.76844348",
"index_name": "BTC",
"index_currency": "USDC",
"start_timestamp": "1712305803372",
"end_timestamp": "1724914615859",
"funding_rate": "0.0001",
"next_funding_rate": "0.0001",
"next_funding_rate_timestamp": "1724918400000"
}
]
}