MarketsTradeFundingVaultsPortfolioReferralPointsAPIDocs
100%
Contents
OverviewAuthenticationMarket DataOrdersPositionsAccount & BalanceDepositsWithdrawalsFeesSubaccountsAPI Key ManagementGrid Bots (Beta)Funding RatesTrade HistoryPointsReferralsNotificationsVIPUser SettingsLiquidationWebSocket
← API Key Management

O2 DEX API Documentation

Base URL:https://api.oxygentwo.comv1 · Online
Overview

O2 DEX provides REST API and WebSocket interfaces. All requests use HTTPS. The Base URL is:

https://api.oxygentwo.com
Authentication 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
TierRateDescription
Default300 req/minStandard authenticated endpoints
MM Key20,000 req/minMarket Maker API Key
Public60 req/minPublic market data
WebSocketN/AWS connections not rate-limited via HTTP middleware
Auth Headers
Auth TypeHeaderValue
JWTAuthorizationBearer <jwt_token>
JWT / API KeyX-API-Key-IDYour API Key ID
JWT / API KeyX-API-SecretYour API Key secret (shown once on creation)
Global Error Codes
HTTPStatusDescription
400Bad RequestInvalid parameter
401UnauthorizedMissing or invalid JWT / API Key
403ForbiddenInsufficient permissions or account frozen
404Not FoundResource does not exist
405Method Not AllowedWrong HTTP method
429Too Many RequestsRate limit exceeded
500Internal ErrorServer error
POST/api/v1/auth/challengePublic
POST/api/v1/auth/loginPublic
GET/api/v1/auth/meJWT / API Key
POST/api/v1/auth/refreshJWT
GET/api/v1/auth/session-statusJWT
POST/api/v1/auth/verifyJWT
GET/api/v1/marketsPublic
GET/api/v1/markets/{market_id}/orderbookPublic
GET/api/v1/markets/{market_id}/candlesPublic
GET/api/v1/markets/{market_id}/tradesPublic
GET/api/v1/markets/{market_id}/open-interestPublic
GET/api/v1/markets/{market_id}/liquidationsPublic
POST/api/v1/ordersJWT / API Key
GET/api/v1/ordersJWT / API Key
POST/api/v1/orders/queryJWT / API Key
POST/api/v1/orders/batchJWT / API Key
POST/api/v1/orders/cancelJWT / API Key
POST/api/v1/orders/cancel-allJWT / API Key
POST/api/v1/orders/modifyJWT / API Key
PATCH/api/v1/orders/{order_id}JWT / API Key
GET/api/v1/positionsJWT / API Key
GET/api/v1/positions/closedJWT / API Key
POST/api/v1/positions/{position_id}/marginJWT / API Key
POST/api/v1/positions/close/{position_id}JWT / API Key
GET/api/v1/account/overviewJWT / API Key
GET/api/v1/balanceJWT / API Key
GET/api/v1/balance/historyJWT / API Key
GET/api/v1/account/equity-historyJWT / API Key
POST/api/v1/account/{account_id}/leverage/{market_id}JWT / API Key
GET/api/v1/deposits/addressJWT / API Key
GET/api/v1/deposits/historyJWT / API Key
GET/api/v1/deposits/networksJWT / API Key
POST/api/v1/withdrawals/createJWT / API Key
GET/api/v1/withdrawalsJWT / API Key
GET/api/v1/withdrawals/{withdrawal_id}JWT / API Key
POST/api/v1/withdrawals/{withdrawal_id}/cancelJWT / API Key
GET/api/v1/fees/ratesPublic
POST/api/v1/fees/estimateJWT / API Key
GET/api/v1/fees/auditJWT / API Key
GET/api/v1/fees/platform/statsPublic
POST/api/v1/subaccountsJWT / API Key
GET/api/v1/subaccountsJWT / API Key
GET/api/v1/subaccounts/{sub_wallet}JWT / API Key
POST/api/v1/subaccounts/{sub_wallet}/fundJWT / API Key
POST/api/v1/subaccounts/{sub_wallet}/withdrawJWT / API Key
GET/api/v1/subaccounts/{sub_wallet}/transfersJWT / API Key
POST/api/v1/api-keysJWT / API Key
GET/api/v1/api-keysJWT / API Key
DELETE/api/v1/api-keys/{key_id}JWT / API Key
POST/api/v1/grid-botsJWT / API Key
GET/api/v1/grid-botsJWT / API Key
GET/api/v1/grid-bots/{bot_id}JWT / API Key
POST/api/v1/grid-bots/{bot_id}/pauseJWT / API Key
POST/api/v1/grid-bots/{bot_id}/resumeJWT / API Key
POST/api/v1/grid-bots/{bot_id}/stopJWT / API Key
GET/api/v1/grid-bots/{bot_id}/ordersJWT / API Key
GET/api/v1/funding/currentPublic
GET/api/v1/funding/current/{market_id}Public
GET/api/v1/funding/history/{market_id}Public
GET/api/v1/funding/predicted/{market_id}Public
GET/api/v1/funding/index-price/{market_id}Public
GET/api/v1/funding/positionJWT / API Key
GET/api/v1/tradesJWT / API Key
GET/api/v1/trades/summaryJWT / API Key
GET/api/v1/points/balanceJWT / API Key
GET/api/v1/points/historyJWT / API Key
GET/api/v1/points/rulesJWT / API Key
GET/api/v1/points/leaderboardJWT / API Key
GET/api/v1/referrals/meJWT / API Key
GET/api/v1/referrals/linksJWT / API Key
POST/api/v1/referrals/linksJWT / API Key
GET/api/v1/referrals/commissionsJWT / API Key
GET/api/v1/referrals/commissions/summaryJWT / API Key
GET/api/v1/notificationsJWT / API Key
GET/api/v1/notifications/unread-countJWT / API Key
PUT/api/v1/notifications/{notification_id}/readJWT / API Key
GET/api/v1/vip/statusJWT / API Key
GET/api/v1/vip/tiersPublic
GET/api/v1/user-settingsJWT / API Key
POST/api/v1/user-settings/leverage/{market_id}JWT / API Key
POST/api/v1/user-settings/margin-modeJWT / API Key
GET/api/v1/liquidation/check/{market_id}JWT / API Key
GET/api/v1/liquidation/risk-levelJWT / API Key
WebSocket

WebSocket endpoint:

wss://api.oxygentwo.com/api/v1/ws

Public Channels (No Authentication)

order_bookReal-time orderbook updates (full snapshot + delta)
external_order_bookExternal market orderbook (Binance / HL aggregated)
tradesRecent trade records
ticker24-hour market overview
candlesCandlestick data push
mark_priceMark price updates
fundingFunding rate updates

Private Channels (JWT Required)

ordersUser order status updates
positionsPosition change push
balanceBalance change push
accountAccount-level event notifications

Connection 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);
};
≡Contents