1. Base URLs and Environments
Ekiden provides separate base URLs for each environment:- Mainnet:
(Coming Soon) - Testnet Beta: https://api.cnt.ekiden.fi/api/v1
- Staging: https://api.canton.ekiden.fi/api/v1
All API calls must use HTTPS.
2. Versioning
We use URI-based versioning:- Format:
/v1/ - Example:
GET /v1/market/tickers
/v2/).
3. RESTful Design
- Endpoints are organized by resource.
4. WebSocket Protocol
Endpoints:- Mainnet:
(Coming Soon) - Testnet Beta:
- Public data:
wss://api.cnt.ekiden.fi/ws/public - Private data:
wss://api.cnt.ekiden.fi/ws/private
- Public data:
- Staging:
- Public data:
wss://api.canton.ekiden.fi/ws/public - Private data:
wss://api.canton.ekiden.fi/ws/private
- Public data:
op field with snake_case values. Optional req_id lets you correlate requests/responses.
Topics
Public topics (market data)
orderbook.<depth>.<symbol>(e.g.orderbook.10.BTC-USDCx) — order book snapshots and deltastrade.<symbol>— public trade feedticker.<symbol>— 24h ticker updateskline.<interval>.<symbol>— candlestick updatesall_liquidations.<symbol>— liquidation eventsinsurance_pool.<symbol>— insurance pool snapshotsadl_alert.<symbol>— ADL alert updates
Private topics (authenticated)
Available only after successful authentication on/ws/private.
order— order updatesposition— position updatesexecution— execution (fill) updatesaccount_balance— account balance updates
Subscribe
Client → ServerUnsubscribe
Client → ServerEvent delivery
Authenticate (private WebSocket only)
Private WebSocket connections support two authentication methods:JWT
Authenticate immediately after connecting to/ws/private using a JWT access token obtained from the REST authorization endpoint.
Client → Server
API Key
Authenticate immediately after connecting to/ws/private using an API key.
Client → Server
signature must be an Ed25519 signature of:
EKIDEN_WS|AUTH|{timestamp_ms}|{nonce}
5. Authentication (REST)
Private REST and private WebSocket use a short-lived JWT issued by the gateway, or API Key authentication.JWT Authentication
- Request a token via
POST /api/v1/authorize
- Use the token with Bearer auth for private endpoints:
API Key Authentication
Gateway supports API-key auth via headers:X-API-KEY: Your API public keyX-SIGNATURE: Ed25519 signature overEKIDEN_API|{method}|{uri}|{timestamp_ms}|{nonce}X-TIMESTAMP-MS: Current Unix timestamp in millisecondsX-NONCE: Random unique string
6. Numerical Precision
- Prices and quantities are represented as strings to preserve precision.
- Clients should use arbitrary-precision decimal libraries instead of floating-point numbers.
- Price and quantity precision vary by instrument. Use the
price_filter.tick_sizeandlot_size_filter.qty_stepvalues returned in the response fromGET /api/v1/market/instruments-infoto determine the supported precision for each market.
7. Timestamps
Ekiden uses Unix timestamps in milliseconds unless otherwise specified. Common timestamp fields include:timestamptimestamp_msserver_ts_mscreated_timeupdated_timetsmtsclient_tsserver_ts
start_time and end_time). Refer to the endpoint documentation for the supported parameters.
8. Error Handling
Error response format
Common Error Codes
HTTP status codes (400,401,403,404,429,500,503) are used appropriately.
9. Rate Limits
REST API requests are subject to rate limits. When a rate limit is exceeded, the server returns HTTP429 Too Many Requests.
Example:
10. Pagination
Cursor-based pagination is used for endpoints that return lists of resources. Common query parameters:limit— Maximum number of items to return.cursor— Pagination cursor returned by the previous request.
next_page_cursor value as the cursor parameter in the next request.
11. Field Naming
- All JSON keys use
snake_case. - High-precision numeric values are represented as strings.
- Integer values are represented as JSON numbers.
12. WebSocket Heartbeats
Application-level ping/pong
Clients may send:WebSocket-level ping/pong (keepalive)
The server periodically sends WebSocket-level ping frames and expects pong responses. If a pong is not received within the configured timeout, the server may close the connection. Clients should automatically respond to WebSocket-level ping frames and may also send application-levelping messages if desired.
For detailed endpoint specifications and integration examples, refer to the API Reference.