O2 DEX API Documentation
Base URL:
https://api.oxygentwo.comv1 · OnlineOverview
O2 DEX provides REST API and WebSocket interfaces. All requests use HTTPS. The Base URL is:
https://api.oxygentwo.comAuthentication Methods
Public
Public Endpoints
No authentication required. Includes market data, candlesticks, orderbook, trade history, etc.
JWT
JWT Bearer Token
Obtained after web login. Authorization: Bearer <token>
JWT / API Key
API Key (Recommended for Programmatic Trading)
Create via API Key Management page. User/private REST endpoints accept either Authorization: Bearer <token> or the two API key headers: X-API-Key-ID + X-API-Secret
Response Format
All responses use a unified JSON envelope format:
{
"success": true,
"data": { ... },
"error": null
}Rate Limits
Default 300 req/min. Market Maker API Key: 20,000 req/min. Exceeding returns HTTP 429.
WebSocket
WebSocket endpoint: wss://api.oxygentwo.com/api/v1/ws
Rate Limits
Auth Headers
Global Error Codes
POST
/api/v1/auth/challengePublicPOST
/api/v1/auth/loginPublicGET
/api/v1/auth/meJWT / API KeyPOST
/api/v1/auth/refreshJWTGET
/api/v1/auth/session-statusJWTPOST
/api/v1/auth/verifyJWTGET
/api/v1/marketsPublicGET
/api/v1/markets/{market_id}/orderbookPublicGET
/api/v1/markets/{market_id}/candlesPublicGET
/api/v1/markets/{market_id}/tradesPublicGET
/api/v1/markets/{market_id}/open-interestPublicGET
/api/v1/markets/{market_id}/liquidationsPublicPOST
/api/v1/ordersJWT / API KeyGET
/api/v1/ordersJWT / API KeyPOST
/api/v1/orders/queryJWT / API KeyPOST
/api/v1/orders/batchJWT / API KeyPOST
/api/v1/orders/cancelJWT / API KeyPOST
/api/v1/orders/cancel-allJWT / API KeyPOST
/api/v1/orders/modifyJWT / API KeyPATCH
/api/v1/orders/{order_id}JWT / API KeyGET
/api/v1/positionsJWT / API KeyGET
/api/v1/positions/closedJWT / API KeyPOST
/api/v1/positions/{position_id}/marginJWT / API KeyPOST
/api/v1/positions/close/{position_id}JWT / API KeyGET
/api/v1/account/overviewJWT / API KeyGET
/api/v1/balanceJWT / API KeyGET
/api/v1/balance/historyJWT / API KeyGET
/api/v1/account/equity-historyJWT / API KeyPOST
/api/v1/account/{account_id}/leverage/{market_id}JWT / API KeyGET
/api/v1/deposits/addressJWT / API KeyGET
/api/v1/deposits/historyJWT / API KeyGET
/api/v1/deposits/networksJWT / API KeyPOST
/api/v1/withdrawals/createJWT / API KeyGET
/api/v1/withdrawalsJWT / API KeyGET
/api/v1/withdrawals/{withdrawal_id}JWT / API KeyPOST
/api/v1/withdrawals/{withdrawal_id}/cancelJWT / API KeyGET
/api/v1/fees/ratesPublicPOST
/api/v1/fees/estimateJWT / API KeyGET
/api/v1/fees/auditJWT / API KeyGET
/api/v1/fees/platform/statsPublicPOST
/api/v1/subaccountsJWT / API KeyGET
/api/v1/subaccountsJWT / API KeyGET
/api/v1/subaccounts/{sub_wallet}JWT / API KeyPOST
/api/v1/subaccounts/{sub_wallet}/fundJWT / API KeyPOST
/api/v1/subaccounts/{sub_wallet}/withdrawJWT / API KeyGET
/api/v1/subaccounts/{sub_wallet}/transfersJWT / API KeyPOST
/api/v1/api-keysJWT / API KeyGET
/api/v1/api-keysJWT / API KeyDELETE
/api/v1/api-keys/{key_id}JWT / API KeyPOST
/api/v1/grid-botsJWT / API KeyGET
/api/v1/grid-botsJWT / API KeyGET
/api/v1/grid-bots/{bot_id}JWT / API KeyPOST
/api/v1/grid-bots/{bot_id}/pauseJWT / API KeyPOST
/api/v1/grid-bots/{bot_id}/resumeJWT / API KeyPOST
/api/v1/grid-bots/{bot_id}/stopJWT / API KeyGET
/api/v1/grid-bots/{bot_id}/ordersJWT / API KeyGET
/api/v1/funding/currentPublicGET
/api/v1/funding/current/{market_id}PublicGET
/api/v1/funding/history/{market_id}PublicGET
/api/v1/funding/predicted/{market_id}PublicGET
/api/v1/funding/index-price/{market_id}PublicGET
/api/v1/funding/positionJWT / API KeyGET
/api/v1/tradesJWT / API KeyGET
/api/v1/trades/summaryJWT / API KeyGET
/api/v1/points/balanceJWT / API KeyGET
/api/v1/points/historyJWT / API KeyGET
/api/v1/points/rulesJWT / API KeyGET
/api/v1/points/leaderboardJWT / API KeyGET
/api/v1/referrals/meJWT / API KeyGET
/api/v1/referrals/linksJWT / API KeyPOST
/api/v1/referrals/linksJWT / API KeyGET
/api/v1/referrals/commissionsJWT / API KeyGET
/api/v1/referrals/commissions/summaryJWT / API KeyGET
/api/v1/notificationsJWT / API KeyGET
/api/v1/notifications/unread-countJWT / API KeyPUT
/api/v1/notifications/{notification_id}/readJWT / API KeyGET
/api/v1/vip/statusJWT / API KeyGET
/api/v1/vip/tiersPublicGET
/api/v1/user-settingsJWT / API KeyPOST
/api/v1/user-settings/leverage/{market_id}JWT / API KeyPOST
/api/v1/user-settings/margin-modeJWT / API KeyGET
/api/v1/liquidation/check/{market_id}JWT / API KeyGET
/api/v1/liquidation/risk-levelJWT / API KeyWebSocket
WebSocket endpoint:
wss://api.oxygentwo.com/api/v1/wsPublic Channels (No Authentication)
order_bookReal-time orderbook updates (full snapshot + delta)external_order_bookExternal market orderbook (Binance / HL aggregated)tradesRecent trade recordsticker24-hour market overviewcandlesCandlestick data pushmark_priceMark price updatesfundingFunding rate updatesPrivate Channels (JWT Required)
ordersUser order status updatespositionsPosition change pushbalanceBalance change pushaccountAccount-level event notificationsConnection Example
const ws = new WebSocket("wss://api.oxygentwo.com/api/v1/ws"); ws.onopen = () => { // Subscribe to public channels ws.send(JSON.stringify({ type: "subscribe", channel: "order_book", market_id: 1 })); }; ws.onmessage = (event) => { const msg = JSON.parse(event.data); console.log(msg.channel, msg.data); };