1. Terminology & Core Architecture
- Builder ID (
broker_id): The identifier assigned to your platform/Broker during onboarding. Must be passed in registration and key generation APIs. - Orderly Key: An on-chain registered Ed25519 keypair. The private key resides locally and is used to sign all subsequent private API/WS requests, bypassing wallet signatures.
- Strategy Vault vs. OmniVault:
- Strategy Vault: The underlying technical smart contract and CeFi clearing infrastructure.
- OmniVault: The official protocol-level vault implementation built on top of this Strategy Vault infrastructure.
2. API Authentication Flow
Orderly uses two main layers of authentication:- EIP-712/Ethereum Signature: Used only for registration and registering your Orderly Key.
- Orderly Key (Ed25519 Signature): Used to sign all private REST and WebSocket messages.
Request Headers for Authenticated Endpoints
Every private request must contain the following HTTP headers:Signature Generation Rule
The signature string is generated by concatenating the timestamp, the HTTP method, the path (including query parameters if they exist), and the request body:[!IMPORTANT]
- The path must contain query parameters if they exist (e.g.,
/v1/order?symbol=PERP_ETH_USDC).- The generated signature must be encoded in base64url (URL-safe Base64) format.
3. Cryptographic Signature Implementations
Here are minimal implementations for signing Orderly API requests using an Ed25519 private key.TypeScript / Node.js
Python
4. Core REST API Endpoints Reference
All private endpoints require private headers signed by your Orderly Key.| Endpoint | Method | Auth Level | Key Input Parameters | Purpose |
|---|---|---|---|---|
/v1/register_account | POST | Public (Wallet Sign) | broker_id, chain_id, user_address | Registers user address to Orderly account ledger. |
/v1/orderly_key | POST | Public (Wallet Sign) | broker_id, orderly_key, key_expiration | Authorizes an Ed25519 public key on-chain for the account. |
/v1/order | POST | Private (Orderly Key) | symbol, side, order_type, order_price, order_quantity | Creates limit/market order on the orderbook. |
/v1/order | DELETE | Private (Orderly Key) | order_id (Query), symbol | Cancels a specific order. |
/v1/order/cancel_all_after | POST | Private (Orderly Key) | trigger_in (ms) | Dead man’s switch. Auto-cancels orders after timeout. |
/v1/positions | GET | Private (Orderly Key) | - | Retrieves unrealized P&L and sizes of active positions. |
/v1/client/holding | GET | Private (Orderly Key) | - | Retrieves collateral token balances (USDC, etc.). |
5. WebSocket Authentication & Heartbeat
Connection Endpoints
- Testnet:
wss://testnet-ws-private.orderly.org/v2/ws/private/<account_id> - Mainnet:
wss://ws-private.orderly.org/v2/ws/private/<account_id>
Private Authentication Message
Send an authentication frame immediately after connection opens:${timestamp}auth.