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:
- Users can use the REST API
GET /wallet/assets
to retrieve thescale
of each currency. Thescale
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. - All spot instruments can be identified by the key “
typ
“:”IFXXXP
” from the Rest APIGET /instrument
or the WebSocketinstrument
topic.- The symbol name follows the convention of <base currency>_<quote currency>, e.g.
XBT_USDT
for Bitcoin against Tether. underlyingToPositionMultiplier
is the multiplier between theasset
andcurrency
for the base currency. It is the 10scale for that asset, where you can findscale
from the REST APIGET /wallet/assets
described above. For example, for XBT_USDT, where the base currency is XBT, theunderlyingToPositionMultiplier
is100,000,000
(scale
for XBT is 8).quoteToSettleMultiplier
is the multiplier between theasset
andcurrency
for the quote currency. Same as above, if the quote currency is USDT, thequoteToSettleMultiplier
is 100,000 (scale
for USDT is 6).lotSize
denotes the lot size in base currency. Using XBT_USDT as an example, itslotSize
is 10,000, withunderlyingToPositionMultiplier
as 100,000,000, it means the lot size is 0.0001 XBT.
- The symbol name follows the convention of <base currency>_<quote currency>, e.g.
- Users have to manage orders and trades using the usual endpoints.
- Users have to specify the amount of base currency to buy or sell.
- The
orderQty
should always be a multiple of thelotSize
. - The quantity is denoted in
currency
. E.g. to buy 0.01 XBT,orderQty
is 1,000,000 (XBt). - Similar conversion is required for data from
execution
,trade
, andorderbook
data. - Spot trading symbols do not return any data from the
position
endpoint. - For stop and take profit orders, the triggered price cannot be referenced to index price. Users cannot put
IndexPrice
andLastWithMark
in theexecInst
field. - Users cannot put
Close
andReduceOnly
in theexecInst
field.
- Trading fees are paid in the quoted currency.
- 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 themargin
endpoint.- 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.
- For sell orders, the reserved amount is the quantity of the order in the base currency.
- The
transactType
for spot trading isSpotTrade
from the endpoints below:- REST API
GET /user/walletHistory
- REST API
GET /user/walletSummary
- Websocket
transact
- REST API
If you have any questions or discover any issues with our platform, please contact Support.