Schema
Enums
Request fields whose restrictions say "use integer value of the enum" use the integer value. REST and WebSocket response fields use the corresponding status string unless stated otherwise.
OrderSideEnum
BUY
1
Buy order
SELL
2
Sell order
OrderTypeEnum
LIMIT
1
Limit order
MARKET
2
Market order
TimeInForceEnum
GTC
1
Good Til Canceled. An order stays on the book unless canceled.
FOK
2
Fill or Kill (not supported yet). Expires if not fully filled immediately.
IOC
3
Immediate Or Cancel. Fills as much as possible before expiring.
GTX
4
Post Only. Expires if the order would be filled immediately.
TransferAssetTypeEnum
EVM_DEPOSIT
0
Indicate this transfer is a deposit from the evm chain.
PERPS_DEPOSIT
1
Indicate this transfer is a deposit from the perps chain.
EVM_WITHDRAW
2
Indicate this transfer is a withdrawal to the evm chain.
PERPS_WITHDRAW
3
Indicate this transfer is a withdrawal to the perps chain.
INTERNAL
4
Indicate this transfer is an internal transfer.
SPOT_WITHDRAW
5
Indicate this transfer is a withdrawal to the spot chain.
SPOT_DEPOSIT
6
Indicate this transfer is a deposit to the spot chain.
APIKeyTypeEnum
EVM
1
Use evm private key as secret key and evm address as public key.
APIKeyPermissionEnum
permissions is a bit mask. A bit value of 1 means the permission is disabled. If permissions is omitted, all permissions are enabled.
TRADE
0
1
Place, replace, modify, and cancel orders; schedule cancels; update perps leverage, margin, and collateral.
CANCEL
1
2
Cancel orders and schedule cancels.
WITHDRAW
2
4
Withdraw from spot or perps to EVM or the other engine.
TRANSFER
3
8
Sub-account and internal transfers within spot or perps.
SignatureTypeEnum
EIP712
1
EIP-712 signature with engine-specific domain.
EIP712_UNIVERSAL
2
EIP-712 signature with universal domain for cross-engine user actions such as AddAPIKey, AddPermissionedAPIKey, and ApproveBuilderFee.
OrderStatusEnum
NEW
1
The order has been accepted into the engine.
PARTIALLY_FILLED
2
The order is partially filled in the engine.
FILLED
3
The order is fully filled in the engine.
CANCELED
4
The order has been canceled by the user.
REJECTED
5
The order has been rejected and was not processed.
EXPIRED
6
The order expired according to order rules (FOK, IOC, etc.)
TRIGGERED
10
perps only, for triggered TP/SL orders
ExecutionTypeEnum
NEW
1
The order has been accepted into the engine.
PARTIALLY_FILLED
2
The order is partially filled in the engine.
FILLED
3
The order is fully filled in the engine.
CANCELED
4
The order has been canceled by the user.
REJECTED
5
The order has been rejected and was not processed.
MODIFIED
6
The order has been modified, only reduce size.
EXPIRED
7
The order was canceled according to the order type's rules (e.g. LIMIT FOK orders with no fill, LIMIT IOC or MARKET orders that partially fill)
REPLACED
8
The order has been amended, both size and price changed.
OrderModifierEnum - perps only
NORMAL
1
Normal order.
STOP
2
Stop order.
BRACKET
3
Normal order in order with TP/SL group.
ATTACHED_STOP
4
Stop order in order with TP/SL group.
MarginModeEnum - perps only
ISOLATED
1
Isolated margin mode.
CROSS
2
Cross margin mode.
PositionSideEnum - perps only
BOTH
1
Oneway mode.
LONG
2
Hedge mode. not supported in order placement yet
SHORT
3
Hedge mode. not supported in order placement yet
StopTypeEnum - perps only
STOP_LOSS
1
Stop loss order.
TAKE_PROFIT
2
Take profit order.
TriggerTypeEnum - perps only
LAST_PRICE
1
Trigger by last trade price. not supported in order placement yet
MARK_PRICE
2
Trigger by mark price.
INDEX_PRICE
3
Trigger by index price. not supported in order placement yet
Hex String
A string starts with 0x, the rest parts consist of 0 to 9, a to z and A to Z.
Decimal String
The canonical form of a decimal string is a standardized representation that removes ambiguity and allows for direct comparison. Key rules include removing the optional plus sign, prohibiting exponential notation, and ensuring there is at least one digit to the left and right of the decimal point.
Examples
00123
123
Remove leading zeros.
+32.1
32.1
Remove the leading plus sign.
32.100
32.1
Remove trailing zeros.
0.500
0.5
Remove trailing zeros.
1.234e+2
123.4
Convert from exponential notation and remove trailing zeros.
001.230
1.23
Remove leading zeros and trailing zeros.
REST Types
Exchange Types
Common Types
BuilderParams
Builder parameters embedded in signed write requests.
id
uint64
true
non-zero
Builder account ID
fee
uint64
true
none
Builder fee in tenths of a basis point. 10 means 1 bp of the order notional is charged to the user and sent to the builder.
AddAPIKeyRequest
accountID
uint64
true
none
Target primary or subaccount ID
name
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
Name of API key
type
APIKeyTypeEnum
true
use integer value of the enum
Type of API key
publicKey
HexString
true
none
Public key bytes in hex
expiresAt
uint64
true
none
Timestamp in milliseconds.
builder
BuilderParams
false
none
Optional builder fee approval to include with this API key.
AddPermissionedAPIKeyRequest
Use this request body to create an API key with selected permissions disabled. The builder field is not supported in this request. permissions must disable TRADE, CANCEL, or both; enabling both TRADE and CANCEL is not supported.
accountID
uint64
true
none
Target primary or subaccount ID
name
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
Name of API key
type
APIKeyTypeEnum
true
use integer value of the enum
Type of API key
publicKey
HexString
true
valid EVM address
API key public key
expiresAt
uint64
true
none
Timestamp in milliseconds.
permissions
uint64
true
bit mask
Permission mask. A set bit disables the corresponding APIKeyPermissionEnum.
ApproveBuilderFeeRequest
accountID
uint64
true
none
Primary account ID of the user
builderID
uint64
true
non-zero
Builder account ID
maxFeeRate
uint64
true
0 to 2000
Maximum builder fee rate in tenths of basis points. 0 clears it. Spot orders are capped at 2000 (2%); Perps at 200 (0.2%).
RevokeAPIKeyRequest
accountID
uint64
true
none
Target primary or subaccount ID
name
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
Name of the API key to revoke
TransferAssetRequest
id
uint64
true
none
The unique identifier for this transfer request.
fromAccountID
uint64
true
none
The account ID of sender.
toAccountID
uint64
true
none
The account ID of receiver.
coinID
uint64
true
none
The coinID to send.
amount
DecimalString
true
positive value
The amount of coin to send.
type
TransferAssetTypeEnum
true
use integer value of the enum
Type of transfer
ReplaceOrderRequest
accountID
uint64
true
none
The account ID
orders
Array<ReplaceParams>
true
non-empty
List of non-empty order replacement
ReplaceParams
symbolID
uint64
true
none
The symbol ID
clOrdID
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
The unique identifier for this replacement request.
origOrderID
uint64
false
none
The unique identifier of the order to be replaced.
origClOrdID
string
false
should match ^[0-9a-zA-Z_-]{1,36}$
The client-provided identifier of the order to be replaced.
price
DecimalString
false
none
The new price for the order
quantity
DecimalString
false
none
The new quantity for the order
ScheduleCancelRequest
accountID
uint64
true
none
The account ID
scheduledTimestamp
uint64
false
none
none
Spot only types
BatchNewOrderRequest
accountID
uint64
true
none
none
orders
Array<BatchNewOrderItem>
true
non-empty
List of non-empty orders
builder
BuilderParams
false
none
Optional builder for every order in the batch
BatchNewOrderItem
symbolID
uint64
true
none
none
clOrdID
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
none
side
OrderSideEnum
true
use integer value of the enum
none
type
OrderTypeEnum
true
use integer value of the enum
none
timeInForce
TimeInForceEnum
true
use integer value of the enum
none
price
DecimalString
false
none
none
quantity
DecimalString
false
none
none
funds
DecimalString
false
none
market buy orders only
BatchCancelOrderRequest
accountID
uint64
true
none
none
cancels
Array<BatchCancelOrderItem>
true
non-empty
List of non-empty order cancellations
BatchCancelOrderItem
symbolID
uint64
true
none
none
clOrdID
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
The unique identifier for this cancellation request.
orderID
uint64
false
none
The unique identifier of the order to be canceled.
origClOrdID
string
false
should match ^[0-9a-zA-Z_-]{1,36}$
The client-provided identifier of the order to be canceled.
NewTwapOrderRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
side
OrderSideEnum
true
use integer value of the enum
Order side
quantity
DecimalString
true
positive value
TWAP total quantity
minutes
uint64
true
5 to 1440
TWAP duration in minutes
randomize
bool
true
none
Whether to randomize slices
CancelTwapOrderRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
orderID
uint64
true
non-zero
TWAP order ID
Perps only types
PerpsNewOrderRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
orders
Array<PerpsOrderItem>
true
non-empty
List of orders to submit
builder
BuilderParams
false
none
Optional default builder for every order
PerpsOrderItem
clOrdID
string
true
should match ^[0-9a-zA-Z_-]{1,36}$
Client order ID (unique per account)
modifier
OrderModifierEnum
true
use integer value of the enum
Order modifier
side
OrderSideEnum
true
use integer value of the enum
Order side
type
OrderTypeEnum
true
use integer value of the enum
Order type
timeInForce
TimeInForceEnum
true
use integer value of the enum
Time in force
price
DecimalString
false
none
none
quantity
DecimalString
false
none
none
funds
DecimalString
false
none
Market buy orders only
stopPrice
DecimalString
false
none
Trigger price for TP/SL
stopType
StopTypeEnum
false
use integer value of the enum
Stop type for TP/SL
triggerType
TriggerTypeEnum
false
use integer value of the enum
For TP/SL; only MARK_PRICE supported
reduceOnly
bool
true
none
Reduce-only flag
positionSide
PositionSideEnum
true
use integer value of the enum
Only BOTH is supported
PerpsNewTwapOrderRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
side
OrderSideEnum
true
use integer value of the enum
Order side
quantity
DecimalString
true
positive value
TWAP total quantity
minutes
uint64
true
5 to 1440
TWAP duration in minutes
randomize
bool
true
none
Whether to randomize slices
reduceOnly
bool
true
none
Reduce-only flag
PerpsCancelOrderRequest
accountID
uint64
true
none
The account ID
cancels
Array<PerpsCancelItem>
true
non-empty
List of orders to cancel
PerpsCancelItem
symbolID
uint64
true
none
Symbol ID
orderID
uint64
false
none
The order ID to cancel
clOrdID
string
false
should match ^[0-9a-zA-Z_-]{1,36}$
The client order ID
ModifyOrderRequest
accountID
uint64
true
none
Account ID
symbolID
uint64
true
none
Symbol ID
orderID
uint64
false
none
Order to be replaced
clOrdID
string
false
should match ^[0-9a-zA-Z_-]{1,36}$
Client-provided identifier to replace
price
DecimalString
false
none
The new price
quantity
DecimalString
false
none
The new quantity
stopPrice
DecimalString
false
none
The new stop price
UpdateLeverageRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
leverage
uint32
true
none
Leverage level
marginMode
MarginModeEnum
true
use integer value of the enum
1=ISOLATED, 2=CROSS
UpdateMarginRequest
accountID
uint64
true
none
The account ID
symbolID
uint64
true
none
Symbol ID
amount
DecimalString
true
non-zero
Amount to add (positive) or remove (negative)
UpdateCollateralRequest
Testnet only. This request is currently supported on testnet environments only.
accountID
uint64
true
none
The account ID
coinID
uint64
true
non-USDC coin only
Coin ID of the collateral asset. 0 is rejected.
amount
DecimalString
true
non-zero, precision
Amount to add (positive) or remove (negative).
REST Response
Succeed Response
Properties
code
int32
true
none
Always 0
data
Object
true
none
Check format in each endpoint
timestamp
uint64
true
none
The timestamp in milliseconds when this response is just sent.
Examples
Error Response
Properties
code
int32
true
none
Error code. Always negative.
error
string
true
none
Error message
timestamp
uint64
true
none
The timestamp in milliseconds when this response is just sent.
Examples
User Rate Limit
UserRateLimit
userID
uint64
true
Internal user ID
cumulativeTxNum
uint64
true
Cumulative transaction/action count used for transaction quota
cumulativeCancelNum
uint64
true
Cumulative cancel count used for cancel quota
cumulativeVolume
DecimalString
true
Cumulative trading volume in USDC
transactionQuota
int64
true
Total transaction/action quota, including trading volume and base override
transactionQuotaUsed
uint64
true
Cumulative transactions/actions used
transactionQuotaRemaining
int64
true
Remaining transaction/action quota. Returns 0 when exhausted
transactionQuotaOverridden
bool
true
Whether a configured transaction limit override replaces the default base quota
cancelQuota
int64
true
Total cancel quota
cancelQuotaUsed
uint64
true
Cumulative cancels used
cancelQuotaRemaining
int64
true
Remaining cancel quota. Returns 0 when exhausted
Announcement
AnnouncementArticle
id
int64
true
Announcement ID
externalId
string
true
External announcement identifier
style
string
true
Announcement style
title
string
true
Announcement title
label_names
Array<string>
true
Announcement labels. Empty array when no labels.
startTime
int64
true
Start time in milliseconds
endTime
int64
true
End time in milliseconds
createdAt
int64
true
Creation time in milliseconds
updatedAt
int64
true
Last update time in milliseconds
AnnouncementList
articles
Array<AnnouncementArticle>
true
Announcement summaries
page
int
true
Current page number
size
int
true
Page size
count
int64
true
Total number of announcements
AnnouncementDetail
AnnouncementDetail includes all fields from AnnouncementArticle, plus:
body
string
true
Announcement body
Symbol
SpotSymbol
id
uint64
true
Unique symbol ID
name
string
true
Unique symbol name, e.g. vBTC_vUSDC
displayName
string
true
Display name for UI, e.g. BTC/USDC
baseCoinID
uint64
true
Base coin ID
baseCoin
string
false
Base coin name
baseCoinPrecision
uint8
false
Base coin precision
quoteCoinID
uint64
true
Quote coin ID
quoteCoin
string
false
Quote coin name
quoteCoinPrecision
uint8
false
Quote coin precision
pricePrecision
int32
true
Decimal precision of order price. Price filter parameters.
tickSize
DecimalString
true
Tick size of order price. Price filter parameters.
minPrice
DecimalString
true
Minimum order price. Price filter parameters.
maxPrice
DecimalString
true
Maximum order price. Price filter parameters.
quantityPrecision
int32
true
Decimal precision of order quantity. Lot size filter parameters.
stepSize
DecimalString
true
Step size of order quantity. Lot size filter parameters.
minQuantity
DecimalString
true
Minimum order quantity. Lot size filter parameters.
maxQuantity
DecimalString
true
Maximum order quantity. Lot size filter parameters.
marketMinQuantity
DecimalString
true
Minimum order quantity in market order. Market lot size filter parameters.
marketMaxQuantity
DecimalString
true
Maximum order quantity in market order. Market lot size filter parameters.
minNotional
DecimalString
true
Minimum order notional value. Notional filter parameters.
maxNotional
DecimalString
true
Maximum order notional value. Notional filter parameters.
buyLimitUpRatio
DecimalString
true
Limit order price limitation parameters
sellLimitDownRatio
DecimalString
true
Limit order price limitation parameters
marketDeviationRatio
DecimalString
true
Market order price limitation parameters
makerFee
DecimalString
true
Default maker fee ratio
takerFee
DecimalString
true
Default taker fee ratio
status
string
true
TRADING, HALT
PerpsSymbol
id
uint64
true
Symbol ID
name
string
true
Symbol name, e.g. BTC-USD
displayName
string
true
Symbol name in UI
baseCoin
string
true
Base asset
quoteCoinID
uint64
true
Settlement coin ID
quoteCoin
string
true
Settlement coin name
quoteCoinPrecision
uint8
true
Settlement coin precision
pricePrecision
int32
true
Decimal precision of order price. Price filter parameters.
tickSize
DecimalString
true
Tick size of order price. Price filter parameters.
minPrice
DecimalString
true
Minimum order price. Price filter parameters.
maxPrice
DecimalString
true
Maximum order price. Price filter parameters.
quantityPrecision
int32
true
Decimal precision of order quantity. Lot size filter parameters.
openInterestCap
DecimalString
false
Open interest capacity in base coin
openInterestCapUSD
DecimalString
false
Open interest capacity in quote coin
stepSize
DecimalString
true
Step size of order quantity. Lot size filter parameters.
minQuantity
DecimalString
true
Minimum order quantity. Lot size filter parameters.
maxQuantity
DecimalString
true
Maximum order quantity. Lot size filter parameters.
marketMinQuantity
DecimalString
true
Minimum order quantity in market order. Market lot size filter parameters.
marketMaxQuantity
DecimalString
true
Maximum order quantity in market order. Market lot size filter parameters.
minNotional
DecimalString
true
Minimum order notional value. Notional filter parameters.
maxNotional
DecimalString
true
Maximum order notional value. Notional filter parameters.
buyLimitUpRatio
DecimalString
true
Limit order price limitation parameters
sellLimitDownRatio
DecimalString
true
Limit order price limitation parameters
marketDeviationRatio
DecimalString
true
Market order price limitation parameters
maxLeverage
uint32
true
Maximum leverage allowed
initLeverage
uint32
true
Initial leverage
marginTiers
Array<MarginTier>
true
Supported margin tiers
fundingInterval
uint32
true
Funding interval in seconds; must be a multiple of 3600.
interestRate
DecimalString
true
8h interest rate; always 0.0001
maxFundingRate
DecimalString
true
Maximum funding rate per funding interval
minFundingRate
DecimalString
true
Minimum funding rate per funding interval
makerFee
DecimalString
true
Default maker fee ratio
takerFee
DecimalString
true
Default taker fee ratio
status
string
true
Symbol status: TRADING, HALT
MarginTier
maxNotionalValue
DecimalString
true
Maximum notional value for this tier
maintenanceMarginRate
DecimalString
true
Maintenance margin rate for this tier
maxLeverage
uint32
true
Maximum leverage allowed in this tier
maintenanceDeduction
DecimalString
true
Maintenance deduction amount
Coin
SpotCoin
id
uint64
true
Unique coin ID
name
string
true
Unique coin name, e.g. vBTC, vUSDC
precision
uint8
true
Coin decimal precision
PerpsCoin
id
uint64
true
Unique coin ID
name
string
true
Unique coin name
precision
uint8
true
Coin decimal precision
marginRatio
DecimalString
true
Margin ratio of this coin
price
DecimalString
false
Current oracle price of this coin
Ticker
SpotTicker
symbol
string
true
Symbol name
lastPx
DecimalString
true
Last trade price
lastSz
DecimalString
false
Last trade quantity
openPx
DecimalString
true
Open price
highPx
DecimalString
true
High price
lowPx
DecimalString
true
Low price
vwap
DecimalString
false
Weighted average price
change
DecimalString
true
Price change
changePct
number
true
Price change percent
volume
DecimalString
true
Total traded base asset volume
quoteVolume
DecimalString
true
Total traded quote asset volume
bidPx
DecimalString
true
Best bid price
bidSz
DecimalString
true
Best bid quantity
askPx
DecimalString
true
Best ask price
askSz
DecimalString
true
Best ask quantity
openTime
uint64
true
Statistics open time in milliseconds
closeTime
uint64
true
Statistics close time in milliseconds
PerpsTicker
symbol
string
true
Symbol name
lastPx
DecimalString
true
Last trade price
lastSz
DecimalString
false
Last trade quantity
vwap
DecimalString
false
Weighted average price
change
DecimalString
false
Price change
changePct
number
false
Price change percent
openPx
DecimalString
true
Open price
highPx
DecimalString
true
High price
lowPx
DecimalString
true
Low price
volume
DecimalString
true
Total traded base asset volume
quoteVolume
DecimalString
true
Total traded quote asset volume
bidPx
DecimalString
true
Best bid price
bidSz
DecimalString
true
Best bid quantity
askPx
DecimalString
true
Best ask price
askSz
DecimalString
true
Best ask quantity
fundingRate
DecimalString
true
Current funding rate
nextFundingTime
uint64
true
Next funding time in milliseconds
indexPrice
DecimalString
true
Current index price
markPrice
DecimalString
true
Current mark price
openInterest
DecimalString
true
Current open interest
openTime
uint64
true
Statistics open time in milliseconds
closeTime
uint64
true
Statistics close time in milliseconds
Mini Ticker
MiniTicker
symbol
string
true
Symbol name
lastPx
DecimalString
true
Last trade price
openPx
DecimalString
true
Open price
highPx
DecimalString
true
High price
lowPx
DecimalString
true
Low price
volume
DecimalString
true
Total traded base asset volume
quoteVolume
DecimalString
true
Total traded quote asset volume
openTime
uint64
true
Statistics open time in milliseconds
closeTime
uint64
true
Statistics close time in milliseconds
Mark Price Ticker (perps only)
MarkPriceTicker
symbol
string
true
Symbol name
fundingRate
DecimalString
true
Current funding rate
nextFundingTime
uint64
true
Next funding time in milliseconds
indexPrice
DecimalString
true
Current index price
markPrice
DecimalString
true
Current mark price
openInterest
DecimalString
true
Current open interest
Book Ticker
BookTicker
symbol
string
true
Symbol name
bidPx
DecimalString
true
Best bid price
bidSz
DecimalString
true
Best bid quantity
askPx
DecimalString
true
Best ask price
askSz
DecimalString
true
Best ask quantity
Orderbook
OrderBook
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
updateID
uint64
true
Last update ID for sync
bids
Array<[price, qty]>
true
Bid levels (price, quantity pairs)
asks
Array<[price, qty]>
true
Ask levels (price, quantity pairs)
Candle/KLines
RPCKline
t
uint64
true
Kline open time in milliseconds
o
DecimalString
true
Open price
h
DecimalString
true
High price
l
DecimalString
true
Low price
c
DecimalString
true
Close price
v
DecimalString
true
Base asset volume
q
DecimalString
true
Quote asset volume
n
uint64
false
Number of trades
Market Trades
Trade
t
uint64
true
Trade ID
T
uint64
true
Trade time in milliseconds
s
string
true
Symbol name
p
DecimalString
true
Price
q
DecimalString
true
Quantity
S
OrderSideEnum
true
Side: BUY or SELL
bi
uint64
false
Buyer account ID
si
uint64
false
Seller account ID
User Balance
SpotAccountBalances
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
balances
Array<SpotBalance>
true
List of non zero balances
SpotBalance
id
uint64
true
Unique coin ID
coin
string
true
Coin name
total
DecimalString
true
Total balance (including locked)
locked
DecimalString
true
Locked balance in open orders
PerpsAccountBalance
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
balances
Array<PerpsBalance>
true
List of non zero balances
PerpsBalance
id
uint64
true
Coin ID
coin
string
true
Coin name
total
DecimalString
true
The wallet balance
collateral
DecimalString
true
The collateral amount, only used by non-USDC assets
marginRatio
DecimalString
true
The margin ratio of this coin
price
DecimalString
false
The oracle price of this coin in USD
User Order
OrderBuilder
builderID
uint64
true
Builder account ID
feeRate
uint64
true
Builder fee rate in tenths of basis points. A value of 10 is 1 bp.
SpotAccountOpenOrder
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
orders
Array<SpotOrder>
true
List of open orders
SpotOrder
orderID
uint64
true
Order ID
clOrdID
string
false
Client order ID
symbol
string
true
Symbol name
side
OrderSideEnum
true
Order side
type
OrderTypeEnum
true
Order type
timeInForce
TimeInForceEnum
false
Time in force
price
DecimalString
false
Order price
origQty
DecimalString
false
Original quantity
origQty
funds
false
Order Original funds
executedQty
DecimalString
true
Executed quantity
executedValue
DecimalString
true
Cumulative quote quantity
marginFrozen
DecimalString
true
Margin frozen by this order
builder
OrderBuilder
false
Builder attached to this order
status
OrderStatusEnum
true
Order status
createdAt
uint64
false
Order creation time in milliseconds
updatedAt
uint64
false
Order update time in milliseconds
PerpsAccountOpenOrder
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
orders
Array<PerpsOrder>
true
List of open orders
PerpsOrder
orderID
uint64
true
Order ID
clOrdID
string
false
Client order ID
symbol
string
true
Symbol name
side
OrderSideEnum
true
Order side
type
OrderTypeEnum
true
Order type
timeInForce
TimeInForceEnum
false
Time in force
price
DecimalString
false
Order price
origQty
DecimalString
false
Original quantity
funds
DecimalString
false
Order Original funds
executedQty
DecimalString
true
Executed quantity
executedValue
DecimalString
true
Cumulative quote quantity
marginFrozen
DecimalString
true
Margin frozen by this order
builder
OrderBuilder
false
Builder attached to this order
status
OrderStatusEnum
true
Order status
createdAt
uint64
false
Order creation time in milliseconds
updatedAt
uint64
false
Order update time in milliseconds
positionSide
PositionSideEnum
true
Position side
reduceOnly
boolean
true
Reduce only flag
stopPrice
DecimalString
false
Stop price for TP/SL
stopType
StopTypeEnum
false
Stop type for TP/SL
triggerType
TriggerTypeEnum
false
Trigger type for TP/SL
positionID
uint64
false
Position ID this order is associated with (for position TP/SL)
primaryOrderID
uint64
false
Primary order ID this stop is attached to (for attached stops)
attachedOrderIDs
Array<uint64>
false
Order IDs of stops attached to this order (TP/SL)
User Position (perps only)
PerpsAccountOpenPosition
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
positions
Array<Position>
true
List of open positions
Position
id
uint64
true
Position ID
symbol
string
true
Symbol name
marginMode
MarginModeEnum
true
Margin mode
side
PositionSideEnum
true
Position side. Always BOTH for now.
size
DecimalString
true
Position size. Negative means short, positive means long.
initialMargin
DecimalString
true
Position initial margin. If isolated, this is also isolated margin.
avgEntryPrice
DecimalString
true
Average position entry price
cumOpenCost
DecimalString
true
Cumulative position open cost
cumTradingFee
DecimalString
true
Cumulative trading fee
cumClosedSize
DecimalString
true
Total closed size during the position lifetime
avgClosePrice
DecimalString
true
Average position close price
maxSize
DecimalString
true
Max position size during the position lifetime
realizedPnL
DecimalString
true
Realized profit and loss, includes trading fees and liquidation loss
leverage
uint32
true
Position leverage
active
bool
true
The position is active/working
isTakenOver
bool
true
Whether the position is taken over by liquidator
takeOverPrice
DecimalString
true
Mark price when taken over.
createdAt
uint64
true
Position creation timestamp, in milliseconds
updatedAt
uint64
true
Position updated timestamp, in milliseconds
If position side is
BOTH, then positive position size isLONG, negative position size isSHORT, zero position size means position is closed.If position side is
LONGorSHORT. The position size is positive or zero, zero means position is closed.For now, position side is always
BOTH.
User Funding (perps only)
PerpsUserFunding
symbol
string
true
Symbol name
positionID
uint64
true
Position ID
positionSide
PositionSideEnum
true
LONG or SHORT
fundingFee
DecimalString
true
Funding fee (negative = received)
feeCoin
string
true
The name of the fee coin
timestamp
uint64
true
Funding time in milliseconds
User API Key
APIKey
name
string
true
API key name
type
APIKeyTypeEnum
true
API key type. String value of the enum.
publicKey
HexString
true
Public key (hex string)
expiresAt
uint64
true
Expiration timestamp (milliseconds)
AccountAPIKeys
spot
Array<APIKey>
true
Spot API keys for the account
perps
Array<APIKey>
true
Perps API keys for the account
User Subaccounts
Subaccount
id
uint64
true
Account ID
evmAddress
HexString
true
Account EVM address
UserSubaccounts
userID
uint64
true
Internal user ID
primaryAccountID
uint64
true
Primary trading account ID
subaccounts
Array<Subaccount>
true
Subaccounts owned by this user
User Builder
Builder
userID
uint64
true
Internal user ID
builderID
uint64
true
Builder account ID
feeRate
uint64
true
Builder fee rate in tenths of basis points. A value of 10 is 1 bp.
Builders
spot
Array<Builder>
true
Spot builder approvals for the user
perps
Array<Builder>
true
Perps builder approvals for the user
User TWAP
AccountTwapOrders
blockTime
uint64
true
Block time in milliseconds
blockHeight
uint64
true
Block number
twaps
Array<TwapOrder>
true
List of active TWAP orders
TwapOrder
userID
uint64
true
Internal user ID
accountID
uint64
true
Account ID
symbol
string
true
Symbol name
symbolID
uint64
true
Symbol ID
orderID
uint64
true
TWAP order ID
quantity
DecimalString
true
TWAP total quantity
side
OrderSideEnum
true
Order side as BUY or SELL
minutes
uint64
true
TWAP duration in minutes
randomize
bool
true
Whether slices are randomized
reduceOnly
bool
true
Reduce-only flag
executedQty
DecimalString
true
Executed quantity
executedValue
DecimalString
true
Executed notional value
createdAt
uint64
true
Creation time in milliseconds
nextActiveAt
uint64
true
Next activation time in milliseconds
active
bool
true
Whether this TWAP is active
TwapOrderResponse
orderID
uint64
true
TWAP order ID
Fee Rate
FeeRate
makerFeeRate
DecimalString
true
Effective maker fee rate after discounts. Negative values indicate a maker rebate.
takerFeeRate
DecimalString
true
Effective taker fee rate after discounts.
feeTier
int
true
Fee tier (0-6) determined by the user's 14-day weighted trading volume.
stakingTier
int
true
Staking tier (0-6) determined by the user's SOSO token staking amount.
makerRebateTier
int
true
Maker rebate tier (0-3) determined by the user's share of global 14-day maker volume.
User Trade
UserTrade
symbol
string
true
Symbol name
tradeID
uint64
true
Trade ID
orderID
uint64
true
Order ID
clOrdID
string
true
Client Order ID
side
OrderSideEnum
true
Trade side: BUY or SELL
price
DecimalString
true
Trade price
quantity
DecimalString
true
Trade quantity
fee
DecimalString
false
Commission amount
builderFee
DecimalString
false
Builder fee amount
feeCoin
string
false
Commission asset
isMaker
bool
false
Whether trade was maker
time
uint64
true
Trade time in milliseconds
WebSocket Types
Misc types
WsPingRequest
WsPingResponse
WsErrorResponse
WsSubscriptionRequest
WsSubscriptionResponse
WsSubscriptionParams
WsSubscriptionResult
WsTickerSubscriptionParams
WsTickerSubscriptionResult
WsAllTickerSubscriptionParams
WsAllTickerSubscriptionResult
WsMiniTickerSubscriptionParams
WsMiniTickerSubscriptionResult
WsAllMiniTickerSubscriptionParams
WsAllMiniTickerSubscriptionResult
WsBookTickerSubscriptionParams
WsBookTickerSubscriptionResult
WsAllBookTickerSubscriptionParams
WsAllBookTickerSubscriptionResult
WsMarkPriceSubscriptionParams
WsMarkPriceSubscriptionResult
WsAllMarkPriceSubscriptionParams
WsAllMarkPriceSubscriptionResult
WsCoinPriceSubscriptionParams
WsCoinPriceSubscriptionResult
WsAllCoinPriceSubscriptionParams
WsAllCoinPriceSubscriptionResult
WsL2BookSubscriptionParams
WsL2BookSubscriptionResult
WsL4BookSubscriptionParams
WsL4BookSubscriptionResult
WsCandleSubscriptionParams
WsCandleSubscriptionResult
WsTradeSubscriptionParams
WsTradeSubscriptionResult
WsUserFrontendStateSubscriptionParams
WsUserFrontendStateSubscriptionResult
WsAccountUpdateSubscriptionParams
WsAccountUpdateSubscriptionResult
WsOrderUpdateSubscriptionParams
WsOrderUpdateSubscriptionResult
WsUserTradeSubscriptionParams
WsUserTradeSubscriptionResult
WsUserEventSubscriptionParams
WsUserEventSubscriptionResult
Ticker
WsTickerData
Mini Ticker
WsMiniTickerData
Book Ticker
WsBookTickerData
Mark Price (perps only)
WsMarkPriceData
Coin Price (perps only)
WsCoinPriceData
Book Depth Snapshot
WsDepthSnapshotData
Book Depth Update
WsDepthUpdateData
Candle / Kline
Candle
Account Update
Spot Account Update
WsSpotBalance
WsTwapOrder
WsSpotAccountUpdate
Perp Account Update
WsPerpsBalanceLite
WsPerpsPositionLite
WsPerpsAccountUpdate
Order Update
Spot Order Update
WsSpotOrder
WsSpotOrderUpdate
Perp Order Update
WsPerpsOrder
WsPerpsOrderUpdate
Market Trades
WsTrade
User Trades
Spot
WsSpotUserTrade
Perps
WsPerpsUserTrade
User Frontend State
Spot
WsSpotState
Perps
WsPerpsBalance
WsPerpsPosition
WsPerpsSymbolConfig
WsPerpsBalanceDetailed
WsPerpsState
User Event
PerpsLiquidatedPosition
WsUserLiquidation
WsUserEvent
Last updated