Module models

Module models 

Source
Expand description

Data transfer objects for deserializing OKX HTTP API payloads.

Structsยง

OKXAccount
Represents an account balance snapshot from GET /api/v5/account/balance.
OKXBalanceDetail
Represents a balance detail for a single currency in an OKX account.
OKXCancelAlgoOrderRequest
Represents the request body for POST /api/v5/trade/cancel-algos (cancel algo order).
OKXCancelAlgoOrderResponse
Represents the response from POST /api/v5/trade/cancel-algos (cancel algo order).
OKXCandlestick
Represents a candlestick from the GET /api/v5/market/history-candles endpoint. The tuple contains [timestamp(ms), open, high, low, close, volume, turnover, base_volume, count].
OKXFeeRate
Represents a fee rate entry from GET /api/v5/account/trade-fee.
OKXIndexTicker
Represents an index price from the GET /api/v5/public/index-tickers endpoint.
OKXMarkPrice
Represents a mark price from the GET /api/v5/public/mark-price endpoint.
OKXOrderAlgo
Represents an algo order response from /trade/order-algo-* endpoints.
OKXOrderHistory
Represents a single historical order record from GET /api/v5/trade/orders-history.
OKXPlaceAlgoOrderRequest
Represents the request body for POST /api/v5/trade/order-algo (place algo order).
OKXPlaceAlgoOrderResponse
Represents the response from POST /api/v5/trade/order-algo (place algo order).
OKXPlaceOrderResponse
Represents the response from POST /api/v5/trade/order (place order). This model is designed to be flexible and handle the minimal fields that the API returns.
OKXPosition
Represents a single open position from GET /api/v5/account/positions.
OKXPositionHistory
Represents a single historical position record from GET /api/v5/account/positions-history.
OKXPositionTier
Represents a position tier from the GET /api/v5/public/position-tiers endpoint.
OKXServerTime
Represents the response from GET /api/v5/public/time (get system time).
OKXTrade
Represents a trade tick from the GET /api/v5/market/trades endpoint.
OKXTransactionDetail
Represents a transaction detail (fill) from GET /api/v5/trade/fills.