1. Base URLs and Environments
Ekiden provides separate base URLs for each environment:- Mainnet:
(Coming Soon) - Testnet Beta: https://api.ekiden.fi/api/v1
- Testnet Staging: https://api.staging.ekiden.fi/api/v1
All API calls must use HTTPS.
2. Versioning
We use URI-based versioning:- Format:
/v1/ - Example:
GET /v1/orders
/v2/).
3. RESTful Design
| Method | Description |
|---|---|
GET | Fetch resources (e.g., market data) |
POST | Create resources (e.g., place an order) |
DELETE | Cancel or remove resources |
PATCH | Update partial resources |
- Resources are nouns, pluralized when appropriate
- Example:
/v1/orders,/v1/fills
- Example:
4. WebSocket Protocol
Endpoints:- Mainnet:
(Coming Soon) - Testnet Beta:
- Public data:
wss://api.ekiden.fi/ws/public - Private data:
wss://api.ekiden.fi/ws/private
- Public data:
- Testnet Staging:
- Public data:
wss://api.staging.ekiden.fi/ws/public - Private data:
wss://api.staging.ekiden.fi/ws/private
- Public data:
op field with snake_case values. Optional req_id lets you correlate requests/responses.
Topics
- Public:
orderbook/{market_addr}trade/{market_addr}ticker/{market_addr}
- Private (only over
/ws/privateafter auth):orderpositionfill
Subscribe
Client → ServerUnsubscribe
Event delivery
Authenticate (private WS only)
Send your JWT (see REST auth below) over/ws/private:
Client → Server
5. Authentication (REST)
Private REST and private WebSocket use a short-lived JWT issued by the gateway.- Request a token via
POST /api/v1/authorizeby signing the message:
- Use the token with Bearer auth for private endpoints:
6. Numerical Precision
- All token quantities and prices are strings
- Up to 18 decimal places
- Use big number or decimal libraries — avoid floats
7. Timestamps
We use explicit units depending on the field name and context:timestamp(REST resources like orders, fills, positions): Unix seconds since epoch (int). Example:1718000000.timestamp_ms(REST authorize flow): Unix milliseconds since epoch (int). Example:1718000000000.ts(WebSocket ticker snapshots and ping/pong client_ts/server_ts):- For ticker
ts: Unix milliseconds since epoch (int). Example:1718000000000. - For WS ping/pong
ts/client_ts/server_ts: Unix nanoseconds since epoch (int). Example:1718000000000000000.
- For ticker
"2025-05-10T12:34:56Z".
8. Error Handling
Error response format
Error codes
| Code | Meaning |
|---|---|
| 2000 | Invalid request |
| 2001 | Authentication failed |
| 2002 | Signature expired |
| 2003 | Rate limit exceeded |
| 2004 | Resource not found |
HTTP status codes (400,401,429, etc.) are used appropriately.
9. Rate Limits
- Public REST endpoints: 60 requests/minute
- Private REST endpoints: 30 requests/minute per token
Example response on limit exceeded
10. Pagination
Offset-style pagination with page counters:- Query params:
page(default 1),per_page(default 20)
11. Response Structure
All responses are JSON objects.Success
Error
12. Field Naming
- All JSON keys use
snake_case - All numeric values are strings
- Timestamps are always strings in ISO 8601
13. WebSocket Heartbeats
There are two heartbeat layers:- Application-level ping/pong (for latency measurement)
- Client may send:
- Server replies:
- WebSocket-level ping/pong (keepalive)
- The server periodically sends WebSocket-level pings and expects pongs.
- If the server does not see a pong within the timeout window (~30s by default), it will close the connection.
ping messages if desired.
For detailed endpoint specifications and integration examples, continue to the API reference.