Conventions
The JSON-RPC envelope, string-encoded numbers, ids, timestamps, sequence numbers and enums used across the ATLAS API.
On this page
Every ATLAS message is a JSON-RPC 2.0 object. Every price, size, amount and most ids are strings. Parse them with a decimal or bigint library, never as a float.
- Envelope
- JSON-RPC 2.0.
idis a string or integer, nevernull - Params
- Named object, except signed writes (
["0x…"]) - Decimals
- Plain decimal strings. No exponent, no
NaN - Timestamps
- Unix milliseconds as JSON integers
- Account ids
- 20-byte addresses,
0x+ 40 hex - Markets
- A numeric
marketIdin reads and streams; a tagged{"PERP":{"id":1}}in signed commands - Stream order
seqper subscription, starts at"1"
Envelope
Every request names a method, carries params and an id, and gets back exactly one response with the same id. The same envelope is used on HTTP and on WebSocket. Pick Rate limited under the response to see the error shape.
atlas.getTickerHTTP POSTcurl -s https://<api-host>/market/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getTicker","params":{"marketId":4294967297}}'Press Send to see the response.Request
jsonrpcmust be"2.0".idis required. It is a string or a whole number. It may not benullor fractional.- Do not reuse an
idwhile a request with thatidis still in flight on the same connection. The trading WebSocket refuses a reused one with-10017. - Responses can arrive out of order. Match them by
id. - On one
/seq/wsconnection, signed writes enter the venue in the order you sent them. Their responses may still come back in any order. Separate HTTP requests toPOST /seq/txhave no order between them: wait for one answer before sending a write that depends on it.
Params
Every read and subscription method takes a named params object: leave out the optional fields you don't need. A method with no inputs, such as atlas.getTime or auth.challenge, takes no params at all, or {}. The signed writes take a positional array: atlas.sendRawTransaction and atlas.sendRawMessage take "params": ["0x…"], one signed envelope or message as 0x-hex, and atlas.sendWalletReadyRequest takes "params": [kind, rawTx, statements]. See Sign a transaction.
{ "jsonrpc": "2.0", "id": 8, "method": "atlas.getCandles", "params": { "marketId": 4294967297, "interval": "1h", "from": 1791122400000, "to": 1791208800000 } }
{ "jsonrpc": "2.0", "id": 9, "method": "atlas.subscribe", "params": { "stream": "trades", "marketId": 4294967297 } }
{ "jsonrpc": "2.0", "id": 10, "method": "atlas.sendRawTransaction", "params": [ "0x0011000080ebf39fd6e51aad88f6f4ce6ab8827279cfffb92266…" ] }Success and error
A response carries exactly one of result or error.
result | errorjsonrpcstringrequired"2.0".idstring | integerrequired- The
idof your request. resultanyrequired- The method's result. Its shape is on each method's page. Can be
null, for exampleatlas.getOrderfor an unknown order.
{ "jsonrpc": "2.0", "id": 2, "result": { "success": true } }Notifications
Server push is a JSON-RPC notification: it has method and params and no id, so you never answer it. Push methods use the stream. prefix, and params is always an object.
On a WebSocket, responses and notifications share one connection. Responses can come back in a different order from your requests, and notifications can arrive between them. Play the session and click a line to expand it.
- + 0ms●connection open
- +2030ms//id 8 answered before id 7. Match responses by id, not by order.
How to tell them apart: a message with an id is a response to you; a message with method and no id is a notification.
Stream semantics are on Streams.
Numbers
All of these are JSON strings in plain decimal notation. Scientific notation such as 1e-8 is not allowed.
| Type | Pattern | Example | Used for |
|---|---|---|---|
DecimalString | ^-?[0-9]+(\.[0-9]+)?$ | "-12.5" | Signed values |
PositiveDecimalString | ^[0-9]+(\.[0-9]+)?$ | "100.25" | Non-negative values |
Price | alias of PositiveDecimalString | "70300" | Prices |
Size | alias of PositiveDecimalString | "0.25" | Quantities |
Amount | alias of DecimalString | "-3.2" | Balances, PnL, fees, funding |
SignedSize | alias of DecimalString | "-0.4" | Position size: positive long, negative short |
IntegerString | signed integer string | "-1250000" | Raw scaled integers |
Uint64String | ^[0-9]+$ | "18446744073709551615" | Nonces, nonce expiries, revisions, positions in a log, parent order ids |
Uint256String | ^[0-9]+$ | "1" | The wallet's EIP-712 domain chainId you send with a sign-in or handshake |
Values that are JSON numbers
A few fields are plain JSON numbers. They are small enough to be safe, but don't assume every number is a string.
| Type | Where | Example |
|---|---|---|
TimestampMs | Every Unix-millisecond timestamp: timestamp, createdAt, updatedAt, settlementTsMs, expiresAt, candle bounds and so on | 1791210612345 |
Uint64Number | Order and fill seq | 48213 |
| ATLAS chain id | signing.chainId from atlas.getVersion, and the first signed field of every transaction | 33003 |
| Integer basis points | imrBps, mmrBps, passiveCollarBps and similar market parameters | 500 |
marketId | Every market id in results, reads and streams: the market's kind above its 32-bit id (spot id, perp 2^32 + id) | 4294967297 |
assetId | Every asset id. 0 is a listed asset (ZRO), not a placeholder | 0 |
Identifiers
| Type | Format | Notes |
|---|---|---|
Symbol | ^[A-Z0-9]+(/[A-Z0-9]+|-[A-Z0-9]+(-(PERP|SPOT))?)$ | A display label, for example ZRO/USDT. Not a unique market id: more than one market can share a symbol. Identify markets by marketId |
AccountAddress | ^0x[0-9a-fA-F]{40}$ | The account's 20-byte address. Responses carry lowercase hex. A wallet's first account (Main) has the address of the key that opened it; every sub-account has its own. Never a number or a decimal string |
OrderId | opaque string | "{kind}:{id}:{seq}", for example "perp:1:48213", in write results, reads and streams alike. Treat it as opaque and use the sibling marketId and seq fields. A cancel or replace names the order by the bare seq with the tagged market |
ClientOrderId | ^0x[0-9a-f]{32}$ | Your own bytes16 order id (clientOrderId in signed actions, clOrdId in results and reads, named after FIX ClOrdID), lowercase hex. Required on placement. Uppercase is refused with -32602 |
BuilderId | ^0x[0-9a-f]{40}$ | A builder's 20-byte id from enableBuilder. Signed as an EIP-712 address, but it is not the builder's account address |
MarketId | integer in reads; {"SPOT":{"id"}} or {"PERP":{"id"}} in signed commands | From atlas.getSymbols. Reads, results and streams use the number, the kind above the 32-bit id. Signed commands name the kind and the id separately, {"PERP":{"id":1}} for 4294967297: spot and perp markets are numbered apart |
TxId | ^0x[0-9a-f]{64}$ | Identity of a signed transaction: the digest its signature covers, not a hash of the signature. Returned as txId and looked up with atlas.getTransactionReceipt and atlas.getTransactionByHash |
TradeId | opaque string | Unique per trade |
SubscriptionId | opaque string | Valid only on the connection that created it |
Signature65 | array of 65 integers (0 to 255) in the /seq/ws handshake; 0x-hex string in auth.signIn and auth.login | r(32) ‖ s(32) ‖ v(1), v in {0, 1} |
Enums
| Name | Values |
|---|---|
Side | buy, sell |
OrderType | limit, market |
TimeInForce | gtc, ioc, fok. Post-only is the postOnly flag, not a time in force |
OrderStatus | accepted, open, partially_filled, filled, cancelled, rejected, expired |
Interval | 1m, 5m, 15m, 1h, 4h, 1d |
Liquidity | maker, taker |
PositionSide | long, short |
Key scope | INSTRUCTION_KEY_SCOPE_FULL, INSTRUCTION_KEY_SCOPE_REDUCE_ONLY (uppercase) |
Key nonceMode | GAPLESS, INCREASING (uppercase) |
walletState | pending, active, exit_only |
stpLevel | account, wallet |
Market status (atlas.getSymbols) | ACTIVE, INACTIVE (uppercase) |
Market mode | NORMAL, REDUCE_ONLY, CLOSE_ONLY on atlas.getSymbols; normal, reduce_only, close_only on tickers |
Enum values are case-sensitive.
Sequence numbers
Every stream notification carries seq, a decimal string.
- It is per subscription. There is no connection-wide sequence.
- The first event of a subscription is
"1". A new subscription starts again at"1". - Compare
seqas an unsigned integer, not as a string ("10"sorts before"9"as text). - A gap, a repeat or a step backwards means your local state is unreliable. Resubscribe. See Streams: recovery.
stream.ordersandstream.accountalso number their reports per account and stream, a separate counter you resume from withafterReportNo. See Streams.
Versioning
- The public API is versioned as v1. Methods live in the
atlas.namespace, apart from theauth.methods (auth.challenge,auth.signIn,auth.login,auth.refresh,auth.logout,auth.createHandoffandauth.redeemHandoff), and only methods in the published catalog are public. - The signed envelope and its signing domains are on Authentication.
atlas.getVersionreturns the ATLAS chain id and the transaction signing domain, on/seq/rpc,/account/rpcand/market/rpc. Use it to read the chain id to sign with.
Stability
Stable in v1: method names, params and result fields as documented, the signing bytes (envelopes, type strings, selectors, domains and salts), and error codes.
May change: limits, weights, cadences and retention, and the set of optional fields and enum values.
Build your client to:
- Ignore fields and enum values it doesn't recognise.
- Branch on
code, never onmessage. Treat an unknown error code orstream.closedreason code as non-fatal. - Treat ids and cursors as opaque.
- Wait
retryAfterMswhen an error carries it.
Not supported
These are out of scope for v1. Do not build on them.
- Resuming market-data streams, or gap-fill on them. Only
stream.ordersandstream.accountresume, from a report number - Moving a subscription to another connection
- Batch subscribe or unsubscribe
- JSON-RPC batch requests
- Binary payloads