Get Account Balance Demo (USER_DATA)
Get Account Balance Demo (USER_DATA).
Get Account Balance Demo (USER_DATA) › Responses
Successful response
assetAsset name
balanceTotal balance
availableBalanceAvailable balance
frozenFrozen amount
unrealizePnlUnrealized Profit and Loss
Place Order Demo (TRADE)
Place Order Demo (TRADE).
query Parameters
symbolTrading pair, for example BTCSUSDT.
sideOrder side. Supported values: BUY, SELL.
positionSidePosition side. Supported values: LONG, SHORT.
typeOrder type. Supported values: LIMIT, MARKET.
quantityOrder quantity. Must be greater than 0.
newClientOrderIdClient order identifier (1-36 characters, pattern ^[\.A-Z:/a-z0-9_-]{1,36}$).
timeInForceTime-in-force policy. Required when type = LIMIT. Supported values: GTC, IOC, FOK.
priceLimit price. Required when type = LIMIT.
tpTriggerPriceOptional take-profit trigger price.
slTriggerPriceOptional stop-loss trigger price.
TpWorkingTypeTake-profit trigger price source. Supported values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.
SlWorkingTypeStop-loss trigger price source. Supported values: CONTRACT_PRICE, MARK_PRICE. Default CONTRACT_PRICE.
Place Order Demo (TRADE) › Responses
Successful response
orderIdOrder ID assigned by the system.
clientOrderIdEcho of newClientOrderId.
successWhether the order request was accepted.
errorCodeError code when success = false; otherwise empty.
errorMessageError message when success = false; otherwise empty.
Get All Positions Demo (USER_DATA)
Get All Positions Demo (USER_DATA).
Get All Positions Demo (USER_DATA) › Responses
Successful response
idPosition ID
assetAssociated collateral asset
symbolTrading pair
sidePosition direction such as LONG or SHORT
marginTypeMargin mode of current position CROSSED: Cross ModeISOLATED: Isolated Mode
separatedModeCurrent position's separated mode COMBINED: Combined mode SEPARATED: Separated mode
separatedOpenOrderIdOpening order ID of separated position
leveragePosition leverage
sizeCurrent position size
openValueInitial value at position opening
openFeeOpening fee
fundingFeeFunding fee
marginSizeMargin amount (margin coin)
isolatedMarginIsolated margin
isAutoAppendIsolatedMarginWhether the auto-adding of funds for the isolated margin is enabled (only for isolated mode)
cumOpenSizeAccumulated opened positions
cumOpenValueAccumulated value of opened positions
cumOpenFeeAccumulated fees paid for opened positions
cumCloseSizeAccumulated closed positions
cumCloseValueAccumulated value of closed positions
cumCloseFeeAccumulated fees paid for closing positions
cumFundingFeeAccumulated settled funding fees
cumLiquidateFeeAccumulated liquidation fees
createdMatchSequenceIdMatching engine sequence ID at creation
updatedMatchSequenceIdMatching engine sequence ID at last update
createdTimeCreation time Unix millisecond timestamp
updatedTimeUpdate time Unix millisecond timestamp
unrealizePnlUnrealized PnL
liquidatePriceEstimated liquidation price If the value = 0, it means the position is at low risk and there is no liquidation price at this time
Get Order History Demo (USER_DATA)
Get Order History Demo (USER_DATA).
query Parameters
symbolFilter by trading pair.
limitNumber of records per page, 1-1000. Default 500.
startTimeStart time (ms). Must be less than or equal to endTime.
endTimeEnd time (ms). Must be within 90 days of startTime.
pagePage index starting from 0. Default 0.
Get Order History Demo (USER_DATA) › Responses
Successful response
orderIdSystem order ID.
symbolTrading pair.
sideOrder side. See Order Side for possible values.
positionSidePosition side. See Position Mode.
statusOrder status. See Order Status.
typeOrder type. See Order Type.
timeOrder creation time (ms).
priceOrder price.
origQtyOriginal order quantity.
executedQtyFilled quantity in the base asset.
avgPriceAverage fill price.
updateTimeLast update time (ms).
clientOrderIdClient-defined order ID.
cumQuoteCumulative filled amount in the quote asset.
timeInForceTime-in-force policy. See Time in Force.
reduceOnlyWhether the order can only reduce positions.
stopPriceStop price / trigger price (if applicable).
workingTypeTrigger price type. See Trigger Price Type.