Base URLs
All REST endpoints live under a single versioned gateway. All WebSocket traffic runs on a single multiplexed socket.
Gateway
Mainnet
| Transport | Base URL |
|---|---|
| REST | https://api.godarkdex.com/api/v1 |
| WebSocket | wss://api.godarkdex.com/ws/v1 |
Testnet
| Transport | Base URL |
|---|---|
| REST | https://api.godarkdex-testnet.com/api/v1 |
| WebSocket | wss://api.godarkdex-testnet.com/ws/v1 |
API keys, bearer tokens, and balances are not shared between mainnet and testnet — credentials issued on one environment will not authenticate against the other.
All REST examples in these docs omit the base URL for brevity and default to mainnet. A request shown as POST /orders means POST https://api.godarkdex.com/api/v1/orders on mainnet or POST https://api.godarkdex-testnet.com/api/v1/orders on testnet.
Endpoint Reference
REST
| Method | Path | Auth | Purpose |
|---|---|---|---|
POST | /auth/token | — | Exchange api_key + api_secret + passphrase for bearer token |
POST | /auth/token/revoke | — | Revoke a bearer token |
GET | /instruments | — | List all tradable instruments |
GET | /instruments/{symbol} | — | Single instrument detail |
POST | /orders | Bearer | Place an order |
DELETE | /orders/{orderId} | Bearer | Cancel an order |
PATCH | /orders/{orderId} | Bearer | Modify an order |
GET | /orders/{orderId} | Bearer | Fetch a single order by id |
POST | /orders/mass-quote | Bearer | Batch cancel-replace (Prime and Apex tiers) |
GET | /positions | Bearer | Snapshot of open positions |
GET | /account | Bearer | Balance, VIP tier, and account-level config in one call |
GET | /account/vip | Bearer | Current VIP tier and rolling 30d volume |
GET | /vip/tiers | — | Public fee schedule for all tiers |
GET | /transparency | — | Single public transparency snapshot: reserves root, engine attestation, and aggregate stats (supports ?epoch= and ?window=) |
GET | /settlement/status/{batchId} | Bearer | Batch settlement status |
WebSocket
One endpoint, one socket per session. Ops and channels are multiplexed:
wss://api.godarkdex.com/ws/v1
| Op / Channel | Direction | Purpose |
|---|---|---|
op: login | Client → Server | Authenticate the socket using a bearer token |
op: logout | Client → Server | End the session cleanly |
op: ping / pong | Both | Heartbeat |
op: subscribe / unsubscribe | Client → Server | Manage channel subscriptions |
op: account.info | Client → Server | Fetch balance, VIP tier, and account config (mirrors GET /account) |
op: order.place / order.cancel / order.modify | Client → Server | Trading (mirrors REST) |
channel: orders | Server → Client | Snapshot + incremental order updates |
channel: positions | Server → Client | Snapshot + incremental position updates |
See WebSocket Trading, Orders Channel, and Positions Channel for message schemas.
Common Headers
All authenticated REST requests require:
Content-Type: application/json
Authorization: Bearer <access_token>
All responses include:
| Header | Purpose |
|---|---|
X-Request-Id | Unique id for this request. Echo in bug reports. |
X-RateLimit-Limit | Request budget for the current window. |
X-RateLimit-Remaining | Requests left in the current window. |
X-RateLimit-Reset | Unix seconds when the window resets. |
Response format
All REST responses share the same JSON shape:
{
"code": 0,
"data": { },
"timestamp": "2026-04-20T10:30:00.123Z",
"request_id": "req_01HXYZ..."
}
On error:
{
"code": 1410,
"message": "Margin insufficient",
"timestamp": "2026-04-20T10:30:00.123Z",
"request_id": "req_01HXYZ..."
}
See Error Codes for the code reference.
Server Time
GET /time
Returns server time (useful for clock-skew diagnostics and signing windows).
{
"code": 0,
"data": {
"server_time": "2026-04-20T10:30:00.123Z",
"server_time_ns": 1839975000123000000
}
}