For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trading API

Use REST for request/response operations and WebSocket Streams for realtime market and account events.

Choose an interface

REST APIWebSocket StreamsSchema

Documentation

QuickstartAPI Keys and NoncesAuthentication & SigningRate Limits

Endpoint

  • Mainnet REST Endpoint

    • Spot: https://mainnet-gw.sodex.dev/api/v1/spot

    • Perps: https://mainnet-gw.sodex.dev/api/v1/perps

  • Mainnet WebSocket Endpoint

    • Spot: wss://mainnet-gw.sodex.dev/ws/spot

    • Perps: wss://mainnet-gw.sodex.dev/ws/perps

  • Testnet REST Endpoint

    • Spot: https://testnet-gw.sodex.dev/api/v1/spot

    • Perps: https://testnet-gw.sodex.dev/api/v1/perps

  • Testnet WebSocket Endpoint

    • Spot: wss://testnet-gw.sodex.dev/ws/spot

    • Perps: wss://testnet-gw.sodex.dev/ws/perps

Get account ID

Account IDs are required to query account data and to sign trading actions. Retrieve them via either of:

Via REST API

The aid field in the response is the account ID. By default this is the primary account; pass ?accountID=<id> to query a specific sub-account. The same endpoint is available under ${SPOT_ENDPOINT} for spot.

See WsPerpsState for the full response shape.

Implementation example

Go SDK Signing Guide

Last updated