Parameters Reference
A comprehensive glossary of all parameters used across the o2 Exchange API endpoints.
accountUser wallet address to filter trades or orders
0x91F0E90eff49ee08c0d42E617F5ec4e7A52F5b3A9D9E3Bbd0Aa995567fe98df5addressUser wallet address for balance queries
GET /balance0x91F0E90eff49ee08c0d42E617F5ec4e7A52F5b3A9D9E3Bbd0Aa995567fe98df5asset_idAsset contract identifier for balance queries
GET /balance0x286c479da40dc953bddc3bb4c453b608bba2e0ac483b077bd475174115395e6bGET /marketscontractTrading account contract ID for filtering
0xd3ca0cbf374bb2e11e1f554b088e0bc6b168b251b820a42a69624be4aa2f2a2fPOST /accountscountNumber of items to return in a single request
count_backNumber of historical bars to return. Overrides time range when specified.
depthNumber of price levels to return on each side (bids and asks)
directionQuery direction for result ordering
ascAscending order (oldest first)descDescending order (newest first)descfromStart timestamp in milliseconds (Unix epoch time) for historical data range
is_openFilter to show only open/active orders
levelOrder book aggregation level
GET /aggregated/orderbook22Aggregated order book (price levels with total volumes)3Full depth order book2market_idUnique identifier for a trading market
GET /markets/summaryGET /markets/tickerGET /depthGET /tradesGET /trades_by_accountGET /barsGET /ordersGET /order0xc0c5c48315d8cfff9f00777f81fdf04e9b4ef69e802a1a068549a8d6a06ee19fGET /marketsmarket_pairMarket pair in BASE_QUOTE format (aggregator endpoints alternative to market_id)
FUEL_USDCGET /aggregated/summaryorder_idSpecific order identifier. Must be used together with market_id.
GET /order0x7f8e9d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8eGET /ordersownerOwner wallet address to look up the trading account
GET /accounts0x91F0E90eff49ee08c0d42E617F5ec4e7A52F5b3A9D9E3Bbd0Aa995567fe98df5owner_contractOwner contract ID to look up the trading account (when owner is a contract)
GET /accounts0xd3ca0cbf374bb2e11e1f554b088e0bc6b168b251b820a42a69624be4aa2f2a2fprecisionPrice aggregation precision level. Controls how prices are grouped in order book display.
resolutionBar/candlestick time resolution
start_order_idStarting order ID for pagination. Use with start_timestamp.
GET /orders0x7f8e9d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8eGET /ordersstart_timestampStarting timestamp filter for pagination
1699200000start_trade_idStarting trade ID for pagination. Use with start_timestamp.
0x5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4bGET /tradestoEnd timestamp in milliseconds (Unix epoch time) for historical data range
trade_account_idTrading account contract ID for account lookup
GET /accounts0xd3ca0cbf374bb2e11e1f554b088e0bc6b168b251b820a42a69624be4aa2f2a2fPOST /accountsO2-Owner-IdTrading account owner address for authentication and authorization
PUT /sessionPOST /session/actionsPOST /accounts/callPOST /accounts/callsPOST /accounts/upgradePOST /accounts/withdraw0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdefactionsArray of market actions to execute. Each element contains a market_id and an array of actions (CreateOrder, CancelOrder, SettleBalance, RegisterReferer). Maximum 5 actions total distributed across maximum 5 markets.
POST /session/actions5 actions, 5 markets[{ "market_id": "0x...", "actions": [{ "CreateOrder": { "side": "Buy", "price": "1000000000", "quantity": "100000000", "order_type": "Spot" } }] }]amountAmount to withdraw (as string to preserve precision). Must be in asset's smallest unit.
callContract call parameters object containing method name and arguments
POST /accounts/call{ "method": "place_order", "params": { ... } }callsArray of contract call parameter objects for batch execution
POST /accounts/calls[{ "method": "deposit", "params": {...} }]collect_ordersWhen true, the API will subscribe to order events and return the created orders in the response. For fastest confirmations, set this to false.
contract_idTrading account contract ID for session or account operations
PUT /sessionPOST /accounts/callPOST /accounts/callsPOST /accounts/upgradePOST /accounts/withdraw0xd3ca0cbf374bb2e11e1f554b088e0bc6b168b251b820a42a69624be4aa2f2a2fPOST /accountsestimate_gas_usageWhen true, estimates gas usage for the transaction before execution. Helps prevent out-of-gas errors.
expirySession expiry timestamp (Unix epoch time). Session becomes invalid after this time.
identity.AddressUser wallet address for creating a new trading account contract
POST /accounts0x91F0E90eff49ee08c0d42E617F5ec4e7A52F5b3A9D9E3Bbd0Aa995567fe98df5implementationNew implementation contract address for account upgrades
POST /accounts/upgrade0x7890abcdef1234567890abcdef1234567890abcdef1234567890abcdef123456min_gas_limitMinimum gas limit for the transaction execution. Overrides automatic gas calculation.
nonceNonce value for replay attack protection. Must be unique and incrementing.
PUT /sessionPOST /session/actionsPOST /accounts/callPOST /accounts/callsPOST /accounts/upgradePOST /accounts/withdraw1order_typeSpecifies the execution behavior for a CreateOrder action. Controls how the order matches against the order book.
POST /session/actionsSpotExecutes at best price; unfilled added to book (default)MarketImmediate execution; auto-cancelled after fillFillOrKillAll-or-nothing; reverts if not completely filledPostOnlyMaker-only; reverts if any would be taker{ "Limit": [price, timestamp] }Price-time priority execution{ "BoundedMarket": {...} }Market order within price bounds"Spot"session_idSession key identifier. Can be an Address or ContractId identity type used to authorize session-based transactions.
{ "Address": "0x91F0E90eff49ee08c0d42E617F5ec4e7A52F5b3A9D9E3Bbd0Aa995567fe98df5" }signatureCryptographic signature proving ownership and authorization. Supports Secp256r1, Secp256k1, and Ed25519.
PUT /sessionPOST /session/actionsPOST /accounts/callPOST /accounts/callsPOST /accounts/upgradePOST /accounts/withdraw{ "Secp256k1": "0x789..." }trade_account_idTrading account contract ID for session actions
POST /session/actions0xd3ca0cbf374bb2e11e1f554b088e0bc6b168b251b820a42a69624be4aa2f2a2fPOST /accountsvariable_outputsNumber of variable outputs to include in the transaction. Required when outputs are not known in advance.
Parameter Patterns & Best Practices
Mutual Exclusivity
Some parameters cannot be used together:
Account Lookup (GET /accounts):
- Use
ownerORtrade_account_id, never both
Trade/Order Filtering (GET /trades_by_account, GET /orders):
- Use
accountORcontract, never both
Pagination Pattern
When paginating through trades or orders:
Initial Request: Omit pagination parameters
GET /trades?market_id=XXX&direction=desc&count=50Subsequent Requests: Use timestamp and ID from last item
GET /trades?market_id=XXX&direction=desc&count=50&start_timestamp=1699200000&start_trade_id=0xabc...Direction Usage:
desc: Newest first (most common for UI)asc: Oldest first (useful for backfilling)
Rate Limits
- Trades: Maximum 50 items per request
- Bars (OHLCV): Maximum 5000 bars per request
- Order Book Depth: Maximum 500 levels per side (aggregator)
Authentication Requirements
Authenticated endpoints require:
O2-Owner-Idheader with owner addresssignaturein request body (cryptographically signed)noncein request body (unique and incrementing)
The signature must be generated by signing the request payload with the owner's private key.
WebSocket Parameters
For WebSocket subscriptions, parameters are sent in the message body:
{
"action": "subscribe_depth",
"market_id": "c0c5c48315d8cfff9f00777f81fdf04e9b4ef69e802a1a068549a8d6a06ee19f",
"precision": "10"
}Available Actions
subscribe_depth: Order book updates- Requires:
market_id,precision
- Requires:
subscribe_orders: Order updates- Requires:
market_id, account parameters
- Requires:
subscribe_trades: Trade updates- Requires:
market_id
- Requires:
subscribe_balances: Balance updates- Requires: account parameters
See System Endpoints for detailed WebSocket examples.