Public
Public REST endpoints use ${PUBLIC_ENDPOINT} as the base URL:
Mainnet:
https://mainnet-gw.sodex.dev/api/v1Testnet:
https://testnet-gw.sodex.dev/api/v1
User
Query Subaccounts
GET ${PUBLIC_ENDPOINT}/user/{userAddress}/subaccounts
Get the user's primary account ID and subaccounts.
curl -X GET "${PUBLIC_ENDPOINT}/user/0x0123456789070ce8f0d6bab722103d12674bc257/subaccounts" \
-H 'Accept: application/json'Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Use data.primaryAccountID as the trading accountID for builder-fee approval and as the builder ID when that account is the builder.
Query API Keys
GET ${PUBLIC_ENDPOINT}/user/{userAddress}/api-keys
Get API keys for the user's primary account by default, or an owned subaccount selected by accountID.
Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Query Params
accountID
uint64
false
none
Optional primary or owned subaccount ID. The primary account is used by default.
name
string
false
should match ^[0-9a-zA-Z_-]{1,36}$
Optional API key name filter
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Add API Key
POST ${PUBLIC_ENDPOINT}/user/{userAddress}/api-keys
Add an API key to both spot and perps. Use permissions to disable selected API key permissions, or builder to approve a builder fee in the same signed action.
Auth: signed write with the universal domain;
X-API-Chainis required
Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Headers
X-API-Chain
uint64
true
Any uint64. Use this exact value as EIP-712 domain.chainId when generating X-API-Sign.
X-API-Sign
HexString
true
EIP-712 universal signature from the user's wallet
X-API-Nonce
uint64
true
Unique nonce in milliseconds
Request Body
See AddAPIKeyRequest or AddPermissionedAPIKeyRequest in Schema.
Additional Information:
accountIDmust be the primary account ID or one of the subaccount IDs belonging touserAddress.The request succeeds only when both spot and perps accept it.
builder, if provided, usesBuilderParams.permissions, if provided, is a bit mask where a set bit disables the correspondingAPIKeyPermissionEnum.A permissioned API key must disable
TRADE,CANCEL, or both; enabling bothTRADEandCANCELis not supported.builderandpermissionscannot be used together in the same request.
Response
code
int32
true
Response status code. 0 means success.
data
null
true
No endpoint-specific response payload.
timestamp
uint64
true
Response timestamp in milliseconds.
Revoke API Key
API key revocation does not support the universal domain. To revoke an API key from both markets, submit two engine-specific requests.
Call
DELETE ${SPOT_ENDPOINT}/accounts/api-keyswith aspotdomain signature. See Remove API Key in the Spot REST API.Call
DELETE ${PERPS_ENDPOINT}/accounts/api-keyswith afuturesdomain signature. See Remove API Key in the Perps REST API.
Use the same RevokeAPIKeyRequest body for both calls, but sign each request separately with the account's master wallet. Engine-specific EIP-712 signatures use signature type 0x01; a universal 0x02 signature cannot be used for revocation. See Trading actions for signing details and REST API endpoints for the endpoint base URLs.
Both calls are required. A successful spot revoke does not revoke the key from perps, and a successful perps revoke does not revoke it from spot. Each call returns its own response and can succeed or fail independently.
Query Builders
GET ${PUBLIC_ENDPOINT}/user/{userAddress}/builders
Get approved builders for the user.
Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Approve Builder Fee
POST ${PUBLIC_ENDPOINT}/user/{userAddress}/builders
Approve or clear a builder fee on both spot and perps.
Auth: signed write with the universal domain;
X-API-Chainis required
Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Headers
X-API-Chain
uint64
true
Any uint64. Use this exact value as EIP-712 domain.chainId when generating X-API-Sign.
X-API-Sign
HexString
true
EIP-712 universal signature from the user's wallet
X-API-Nonce
uint64
true
Unique nonce in milliseconds
Request Body
See ApproveBuilderFeeRequest in Schema.
Additional Information:
accountIDmust be the primary account ID ofuserAddress.builderIDis the builder's trading account ID. That account must exist in both spot and perps and have at least100vUSDC in each engine.A user may have at most 10 builder approvals at a time.
The request succeeds only when both spot and perps accept it.
maxFeeRatemust be between0and2000, inclusive. Spot orders are capped at2000(2%); Perps orders are capped at200(0.2%).maxFeeRate=0clears the builder approval.
Response
code
int32
true
Response status code. 0 means success.
data
null
true
No endpoint-specific response payload.
timestamp
uint64
true
Response timestamp in milliseconds.
Query user rate limits
GET ${PUBLIC_ENDPOINT}/user/{userAddress}/ratelimit
Get transaction and cancel quota information for a user address.
Path Params
userAddress
HexString
true
valid EVM address
User EVM address
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Announcement
Mainnet only. These endpoints are not available on testnet.
Query announcements
GET ${PUBLIC_ENDPOINT}/announcements
Get a paginated list of public announcements.
Query Params
page
int
false
>= 1; default 1
Page number
size
int
false
1 to 100; default 20
Page size
lang
string
false
en, zh, ja, ko
Announcement language. Defaults to en.
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Query announcement detail
GET ${PUBLIC_ENDPOINT}/announcements/detail/{id}
Get a public announcement detail by ID.
Path Params
id
int64
true
numeric
Announcement ID
Query Params
lang
string
false
en, zh, ja, ko
Announcement language. Defaults to en.
plainText
bool
false
true or false
Whether to return plain text body. Defaults to false.
Response
code
int32
true
Response status code. 0 means success.
timestamp
uint64
true
Response timestamp in milliseconds.
Last updated