Skip to navigation

Convert units

Convert between the number of contracts and the amount of coins/quote currency for a derivatives instrument.

Query parameters

typeenumOptional

Conversion type: 1 (convert coin to contracts) or 2 (convert contracts to coin). The default is 1.

Allowed values:
instIdstringRequired

Instrument ID, only applicable to FUTURES/SWAP/OPTION.

szstringRequired

Quantity to convert. When converting a currency to contracts, it refers to the amount of coin; when converting contracts to a currency, it refers to the number of contracts.

pxstringOptional

Order price. Not required for SPOT; required for OPTION when unit is usds.

unitenumOptional

The unit of currency: coin or usds (USDT/USDC). Only applicable to SPOT-margined contracts.

Allowed values:

Response

Successful response
codestringOptional

Result code. 0 means success; any other value is an error code.

msgstringOptional
Error message. Empty on success.
datalist of objectsOptional