Spot Order Book Trading Now Live on Testnet Ahead of Q2 Launch

A quick update that we have now enabled spot order book trading on Testnet.

Users can now place test orders via API. We will roll out spot order book trading in production in
mid-Q2 2022.

Users will need to use the same API endpoints to manage spot trading. Here’s a walkthrough of how to manage spot trading through our API: 

  1. Users can use the REST API GET /wallet/assets to retrieve the scale of each currency. The scale determines the number of decimal places the system supports for that particular currency. For example, scale for XBT is 8, which means XBT supports 8 decimal places in our system, and 1 XBT = 108 XBt.
  2. All spot instruments can be identified by the key “typ“:”IFXXXPfrom the Rest API GET /instrument or the WebSocket instrument topic.
    1. The symbol name follows the convention of <base currency>_<quote currency>, e.g.  XBT_USDT for Bitcoin against Tether.
    2. underlyingToPositionMultiplieris the multiplier between the asset and currency for the base currency. It is the 10scale for that asset, where you can find scale from the REST API GET /wallet/assets described above. For example, for XBT_USDT, where the base currency is XBT, the underlyingToPositionMultiplieris 100,000,000 (scale for XBT is 8).
    3. quoteToSettleMultiplier is the multiplier between the asset and currency for the quote currency. Same as above, if the quote currency is USDT, the quoteToSettleMultiplier is 100,000 (scale for USDT is 6).
    4. lotSize denotes the lot size in base currency. Using XBT_USDT as an example, its lotSize is 10,000, with underlyingToPositionMultiplier as 100,000,000, it means the lot size is 0.0001 XBT.
  3. Users have to manage orders and trades using the usual endpoints.
    1. Users have to specify the amount of base currency to buy or sell.
    2. The orderQty should always be a multiple of the lotSize.
    3. The quantity is denoted in currency. E.g. to buy 0.01 XBT, orderQty is 1,000,000 (XBt).
    4. Similar conversion is required for data from execution, trade, and orderbook data.
    5. Spot trading symbols do not return any data from the positionendpoint.
    6. For stop and take profit orders, the triggered price cannot be referenced to index price. Users cannot put IndexPrice and LastWithMark in the execInst field.
    7. Users cannot put Close and ReduceOnly in the execInst field.
  4. Trading fees are paid in the quoted currency.
  5. Users have a universal trading balance for derivatives trading, spot trading, EARN, Convert, deposit and withdrawal, etc. The system checks and reserves your available balance before the order enters the order book. The reserved balance for spot open orders can be found from the initMargin field in the margin endpoint.
    1. For buy orders, the reserved amount is the notional value of the order and trading fees in the quoted currency. Excess reserved balance is returned to the user’s balance when the order is filled, where applicable.
    2. For sell orders, the reserved amount is the quantity of the order in the base currency.
  6. The transactType for spot trading is SpotTrade from the endpoints below:
    1. REST API GET /user/walletHistory
    2. REST API GET /user/walletSummary
    3. Websocket transact

If you have any questions or discover any issues with our platform, please contact Support.