General
Conventions
This document outlines Ekiden’s API design conventions and standards. These ensure consistency, developer-friendliness, and compatibility across all REST and WebSocket interfaces.
1. Base URLs and Environments
Ekiden provides separate base URLs for each environment:
- Mainnet:
https://api.ekiden.fi
- Testnet:
https://testnet-api.ekiden.fi
All API calls must use HTTPS.
2. Versioning
We use URI-based versioning:
- Format:
/v1/
- Example:
GET /v1/orders
Backward-incompatible changes will trigger a new version (e.g., /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/markets
- Example:
4. WebSocket Protocol
Endpoint:
Subscribe to a public channel
Subscribe to private (authenticated) channels
5. Authentication (REST)
Private endpoints require:
EKIDEN-API-KEY
EKIDEN-TIMESTAMP
(ISO 8601 UTC)EKIDEN-SIGNATURE
(HMAC SHA256 oftimestamp + method + path + body
)
Example headers
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
- Format: ISO 8601 with
Z
(UTC)
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 endpoints: 60 requests/minute
- Private endpoints: 30 requests/minute per API key
Example response on limit exceeded
10. Pagination
Cursor-based pagination:
- Query params:
limit
,cursor
Response
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
To keep the connection alive:
Client sends
Server responds
Idle connections close after 60 seconds without activity.
For detailed endpoint specifications and integration examples, continue to the API reference.