Trading
Place, replace and cancel orders with atlas.sendRawTransaction, move margin and funds, manage TP/SL and TWAP orders, read every outcome and error, and query orders, fills, advanced orders and funding history.
On this page
- How a write works
- Result or error
- Market and order identity
- The transaction
- Send a transaction
- atlas.sendRawTransaction
- Enable trading and builder
- atlas.sendWalletReadyRequest
- atlas.sendRawMessage
- Not in v1
- Order reads
- The Order object
- atlas.getOrder
- atlas.getOrderByClOrdId
- atlas.getOpenOrders
- atlas.getOrderHistory
- atlas.getFills
- atlas.getFundingHistory
- Advanced order reads
- atlas.getOmsDelegateKey
- atlas.getOmsNonce
- Read authorization
- atlas.getAdvancedOrders
- atlas.getAdvancedOrder
Every write is one signed transaction: you build the command, sign it, encode the signed envelope and send it with atlas.sendRawTransaction, over POST /seq/tx or the trading WebSocket /seq/ws. Each request carries exactly one command: place, replace or cancel orders, set the dead-man switch, move isolated margin, transfer, stake or withdraw funds, manage keys, or manage TP/SL and TWAP orders. An applied command answers with a typed result; anything refused answers with a JSON-RPC error whose code says why. Reads of orders, fills, advanced orders and funding are plain HTTP calls.
- Writes
atlas.sendRawTransactiononPOST /seq/txor WebSocket/seq/ws. Both take every public command and answer the same result- Write params
- Positional:
params: [rawTx], the signed envelope as0x+ lowercase hex - Order commands
placeOrder(limit or market),cancelOrder,replaceOrder,cancelAllOrders,cancelAllOrdersAfter- Markets
- Signed commands name a tagged market,
{"PERP":{"id":1}}. Reads and streams use the numericmarketIdfromatlas.getSymbols - Outcome
- Applied: a typed result with its
txId. Refused: a JSON-RPC error with a numeric code and, for orders,data.clOrdId - Reads
- Orders, fills and funding on
POST /account/rpc, named params, no auth. Advanced orders onPOST /oms/v1/queries, with anOMS-Readheader - Time in force
gtc,iocorfok, required on every order- Before the first order
- The wallet is ready (
enableTrading) and the signing key is bound to the account
How a write works
Every write gets exactly one answer, matched by the JSON-RPC id.
- Make sure the wallet is ready and the key you sign with is bound to the account. A deposit only funds the address; one owner signature opens the wallet, binds an app's key and accepts the terms (see
enableTrading). Until then every order is refused with30(Wallet pending). A key that isn't bound to the account is refused with-10003(Sender mismatch), and the owner key, unbound, with28(Signer key not permitted). - Build the command as JSON (each command below shows its JSON), wrap it in
Transaction {chainId, authority, signer, nonce, command}, sign it and encode the signed envelope. How to sign and which nonce to use are on Authentication: sign a transaction. - Send the envelope as the only positional param,
"params": ["0x…"], toPOST /seq/tx, or on a/seq/wsconnection after its handshake. - You get one answer: the command's result if it was applied, or a JSON-RPC error if it was refused or its outcome is unknown.
- Fills that come later arrive on
stream.orders, which you subscribe to on a separate/account/wsconnection. Nothing else is pushed on/seq/ws.
Result or error
An applied command answers with its typed result (with an orderId on a placement). A refusal is a JSON-RPC error with a definite code: nothing changed and the nonce is not consumed, so fix the cause and sign the corrected request with the same nonce. -10010, -10011, -32603 or no reply means the outcome is unknown: look the txId up before you sign anything new. See Errors: results, refusals and unknown outcomes and below.
Once the command decodes, an order request's error echoes its own clientOrderId as error.data.clOrdId, on placeOrder, cancelOrder and replaceOrder. A retryable refusal carries error.data.retryAfterMs. Every code is on Errors.
The same writes work on /seq/ws, which saves a connection per request.
- + 0ms●connection open
- +1300ms//No reply means the handshake was accepted. The connection now takes signed writes.
- +3500ms//0.4 filled on arrival, 0.6 rests as perp:1:48213. Later fills arrive on stream.orders over /account/ws, not here.
- +6000ms//Cancelled. The 0.4 already filled stays filled.
Market and order identity
Markets have two forms. A signed command names its market tagged by kind, {"PERP":{"id":1}} or {"SPOT":{"id":1}}: spot and perp markets are numbered apart. Results, reads and stream subscriptions use one number, the marketId that atlas.getSymbols returns, with the kind above the 32-bit id: spot id, perp 2^32 + id. Perp 1 is 4294967297. Take both from market discovery rather than computing them, and don't use a symbol to identify a market: a symbol is a display label and can name more than one market.
Four ids show up around an order. Keep them straight. The write payloads call a client id clientOrderId; results, errors and reads call it clOrdId.
| Id | Who sets it | Format | What it is |
|---|---|---|---|
Placement id A (clientOrderId on placeOrder) | You | 0x + 32 lowercase hex (bytes16). Required | Names the live order. Must differ from every live order of the account (33, Client order id already set); free again once its order ends. Results and reads return it as clOrdId. Target an order by it with target.clientOrderId, and read it with atlas.getOrderByClOrdId |
Request id C (clientOrderId on cancelOrder, cancelAllOrders and replaceOrder) | You | Same. Required | Names the request itself. Never checked against live orders. Results return it as requestClOrdId. A replaceOrder's C becomes the replacement's clOrdId |
Venue id (orderId) | ATLAS | "{kind}:{id}:{seq}" in results, reads and streams, for example "perp:1:48213". In a write's target.orderId, the bare seq as a string, "48213", with the tagged market in marketId | Returned on acceptance, with seq. Never on a refusal |
Transaction id (txId) | Derived | 0x + 64 lowercase hex | The digest the transaction's signature covers: the submission's identity, returned as txId and stamped on the orders and fills it produced. Look it up with atlas.getTransactionReceipt. Not the nonce, and not a hash of the signature |
Ids must be lowercase. Uppercase hex is refused with -32602.
The transaction
A transaction is Transaction {chainId, authority, signer, nonce, command}, signed as one. You build it, sign it and encode it yourself. The server only decodes, verifies and executes: there is no JSON form of a write on the wire.
{
"chainId": 33003,
"authority": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"signer": "0x3c9e1a7b5d2f4e6a8c0b1d3f5a7c9e2b4d6f8a10",
"nonce": { "time_stamp_nonce": "469555114762567936" },
"command": {
"placeOrder": { "account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15", … }
}
}chainId is the ATLAS chain id, 33003, from atlas.getVersion signing.chainId (246 otherwise). authority is the account whose authority the command exercises: the account the command names, or, for an owner-key command, that wallet's Main (329 otherwise). signer is the signing key's address, nonce its slot's nonce, and command one command tagged by its kind, naming its account inside its own fields. What each field must hold is on Authentication: sign a transaction and Nonce.
Signing is Opaque (0x01) or Typed EIP-712 (0x11), as each command allows: see Signing domains and the Typed type strings below. The byte layout of rawTx is on Authentication: the envelope, and every command's selector and encoding on Action encoding.
Send a transaction
atlas.sendRawTransaction
atlas.sendRawTransactionHTTP or WebSocket/seq/tx · /seq/ws authSubmits one signed transaction and answers with its result or its refusal. Weight 1. One command per request: there is no batch.
rawTxstringrequired0x+ lowercase hex of the signed envelope, sent asparams: [rawTx]. ArawTxthat isn't hex is-32602; an envelope that doesn't decode is1(Envelope malformed); an unknown command selector is218(Selector not found); a command that isn't public is-10013(Unsupported command).
{
"jsonrpc": "2.0",
"id": 41,
"method": "atlas.sendRawTransaction",
"params": ["0x0011000080eb8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f153c9e1a7b5d…"]
}| Path | What it serves |
|---|---|
POST /seq/tx | atlas.sendRawTransaction, atlas.sendWalletReadyRequest and atlas.sendRawMessage for every public command |
wss://<ws-host>/seq/ws | The same methods with the same results, after the handshake. Optional |
POST /seq/rpc | atlas.getVersion and atlas.getTime only |
Supported commands
| Command | What it does | Signed by | Signing |
|---|---|---|---|
placeOrder | Place a limit or market order | A key bound to the account | Opaque or Typed |
cancelOrder | Cancel one order | A key bound to the account | Opaque or Typed |
replaceOrder | Replace a resting order, losing priority | A key bound to the account | Opaque or Typed |
cancelAllOrders | Cancel every order of the account in one market | A key bound to the account | Opaque or Typed |
cancelAllOrdersAfter | Arm, refresh or disarm the dead-man switch | A key bound to the account, any scope | Opaque or Typed |
moveIsolatedMargin | Add or remove isolated collateral | A Full key bound to the account | Opaque or Typed |
internalTransfer | Move funds between accounts of one wallet | A Full key bound to the account | Opaque or Typed |
stake, unstake | Stake an asset, or start unstaking it | A Full key bound to the account | Opaque or Typed |
transfer | Move funds to any account | Owner key | Typed |
withdraw | Withdraw to another Zero zone | Owner key | Typed |
setStpLevel | Set the wallet's self-trade prevention level | Owner key | Typed |
createSubAccount | Open a sub-account | Owner key | Typed |
setInstructionKey, rotateOwnerKey | Bind or remove a key, replace the owner key | Owner key | Typed |
createSignerPolicy | Create a multi-sig signer policy | Owner key | Typed |
createTpSlOrder, updateTpSlOrder, cancelTpSlOrder | TP/SL orders | Owner key or an advance instruction key | Typed |
createTwapOrder, cancelTwapOrder, cancelAllTwaps | TWAP orders | Owner key or an advance instruction key | Typed |
setAdvanceInstructionKey | Let a key manage the account's TP/SL and TWAP orders | Owner key | Typed |
enableTrading and enableBuilder aren't transactions: see atlas.sendWalletReadyRequest and atlas.sendRawMessage.
Who may sign. A trading command needs a key bound to the account. The owner key is no exception: it signs orders only once it is bound to the account itself, otherwise 28 (24 on a sub-account). INSTRUCTION_KEY_SCOPE_FULL signs every trading command; INSTRUCTION_KEY_SCOPE_REDUCE_ONLY signs cancels, reduce-only orders and a dead-man switch that arms or shortens. A command outside the key's scope is 28. See Authentication: who signs what.
placeOrder
placeOrder places one limit or market order, chosen by orderType. Every flag is required: there are no defaults.
accountAccountAddressrequired- The account the order is for, Main or a sub-account.
0x+ 40 hex. marketIdMarketIdrequired- The tagged market,
{"PERP":{"id":1}}or{"SPOT":{"id":1}}. See Market and order identity. clientOrderIdClientOrderIdrequired- Placement id A.
0x+ 32 lowercase hex. A live order of the account already using it is33. See Market and order identity. sideenumrequiredbuyorsell.quantitydecimal stringrequired- Quantity in base units, a multiple of the market's
lotSizewithin its size and notional limits (42,43). Signed at 8 decimal places. orderTypeenumrequiredlimitormarket.pricedecimal string- Required on
limit, and a market order must leave it out,nullincluded (-32602). Your price or better, a multiple oftickSize(40) and inside the collar (55). Signed at 10 decimal places. See Limit orders. postOnlyboolean- Required on
limit, and a market order must leave it out. Rest only: the whole order is refused (59) if any of it would take on arrival, including against your own quote. It is never repriced. RequirestimeInForce: "gtc"(38). timeInForceenumrequiredgtc(rest the remainder until cancelled),ioc(expire the remainder) orfok(fill the whole quantity at once or none of it). See Time in force.marginModeenumrequiredcrossorisolated.isolatedtrades in the market's isolated position and opens one if there is none, moving its initial margin and fee from cross cash. A mode the market doesn't allow, isolated on spot included, is49; one that differs from the live position is50.openingMargindecimal string- Optional,
isolatedonly: the initial margin, in the settlement asset, that an order opening a new isolated position commits to it, instead of the market's rate. It moves from cross cash into the new position, with the open fee and reserves. Zero, negative or below the market's rate is303; on acrossor reduce-only order, or into an isolated position that already exists,302. Signed at 12 decimal places. reduceOnlybooleanrequired- Only reduce an existing perp position. Refused on spot (
47), without a position to reduce on this side (288), and withfok(38). The working size is capped at what can close when the order is placed; the result still echoes the signed size, so read the remaining size from order reports. An order withoutreduceOnlynever trims your resting orders, so a resting reduce-only order can still fill after your position shrinks and flip you. See Reduce-only. builderFeeBuilderFeeOptional. The Builder Fee the order charges; omit it to charge none.
›Show 2 child fieldsHide child fields
appBuilderIdBuilderIdrequired- The App Builder ID the fee is attributed to,
0x+ 40 lowercase hex. builderFeeBpsdecimal stringrequired- The rate in bps, fixed at admission and signed at 8 decimal places. Above the signing key's Builder Fee cap for the market's class (perps up to 10, spot up to 100) is
45. The cap is the binding's: an owner key bound as an instruction key has the cap its own binding sets. A negative rate or a zero id is46.
{
"placeOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clientOrderId": "0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b",
"side": "buy",
"quantity": "1",
"orderType": "limit",
"price": "70300",
"postOnly": false,
"timeInForce": "gtc",
"marginMode": "cross",
"reduceOnly": false
}
}{
"placeOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clientOrderId": "0x7a3c5e9b1d4f6a8c0e2b4d6f8a1c3e5b",
"side": "buy",
"quantity": "0.5",
"orderType": "limit",
"price": "70100",
"postOnly": true,
"timeInForce": "gtc",
"marginMode": "isolated",
"openingMargin": "2000",
"reduceOnly": false,
"builderFee": {
"appBuilderId": "0x1d4e7a2c9b5f3e8a6c0d2b4f7e9a1c3b5d8f0a26",
"builderFeeBps": "2"
}
}
}A market order has no price and no postOnly. ATLAS bounds it at the market's protective cap: gtc rests what doesn't fill at that bound price, ioc expires it, and fok fills the whole quantity inside the bound or is killed whole. If no price is available to bound it, the order is refused.
{
"placeOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clientOrderId": "0x8e2d4f6a1c3b5d7e9f0a2c4e6b8d1f3a",
"side": "sell",
"quantity": "0.5",
"orderType": "market",
"timeInForce": "ioc",
"marginMode": "cross",
"reduceOnly": false
}
}A FOK order fills in full or is cancelled whole, with no fill and no fee; your own self-trade group's orders don't count toward it. See FOK.
There is no per-order self-trade prevention field: the wallet's setStpLevel applies to every order. See Self-trade prevention.
An order that reduces a perp position can't be priced past the position's bankruptcy price: a limit past it is 176, and a market order is bound to it. See Closing orders and the bankruptcy price.
A reduce-only order can trim your other resting orders on the same side; read trimmedSize on the Order. See Your older orders make room.
cancelOrder
Cancels one live order of account on marketId. Name the order by exactly one of its venue id or its placement id A. A refusal leaves the order unchanged.
accountAccountAddressrequired- The account that owns the order.
clientOrderIdClientOrderIdrequired- This cancel request's own id C. It is never checked against live orders and never becomes an order's id.
marketIdMarketIdrequired- The tagged market the order rests on.
targetOrderTargetrequiredThe order, by exactly one of:
›Show 2 child fieldsHide child fields
orderIdstring- The venue id's
seqalone, as a decimal string:"48213"for"perp:1:48213". clientOrderIdClientOrderId- The order's placement id A.
{
"cancelOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clientOrderId": "0x9a1c3e5b7d0f2a4c6e8b0d2f4a6c8e1b",
"marketId": { "PERP": { "id": 1 } },
"target": { "clientOrderId": "0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b" }
}
}{
"cancelOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clientOrderId": "0x9a1c3e5b7d0f2a4c6e8b0d2f4a6c8e1c",
"marketId": { "PERP": { "id": 1 } },
"target": { "orderId": "48213" }
}
}The result is cancelApplied. No live order of the account on marketId matching target is 44 (Order not found).
replaceOrder
Swaps a resting order for a new limit order in one step. The old order is removed only after the replacement is admitted. If the replacement is refused, the old order stays on the book in its queue place and no order is created.
The replacement keeps the target's side, margin mode and Builder Fee, and is always gtc. It is a new order with its own orderId: it goes to the back of the queue at its price, even if the price is unchanged and the quantity smaller. It opens no isolated position, so it takes no opening margin. Its Builder Fee is checked against the signing key's cap like a placement's. If the target carries TP/SL protection, a replacement with a fresh clientOrderId keeps it: later fills of the replacement arm the same parent.
accountAccountAddressrequired- The account that owns the order.
marketIdMarketIdrequired- The order's tagged market.
targetOrderTargetrequired- The resting order:
orderId(the bareseq) orclientOrderId, as oncancelOrder. clientOrderIdClientOrderIdrequired- This request's id C, which becomes the replacement's
clOrdId. It may be the target's. quantitydecimal stringrequired- The replacement's whole quantity, not counting what the target already filled.
pricedecimal stringrequired- The replacement's limit price.
postOnlybooleanrequired- The replacement's post-only flag.
reduceOnlybooleanrequired- The replacement's reduce-only flag.
{
"replaceOrder": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"target": { "orderId": "48213" },
"clientOrderId": "0x1b3d5f7a9c0e2b4d6f8a1c3e5b7d9f0a",
"quantity": "0.6",
"price": "70250",
"postOnly": false,
"reduceOnly": false
}
}The result is replaceOrderApplied: txId, accountAddress, requestClOrdId (your C), the target as you named it (origOrderId, or origClOrdId), and the new order's marketId, orderId, seq, filledSize, avgFillPrice, leavesQty, immediateOutcome and iocRemainder, read as on placeOrderAccepted. An unknown target is 44; the replacement can also fail any check placeOrder does.
There is no amend that keeps queue priority. To reduce an order, replace it; to close a position, send a reduce-only order.
cancelAllOrders
Cancels every working order of one account in one market, whichever key placed it. Sub-accounts are not included. A market with nothing to cancel still succeeds. To cancel in every market, send one per market. See Mass cancel.
{
"cancelAllOrders": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clientOrderId": "0x4d2b6f8a0c1e3a5c7e9b1d3f5a7c9e2b",
"marketId": { "PERP": { "id": 1 } }
}
}The result is cancelAllOrdersApplied with txId, accountAddress and cancelledCount. A market that isn't listed is 34 (Market not found).
cancelAllOrdersAfter
Sets the account's dead-man switch: one clock per account, covering every working order on it. timeoutSeconds is 0 (off) or 5 to 86,400; anything else is 93. Any key bound to the account may sign it. A Reduce Only key may arm the switch or shorten it, but turning it off or lengthening it needs a Full key (28).
{
"cancelAllOrdersAfter": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"timeoutSeconds": 60
}
}The result is cancelAllOrdersAfterApplied: txId, accountAddress, receivedAtNs and deadlineNs (absent when you turned it off), in Unix nanoseconds as decimal strings.
moveIsolatedMargin
Moves settlement cash between the account's cross balance and its isolated position on one market. Leverage is not set per market: an isolated position's leverage follows from its margin, so open it with openingMargin and adjust it here.
accountAccountAddressrequired- The account.
marketIdMarketIdrequired- The tagged perp market of the isolated position.
directionenumrequiredadd(cross into the isolated position) orremove(back to cross).amountdecimal stringrequired- Above 0, at most 12 decimal places. A
removecan take at most what the position can release while it keeps its initial margin; how much that is is on Margin modes.
{
"moveIsolatedMargin": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"direction": "add",
"amount": "500"
}
}It needs a Full key; a Reduce Only key is 28. The answer is { "status": "ok" } once the move applies, or its refusal, and nothing moves, when: the account holds no isolated position on the market (48), the wallet is pending (30), a liquidation is active (54), an add exceeds what cross can release (132), or a remove exceeds what the position can release (180).
setStpLevel
Sets which of a taker's own orders self-trade prevention cancels, for every account of the wallet. Only the wallet's owner key may sign it, Typed only.
accountAccountAddressrequired- The wallet's Main account. A sub-account is
27. levelenumrequiredaccount: cancel a crossing maker of the same account only, so Main and its sub-accounts can trade with each other.wallet: cancel a crossing maker of any account in the wallet.
{ "setStpLevel": { "account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15", "level": "wallet" } }A wallet starts at account, and an account created later takes the wallet's current level. The level applies to every order of the wallet, resting orders included, from the next match; setting it cancels nothing. The result is setStpLevelApplied: wallet, level, committed. An instruction key is refused with 28. See Self-trade prevention.
createSubAccount
Opens a new sub-account in a wallet. account names the wallet's Main. The owner key signs it, Typed only, and the new account inherits that key. Each wallet has an allowance of sub-accounts; one past it is 91.
accountAccountAddressrequired- The wallet's Main account. A sub-account here is refused.
bindingobjectOptional: bind one key to the new account in the same step, with the fields of a
setInstructionKeybind. A binding that fails a bind check rejects the whole request.›Show 4 child fieldsHide child fields
instructionKeyaddressrequired- The key's address.
scopeenumrequiredINSTRUCTION_KEY_SCOPE_FULLorINSTRUCTION_KEY_SCOPE_REDUCE_ONLY.builderFeeCapobjectrequired{ "perpBps", "spotBps" }, decimal strings, at most 10 and 100.nonceModeenumrequiredGAPLESSorINCREASING.
{
"createSubAccount": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"binding": {
"instructionKey": "0x3c9e1a7b5d2f4e6a8c0b1d3f5a7c9e2b4d6f8a10",
"scope": "INSTRUCTION_KEY_SCOPE_FULL",
"builderFeeCap": { "perpBps": "2", "spotBps": "10" },
"nonceMode": "INCREASING"
}
}
}The answer is { "status": "ok" } once the account is created, or its refusal (91 at the allowance). Read the new address with atlas.getAccounts. A key bound with nonceMode INCREASING on the new account can be refused 21 for a short time after the account is created: retry with backoff. See Authentication: increasing.
Key commands
The wallet's owner key binds keys to its accounts and removes them with setInstructionKey, and replaces itself with rotateOwnerKey. Both are Typed only. Each binding is per account and carries its own scope, Builder Fee cap and nonce mode. What keys can do, and how to bind one, is on Instruction keys and Authentication: keys and authority.
kindaccountAccountAddressrequired- The account, Main or a sub-account of the owner key's wallet.
instructionKeyaddressrequired- The key's address.
changeobjectrequired{ "kind": "bind", … }or{ "kind": "remove" }.›Show 4 child fieldsHide child fields
scopeenum- Bind:
INSTRUCTION_KEY_SCOPE_FULLorINSTRUCTION_KEY_SCOPE_REDUCE_ONLY. builderFeeCapobject- Bind:
{ "perpBps", "spotBps" }, the highest Builder Fee rates the key may sign on this account. Negative or above the class cap is100. nonceModeenum- Bind:
GAPLESSorINCREASING, fixed when the key's slot is created. statementsStatement[]- Bind: up to 8
{ "label", "value" }lines the owner reads and accepts with the bind. Empty unless the bind also accepts terms (seeenableTrading).
{
"setInstructionKey": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"instructionKey": "0x3c9e1a7b5d2f4e6a8c0b1d3f5a7c9e2b4d6f8a10",
"change": {
"kind": "bind",
"scope": "INSTRUCTION_KEY_SCOPE_FULL",
"builderFeeCap": { "perpBps": "2", "spotBps": "10" },
"nonceMode": "INCREASING",
"statements": []
}
}
}A bind of a key already bound replaces its scope and caps and keeps its nonce slot. It must name the slot's nonce mode: another mode is 20, and changes nothing. To change mode, remove the key and bind it again. A lower cap applies to new orders only. A bind answers setInstructionKeyApplied with txId, accountAddress and stampedAtMs, the time the bind was stamped, which sets when an increasing-nonce key may first sign: see Authentication: nonce. An account already holding its maximum number of keys is 98. A remove answers { "status": "ok" } once applied, or its refusal, and cancels nothing: the key's resting orders stay on the book. Removing a key that isn't bound is 99.
createSignerPolicy creates a signer policy, an owner made of keys that must co-sign. Any owner key signs it, with a threshold and the members' addresses sorted in ascending order, and every member signs its consent to join. The write answers { "status": "ok" }; the policy's identity (its own address), threshold and members are in the write's record in atlas.getTransactions, found by its txId, and in atlas.getSignerPolicy. It changes no wallet's owner: to move a wallet to the policy, sign rotateOwnerKey with the policy's identity as newOwnerKey and a proof from every member, not only the threshold. See Multi-sig.
Transfers and withdrawals
account is the sending account in each. Amounts are decimal strings, signed at 12 decimal places whatever the asset's own scale. asset is the asset's id from atlas.getAssets. See Withdrawals and transfers.
| Command | Payload | Signed by | Answer |
|---|---|---|---|
internalTransfer | account, toAccount (an account of the same wallet), asset, amount, optional memo (0x + 128 hex) | A Full key bound to account | { "status": "ok", "transferId" } once booked, or the refusal |
transfer | account, toAccount (any account, in this wallet or another), asset, amount, optional memo | The wallet's owner key | { "status": "ok", "transferId" } once booked, or the refusal. A transfer booked into another wallet can't be reversed |
withdraw | account, asset, amount, destinationZone, receiver, optional memo | The wallet's owner key | { "status": "ok", "transferId" } once booked on ATLAS, or the refusal. Not arrival on the destination zone |
{
"internalTransfer": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"toAccount": "0x2c7e9a4b1f6d3c8e5a0b7f2d9c4e1a6b3f8d5c27",
"asset": 1,
"amount": "1000"
}
}transferId is the request's txId: atlas.getTransfers reports it once booked, and atlas.getLedger shows the memo on an internal transfer's rows. The fee is 0. Refusals, nothing moved: 9 (zero amount, or finer than the asset's scale), 135 (toAccount is account), 137 (internalTransfer to another wallet), 205 (unknown asset), 54 (liquidation active), 62 (balance, less what resting spot orders reserve, below amount), 132 (above the withdrawable balance). A transfer to another wallet from a pending or exit-only wallet is 30 or 219; transfers between accounts of one wallet go through in any wallet state.
withdraw sends funds to another Zero zone. ATLAS debits amount and the zone pays receiver the whole amount: there is no withdrawal fee.
accountAccountAddressrequired- The sending account.
assetinteger (u32)required- The asset id.
amountdecimal stringrequired- What leaves the account, at most 8 decimal places (
103) and at least the asset'swithdrawalMinimumfromatlas.getAssets(342). destinationZoneinteger (u32)required- The Zero zone the funds go to, one of the asset's
withdrawalZones. No active route for the asset and zone is206. receiverstringrequired0x+ 64 hex: the 32-byte account ondestinationZone. An EVM address is left-padded with zero bytes.memostring- Optional,
0x+ up to 510 hex (255 bytes), carried to the zone unchanged.
{
"withdraw": {
"account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"asset": 1,
"amount": "250",
"destinationZone": 43002,
"receiver": "0x0000000000000000000000008f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15"
}
}The zone id is illustrative. The answer comes once the withdrawal is booked on ATLAS; transferId is its withdrawal id: track it with atlas.getWithdrawal. A booked withdrawal can't be reversed. Arrival on the destination zone comes later.
Staking
stake moves amount of asset from the account's cross balance into its staking position for that asset; unstake moves it into a pending unstake, which returns to the cross balance whole at the first session boundary after the unstake period. Both take account, asset and amount, need a Full key bound to the account, and answer { "status": "ok" } once applied, or with the refusal. A successful unstake starts the unstake period: the funds are not available yet. Staked funds back no margin.
{ "stake": { "account": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15", "asset": 0, "amount": "5000" } }Refusals, nothing moved: a stake of an asset that can't be staked (256), from a pending wallet (30) or above the withdrawable balance (132); an unstake while one is already pending for the asset (158) or above the staked amount (141). Read the result on atlas.getBalances or atlas.getStakingState.
Advanced orders
TP/SL and TWAP orders are held by ATLAS's advanced-order service, not the matching engine. A parent runs one strategy, tpSl or twap, and places ordinary orders, its children, on the book with the account's delegate key, which you bind first. Send the advanced-order commands with atlas.sendRawTransaction, on POST /seq/tx or /seq/ws, like any other command. Read parents with atlas.getAdvancedOrders and atlas.getAdvancedOrder.
Get the delegate key
atlas.getOmsDelegateKeyreturns the public key the service signs the account's child orders with. It grants nothing.Bind it
Bind its address with
setInstructionKey:INSTRUCTION_KEY_SCOPE_REDUCE_ONLYfor TP/SL on a live position or a reduce-only TWAP,INSTRUCTION_KEY_SCOPE_FULLfor a TP/SL entry order or a TWAP that opens a position. UsenonceModeINCREASING: the service signs child orders with an increasing nonce and places none under aGAPLESSbinding. SetbuilderFeeCapat or above the Builder Fee your parents carry on that market class. A create above it is refused45and spends no nonce, so fix the cap or the fee and sign again with the same nonce. If the cap is lowered later, children go out at the new cap, or with no Builder Fee at 0, so a stop still fires. The parent the service stores keeps its own fee, so if the cap is raised again, the children it sends after that carry the full fee.Create the parent
Sign
createTpSlOrderorcreateTwapOrderwith the owner key, or with a key you bound withsetAdvanceInstructionKey.
The advanced-order commands sign Typed only, under the service's own domain, { name: "atlas", version: "1", chainId, salt: keccak256("atlas/oms") }, where chainId is the wallet's chain, as for any Typed transaction. Their type strings sign Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CreateTpSlOrderV2 action) and so on, with authority the account. They use the same envelope as every other transaction, always with a gapless nonce.
Their nonce is one gapless sequence per signer, separate from its trading nonces. Read the last spent value with atlas.getOmsNonce and sign the next one, with an expiry; a { "rejected": … } result spends its nonce too. Its expires_at follows the gapless rules: a passed expiry is refused 22, one too far ahead 23, and a nonce that isn't last + 1 290. These are JSON-RPC errors and spend no nonce. See Authentication: advanced orders.
Their payloads name the account accountAddress and their own id clOrdId, and carry a flat appBuilderId and builderFeeBps. marketId is the tagged market, as on placeOrder.
TP/SL orders
A TP/SL parent holds a take profit (tp), a stop loss (sl) or both for one position; each side watches a trigger and, when it fires, places a reduce-only close for the whole position at that moment. See Take profit and stop loss.
kindaccountAddressAccountAddressrequired- The account whose position the parent closes.
marketIdMarketIdrequired- A tagged perp market.
clOrdIdClientOrderIdrequired- The parent's own id. Use it later as
target.origClOrdId. marginModeenumrequiredcrossorisolated: the position the sides close, and the entry's mode.tpSlotPlanThe take profit. At least one of
tpandsl.›Show 5 child fieldsHide child fields
triggerRefenumrequiredmark,indexorlast.triggerPricedecimal stringrequired- Positive. Signed at 10 decimal places.
orderTypeenumrequired- The close:
limitormarket. limitPricedecimal string- The
limitclose's price, which may differ fromtriggerPrice. Required onlimit, absent onmarket. timeInForceenumrequiredgtcfor alimitclose;iocorgtcfor amarketclose.
slSlotPlan- The stop loss, with the same fields.
entryEntryPlanOptional: an entry order the service places for you. The sides wait (
pending) until its first fill; an entry that ends unfilled cancels them. Omit it to protect the live position, which must exist.›Show 7 child fieldsHide child fields
sideenumrequiredbuyorsell.baseQtydecimal stringrequired- Positive. Signed at 8 decimal places.
orderTypeenumrequiredlimitormarket.limitPricedecimal string- Required on
limit, absent onmarket. timeInForceenumrequiredgtcorioc.postOnlyboolean- Optional, default
false. Rest only, as onplaceOrder: agtclimitentry only, elsemalformed. An entry that would take on arrival is refused, and the sides end{ "cancelled": "invalid" }. openingMargindecimal string- Optional,
isolatedonly: the initial margin, in the settlement asset, that an entry creating the market's isolated pool commits to it, as onplaceOrder. Without it the position opens at the market's maximum leverage. Only an entry that creates the pool can name it: on acrossparent, or while the account's pool on the market exists, even flat with cash left in it, the create isopeningMarginNotPermitted. Zero or negative isopeningMarginInvalid. Below the entry's initial margin, the entry is refused and the sides end{ "cancelled": "invalid" }. Signed at 12 decimal places.
appBuilderIdBuilderId- Optional Builder Fee attribution, with
builderFeeBps. Charged on the entry and on each close. builderFeeBpsdecimal string- As on
placeOrder.
One open TP/SL parent per account, market and margin mode: a second create is refused whole as occupied, and its parentOrderId names the open one. Add or change a side with updateTpSlOrder.
{
"createTpSlOrder": {
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clOrdId": "0x2c4e6a8b0d1f3e5a7c9b2d4f6a8c0e1d",
"marginMode": "cross",
"tp": { "triggerRef": "mark", "triggerPrice": "73000", "orderType": "limit", "limitPrice": "72950", "timeInForce": "gtc" },
"sl": { "triggerRef": "mark", "triggerPrice": "68000", "orderType": "market", "timeInForce": "ioc" }
}
}{
"createTpSlOrder": {
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clOrdId": "0x7a1c3e5b9d2f4a6c8e0b1d3f5a7c9e2b",
"marginMode": "isolated",
"entry": { "side": "buy", "baseQty": "0.1", "orderType": "limit", "limitPrice": "70000", "timeInForce": "gtc", "postOnly": true, "openingMargin": "1400" },
"sl": { "triggerRef": "mark", "triggerPrice": "66000", "orderType": "market", "timeInForce": "ioc" }
}
}A side that has fired keeps its close order working if the position later goes flat or flips, and it can then open a position the other way: cancel the parent with cancelTpSlOrder, or the close with cancelOrder. See When ATLAS cancels a TP or SL.
TWAP orders
A TWAP parent sends a total quantity as a series of child orders until a fixed deadline. Completion by the deadline is not guaranteed: what is unfilled at the deadline stays unfilled. See TWAP.
kindaccountAddressAccountAddressrequired- The account the children trade for.
marketIdMarketIdrequired- The tagged market.
clOrdIdClientOrderIdrequired- The parent's own id. Use it later as
target.origClOrdId. marginModeenumrequiredcrossorisolated. A TWAP that isn'treduceOnlymust becross.twapTwapPlanrequiredThe TWAP's terms.
›Show 4 child fieldsHide child fields
sideenumrequiredbuyorsell.baseQtydecimal stringrequired- The total, a whole number of the market's lots. Signed at 8 decimal places.
durationSecondsintegerrequired- 300 (5 minutes) to 604,800 (7 days) on a perp market, or to 2,592,000 (30 days) on a spot market. The deadline is this long after the service accepts the parent.
reduceOnlyboolean- Every child is reduce-only. Default
false.
appBuilderIdBuilderId- Optional Builder Fee attribution, with
builderFeeBps. Charged on every child. builderFeeBpsdecimal string- As on
placeOrder.
An account runs at most one TWAP per market: a second create is occupied. A total that isn't whole lots, is below twice the market's minimum order value at the current mark, or needs a slice above the market's maximum order is plan.
{
"createTwapOrder": {
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"marketId": { "PERP": { "id": 1 } },
"clOrdId": "0x3e5a7c9b1d2f4e6a8c0b2d4f6a8c1e3b",
"marginMode": "cross",
"twap": { "side": "buy", "baseQty": "2", "durationSeconds": 3600, "reduceOnly": false }
}
}Advance instruction keys
setAdvanceInstructionKey lets another key create, update and cancel every advanced order of the account, or removes that permission. That key signs only advanced-order requests; it can't trade. Only the owner key may sign it, Typed only; any other signer is -11111, spending no nonce.
accountAddressAccountAddressrequired- The account.
instructionKeyaddressrequired- The key's address.
changeobjectrequired{ "kind": "bind", "omsDelegateKey" }or{ "kind": "remove" }.›Show 1 child fieldHide child fields
omsDelegateKeystring- Bind: the account's current delegate key from
atlas.getOmsDelegateKey,0x04+ 128 lowercase hex, unchanged and already bound withsetInstructionKey. Any other key answers{ "rejected": "delegateKeyNotLive" }.
{
"setAdvanceInstructionKey": {
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"instructionKey": "0x5b7d9f1a3c5e7b9d2f4a6c8e0b1d3f5a7c9e2b4d",
"change": {
"kind": "bind",
"omsDelegateKey": "0x04b2e6d8f0a4c1e3b5d7f9a2c4e6b8d0f1a3c5e7b9d2f4a6c8e0b1d3f5a7c9e2b4d6f8a1c3e5b7d9f0a2c4e6b8d1f3a5c7e9b2d4f6a8c0e1d3f5a7b9c2e4d6f8a1"
}
}
}The binding lasts while that delegate key does: once it is revoked or replaced, bind the key again to the new one. Binding a pair already bound is accepted and changes nothing. A remove of a key that isn't bound answers { "rejected": "keyNotBound" }; parents already placed stay live. The answer is setAdvanceInstructionKeyResult: the request's accountAddress, instructionKey and change, result and version.
Advanced-order results
Each command answers once the service has decided, with type (createAdvancedOrderResult, updateAdvancedOrderResult or cancelAdvancedOrderResult), accountAddress, clOrdId, parentOrderId (or null), version, and result: "accepted" or { "rejected": reason }. A result is not by itself an acceptance: check result. accepted says nothing of the orders it places: follow those on stream.orders. Pass version as minVersion to the reads to see at least that state. A create on a market closed to new orders gets no result: it is refused with JSON-RPC error -10022 (Market closed to new orders) and spends no nonce, as placeOrder and replaceOrder are there. An update there answers { "rejected": "marketAdmissionClosed" }. Cancels still go through.
| Reason | Meaning |
|---|---|
notOwner | The target is another account's parent |
unknownTarget | No parent answers to the target, or it runs another strategy than the request's |
notOpen | The parent has ended, the side's close was already sent, or the side to cancel is missing or ended |
occupied | An open TP/SL parent already holds this account, market and margin mode, or a running TWAP already holds this account and market |
underWork | The position is being liquidated |
reduceOnly | Account controls forbid it |
account | The account can't hold advanced orders |
malformed | A plan breaks a rule above, no side was sent, there is no position and no entry, or the Builder Fee is invalid |
instrument | The strategy isn't offered on this market |
plan | A TWAP total that isn't whole lots, is below its starting floor, needs a slice above the market's maximum order, or has no mark to plan with |
delegateKeyNotLive | setAdvanceInstructionKey named a delegate key that isn't the account's current one |
keyNotBound | setAdvanceInstructionKey removed a key that isn't bound |
marketAdmissionClosed | An update of a parent whose market is closed to new orders |
openingMarginNotPermitted | An entry names openingMargin but doesn't create the market's isolated pool: the parent is cross, or the account's pool on the market exists, even flat with cash left in it |
openingMarginInvalid | An entry's openingMargin is zero or negative |
{
"jsonrpc": "2.0",
"id": 51,
"result": {
"type": "createAdvancedOrderResult",
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clOrdId": "0x2c4e6a8b0d1f3e5a7c9b2d4f6a8c0e1d",
"parentOrderId": "90211",
"result": "accepted",
"version": "4410"
}
}After -10011 (Publication unknown), a timeout or a lost answer the outcome is unknown, not refused: resend the same signed request rather than signing a new one. It applies at most once: if the resend gets a result, that is the outcome; a copy of one already applied is refused, usually 290, and that refusal doesn't say which copy applied. To settle it, read atlas.getOmsNonce for the signer. At or past the request's nonce, that nonce was spent (by this request, if you signed that nonce for nothing else); below it, the read may be behind, so read again. A spent nonce is not an acceptance: an accepted create leaves a parent with its clOrdId in atlas.getAdvancedOrders, open or closed, and a rejected one leaves none.
Results
The result is a closed union, tagged on type. Branch on type. Compare decimal strings numerically, not as text.
| Command | Result |
|---|---|
placeOrder | placeOrderAccepted |
cancelOrder | cancelApplied |
replaceOrder | replaceOrderApplied |
cancelAllOrders, cancelAllOrdersAfter | cancelAllOrdersApplied, cancelAllOrdersAfterApplied |
setStpLevel, rotateOwnerKey | setStpLevelApplied, rotateOwnerKeyApplied |
setInstructionKey bind | setInstructionKeyApplied |
internalTransfer, transfer, withdraw | { "status": "ok", "transferId" }: booked |
moveIsolatedMargin, stake, unstake | { "status": "ok" }: applied |
createSubAccount, setInstructionKey remove | { "status": "ok" }: applied |
| TP/SL and TWAP | createAdvancedOrderResult, updateAdvancedOrderResult, cancelAdvancedOrderResult |
setAdvanceInstructionKey | setAdvanceInstructionKeyResult |
Apart from the advanced-order commands, there are no …Rejected results: a refusal is a JSON-RPC error.
typeTrack the order by orderId. Read immediateOutcome, leavesQty and iocRemainder to see what happened on arrival.
typestringrequiredplaceOrderAccepted.txIdstringrequired- The transaction id.
accountAddressAccountAddressrequired- The signed account.
clOrdIdClientOrderIdrequired- Your placement id A, the signed
clientOrderId. marketIdintegerrequired- The signed market, as its numeric
marketId. sideenumrequiredbuyorsell.orderTypeenumrequiredlimitormarket.pricePrice- As signed, on a limit order. Absent on a market order.
sizeSizerequired- The signed
quantity. filledSizeSizerequired- Matched on arrival.
"0"if none. avgFillPricePricerequired- Average price of the arrival fills.
"0"if none. leavesQtySizerequired- What rests on the book after arrival, a market order's at its bound price.
"0"if nothing rests. orderIdOrderIdrequired- Venue order id,
"{kind}:{id}:{seq}". seqUint64Numberrequired- The
seqinorderId. immediateOutcomeenumrequiredresting(on the book, maybe with nothing filled),filled(fully matched on arrival) orpartial(some matched and a GTC remainder rests, or any IOC that did not fully fill, or a killed FOK).iocRemainderIocRemainderrequiredAlways present. Never infer expiry from a missing field.
›Show 2 child fieldsHide child fields
kindstringrequirednotApplicablefor GTC and FOK.expiredfor IOC.expiredSizeSize- Required when
kindisexpired, even when it is"0".
{
"jsonrpc": "2.0",
"id": 41,
"result": {
"type": "placeOrderAccepted",
"txId": "0x27ca64c092a959c7edc525ed45e845b1de6a7590d173fd2fad9133c8a779a1e3",
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clOrdId": "0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b",
"marketId": 4294967297,
"side": "buy",
"orderType": "limit",
"price": "70300",
"size": "1",
"filledSize": "0.4",
"avgFillPrice": "70220",
"leavesQty": "0.6",
"orderId": "perp:1:48213",
"seq": 48213,
"immediateOutcome": "partial",
"iocRemainder": { "kind": "notApplicable" }
}
}{
"jsonrpc": "2.0",
"id": 42,
"result": {
"type": "placeOrderAccepted",
"txId": "0x0bf474896363505e5ea5e5d6ace8ebfb13a760a409b1fb467d428fc716f9f284",
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clOrdId": "0x8e2d4f6a1c3b5d7e9f0a2c4e6b8d1f3a",
"marketId": 4294967297,
"side": "sell",
"orderType": "market",
"size": "0.5",
"filledSize": "0.5",
"avgFillPrice": "70140",
"leavesQty": "0",
"orderId": "perp:1:48214",
"seq": 48214,
"immediateOutcome": "filled",
"iocRemainder": { "kind": "expired", "expiredSize": "0" }
}
}- Best offers are 0.3 BTC at 70,200 and 0.1 BTC at 70,280.
- IOC: you get
filledSize: "0.4",leavesQty: "0",immediateOutcome: "partial"andiocRemainder: { "kind": "expired", "expiredSize": "0.6" }. - FOK: only 0.4 of 1 can fill, so the order is killed whole:
filledSize: "0",leavesQty: "0",immediateOutcome: "partial",iocRemainder: { "kind": "notApplicable" }. No fill, no fee.
Errors
Every refusal is a JSON-RPC error. code says why; message is human-readable (do not match on it); data, when present, carries clOrdId (the order request's own clientOrderId) and retryAfterMs.
{
"jsonrpc": "2.0",
"id": 41,
"error": {
"code": 40,
"message": "Price tick invalid",
"data": { "clOrdId": "0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b" }
}
}| Code | What it means | What to do |
|---|---|---|
-32700 to -32600 | The request is malformed: bad JSON, envelope or params, uppercase ids, a price or postOnly on a market order | Fix the request |
-20009, 18 | The signature does not verify, or the digest mode isn't allowed for the command (18) | Fix the signing code |
246, 329 | The transaction names another deployment's chain id, or the wrong authority | Read signing.chainId from atlas.getVersion; set authority as described under The transaction |
-10013, 218, -10015 | Not a public command, an unknown command selector, or a command switched off | Send a supported command |
-10003, 24, 28, -11095, -11111 | The key isn't bound to the account, its scope doesn't allow the command, or the signer may not act for the account | Bind the key, or sign with one that may |
20, 21, 22, 23, 290 | Nonce malformed, stale, too old, too far ahead, or not the next gapless value | Sign again with a correct nonce. See Authentication: nonce |
30, 219 | The wallet is pending (not yet ready to trade) or exit-only | Complete enableTrading; an exit-only wallet can only reduce |
Other positive codes, -11018, -11030, -11031 | A pre-trade check or command rule refused it, for example 40 tick, 42 size, 59 post-only, 61 margin, 62 balance, 318 position cap | Nothing changed and the nonce is not spent. Fix the cause and sign again with the same nonce |
-10006, -10007, -10008, -10009, -20001, -20015 | Busy, unavailable, outcome unavailable, account authority unavailable, rate limited or the venue busy | Not submitted. Retry after retryAfterMs, or with backoff |
-10010, -10011, -32603, -20003, a code you don't recognise, a dropped connection | Timed out, publication uncertain, or no definite answer: the outcome is unknown | Look the txId up, as below |
The full catalog is on Errors.
Typed type strings
Each command's EIP-712 type string, in the gapless-nonce form. For a key whose slot is increasing, replace Transaction_Gapless with Transaction_Increasing, Nonce_Gapless nonce with Nonce_Increasing nonce and the Nonce_Gapless(…) definition with Nonce_Increasing(bool Increasing,uint64 time_stamp_nonce). The advanced-order commands always sign the gapless form. How the strings are hashed and signed is on Authentication: Typed signing.
A command whose type depends on its values has one string per form, named after the variants it holds: the market's kind (Spot or Perp), then for placeOrder the order type (Limit or Market) and margin mode (Cross or Isolated), for cancelOrder and replaceOrder the target (OrderId or ClientOrderId), and for setInstructionKey the change (Bind or Remove). The perp forms are below; a spot form replaces Perp with Spot throughout, and MarketId_Perp(bool Perp,uint32 value) with MarketId_Spot(bool Spot,uint32 value).
Type strings for every command
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_Limit_Cross transaction)BuilderFee(address appBuilderId,int64 builderFeeBps)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderKind_Limit(bool Limit,int64 price,bool postOnly)OrderMarginMode_Cross(bool Cross)PlaceOrder_Perp_Limit_Cross(address account,MarketId_Perp marketId,bytes16 clientOrderId,uint8 side,int64 quantity,OrderKind_Limit kind,uint8 timeInForce,OrderMarginMode_Cross marginMode,bool reduceOnly,bool hasBuilderFee,BuilderFee builderFee)Transaction_Gapless_Perp_Limit_Cross(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,PlaceOrder_Perp_Limit_Cross command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_Limit_Isolated transaction)BuilderFee(address appBuilderId,int64 builderFeeBps)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderKind_Limit(bool Limit,int64 price,bool postOnly)OrderMarginMode_Isolated(bool Isolated,bool hasOpeningMargin,int128 openingMargin)PlaceOrder_Perp_Limit_Isolated(address account,MarketId_Perp marketId,bytes16 clientOrderId,uint8 side,int64 quantity,OrderKind_Limit kind,uint8 timeInForce,OrderMarginMode_Isolated marginMode,bool reduceOnly,bool hasBuilderFee,BuilderFee builderFee)Transaction_Gapless_Perp_Limit_Isolated(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,PlaceOrder_Perp_Limit_Isolated command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_Market_Cross transaction)BuilderFee(address appBuilderId,int64 builderFeeBps)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderKind_Market(bool Market)OrderMarginMode_Cross(bool Cross)PlaceOrder_Perp_Market_Cross(address account,MarketId_Perp marketId,bytes16 clientOrderId,uint8 side,int64 quantity,OrderKind_Market kind,uint8 timeInForce,OrderMarginMode_Cross marginMode,bool reduceOnly,bool hasBuilderFee,BuilderFee builderFee)Transaction_Gapless_Perp_Market_Cross(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,PlaceOrder_Perp_Market_Cross command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_Market_Isolated transaction)BuilderFee(address appBuilderId,int64 builderFeeBps)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderKind_Market(bool Market)OrderMarginMode_Isolated(bool Isolated,bool hasOpeningMargin,int128 openingMargin)PlaceOrder_Perp_Market_Isolated(address account,MarketId_Perp marketId,bytes16 clientOrderId,uint8 side,int64 quantity,OrderKind_Market kind,uint8 timeInForce,OrderMarginMode_Isolated marginMode,bool reduceOnly,bool hasBuilderFee,BuilderFee builderFee)Transaction_Gapless_Perp_Market_Isolated(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,PlaceOrder_Perp_Market_Isolated command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_OrderId transaction)CancelOrder_Perp_OrderId(address account,bytes16 clientOrderId,MarketId_Perp marketId,OrderTarget_OrderId target)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderTarget_OrderId(bool OrderId,uint64 value)Transaction_Gapless_Perp_OrderId(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,CancelOrder_Perp_OrderId command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_ClientOrderId transaction)CancelOrder_Perp_ClientOrderId(address account,bytes16 clientOrderId,MarketId_Perp marketId,OrderTarget_ClientOrderId target)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderTarget_ClientOrderId(bool ClientOrderId,bytes16 value)Transaction_Gapless_Perp_ClientOrderId(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,CancelOrder_Perp_ClientOrderId command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_OrderId transaction)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderTarget_OrderId(bool OrderId,uint64 value)ReplaceOrder_Perp_OrderId(address account,MarketId_Perp marketId,OrderTarget_OrderId target,bytes16 clientOrderId,int64 quantity,int64 price,bool postOnly,bool reduceOnly)Transaction_Gapless_Perp_OrderId(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,ReplaceOrder_Perp_OrderId command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp_ClientOrderId transaction)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)OrderTarget_ClientOrderId(bool ClientOrderId,bytes16 value)ReplaceOrder_Perp_ClientOrderId(address account,MarketId_Perp marketId,OrderTarget_ClientOrderId target,bytes16 clientOrderId,int64 quantity,int64 price,bool postOnly,bool reduceOnly)Transaction_Gapless_Perp_ClientOrderId(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,ReplaceOrder_Perp_ClientOrderId command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp transaction)CancelAllOrders_Perp(address account,bytes16 clientOrderId,MarketId_Perp marketId)MarketId_Perp(bool Perp,uint32 value)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless_Perp(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,CancelAllOrders_Perp command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)CancelAllOrdersAfter(address account,uint32 timeoutSeconds)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,CancelAllOrdersAfter command)A variant signs as the struct of its variant with its bool true: a perp market as MarketId_Perp { Perp: true, value: id }, a limit as OrderKind_Limit { Limit: true, price, postOnly }, a market as OrderKind_Market { Market: true }, cross as OrderMarginMode_Cross { Cross: true }, and isolated as OrderMarginMode_Isolated, with hasOpeningMargin false and openingMargin 0 when it names none. Without a Builder Fee, sign hasBuilderFee false, the zero address and 0. txType is 0 and sigSuite the scheme byte. Enums are uint8: side buy 0, sell 1; timeInForce ioc 0, gtc 1, fok 2.
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Perp transaction)MarketId_Perp(bool Perp,uint32 value)MoveIsolatedMargin_Perp(address account,MarketId_Perp marketId,uint8 direction,int128 amount)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless_Perp(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,MoveIsolatedMargin_Perp command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)InternalTransfer(address account,address toAccount,uint32 asset,int128 amount,bytes memo)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,InternalTransfer command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,Transfer command)Transfer(address account,address toAccount,uint32 asset,int128 amount,bytes memo)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,Withdraw command)Withdraw(address account,uint32 asset,int128 amount,uint32 destinationZone,bytes32 receiver,bytes memo)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Stake(address account,uint32 asset,int128 amount)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,Stake command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,Unstake command)Unstake(address account,uint32 asset,int128 amount)direction add 0, remove 1. A transfer or withdrawal memo signs as bytes, the keccak256 of its bytes; an absent transfer memo signs as 64 zero bytes, an absent withdrawal memo as no bytes.
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SetStpLevel(address account,uint8 level)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,SetStpLevel command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Binding(address instructionKey,uint8 scope,BuilderFeeCap builderFeeCap,uint8 nonceMode)BuilderFeeCap(int64 perpBps,int64 spotBps)CreateSubAccount(address account,bool hasBinding,Binding binding)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,CreateSubAccount command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Bind transaction)BuilderFeeCap(int64 perpBps,int64 spotBps)KeyChange_Bind(bool Bind,uint8 scope,BuilderFeeCap builderFeeCap,uint8 nonceMode,Statement[] statements)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SetInstructionKey_Bind(address account,address instructionKey,KeyChange_Bind change)Statement(string label,string value)Transaction_Gapless_Bind(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,SetInstructionKey_Bind command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless_Remove transaction)KeyChange_Remove(bool Remove)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SetInstructionKey_Remove(address account,address instructionKey,KeyChange_Remove change)Transaction_Gapless_Remove(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,SetInstructionKey_Remove command)
AtlasTransaction(uint8 txType,bytes1 sigSuite,Transaction_Gapless transaction)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)RotateOwnerKey(address account,bool hasNewOwnerKey,address newOwnerKey,bool hasNewOwnerKeyProof,Signature[] newOwnerKeyProof)Signature(uint8 sigSuite,bytes32 r,bytes32 s,uint8 v)Transaction_Gapless(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,bytes2 selector,RotateOwnerKey command)level account 0, wallet 1. scope INSTRUCTION_KEY_SCOPE_REDUCE_ONLY 2, INSTRUCTION_KEY_SCOPE_FULL 3. nonceMode GAPLESS 0, INCREASING 1. Builder Fee caps sign at scale 8. A remove signs KeyChange_Remove { Remove: true }.
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CreateTpSlOrderV2 action)BuilderFee(address appBuilderId,int64 builderFeeBps)CreateTpSlOrderV2(address accountAddress,uint8 marketKind,uint32 marketId,bytes16 clOrdId,uint8 marginMode,bool hasTakeProfit,SlotPlan takeProfit,bool hasStopLoss,SlotPlan stopLoss,bool hasEntry,EntryPlanV2 entry,bool hasBuilderFee,BuilderFee builderFee)EntryPlanV2(uint8 side,int64 quantity,uint8 orderType,uint8 timeInForce,bool hasPrice,int64 price,bool postOnly,bool hasOpeningMargin,int128 openingMargin)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SlotPlan(uint8 triggerRef,int64 triggerPrice,uint8 orderType,uint8 timeInForce,bool hasPrice,int64 price)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,UpdateTpSlOrder action)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SlotPlan(uint8 triggerRef,int64 triggerPrice,uint8 orderType,uint8 timeInForce,bool hasPrice,int64 price)UpdateTpSlOrder(address accountAddress,uint8 targetKind,uint64 parentOrderId,bytes16 origClOrdId,bytes16 clOrdId,bool hasTakeProfit,SlotPlan takeProfit,bool hasStopLoss,SlotPlan stopLoss)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CancelTpSlOrder action)CancelTpSlOrder(address accountAddress,uint8 targetKind,uint64 parentOrderId,bytes16 origClOrdId,uint8 slot,bytes16 clOrdId)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CreateTwapOrder action)BuilderFee(address appBuilderId,int64 builderFeeBps)CreateTwapOrder(address accountAddress,uint8 marketKind,uint32 marketId,bytes16 clOrdId,uint8 marginMode,TwapPlan twap,bool hasBuilderFee,BuilderFee builderFee)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)TwapPlan(uint8 side,int64 quantity,uint32 durationSeconds,bool reduceOnly)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CancelTwapOrder action)CancelTwapOrder(address accountAddress,uint8 targetKind,uint64 parentOrderId,bytes16 origClOrdId,bytes16 clOrdId)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,CancelAllTwaps action)CancelAllTwaps(address accountAddress,bytes16 clOrdId)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,SetAdvanceInstructionKey_Bind action)KeyChange_Bind(bool Bind,bytes32 omsDelegateKeyX,bytes32 omsDelegateKeyY)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SetAdvanceInstructionKey_Bind(address accountAddress,address instructionKey,KeyChange_Bind change)
Transaction(uint32 chainId,address authority,address signer,Nonce_Gapless nonce,SetAdvanceInstructionKey_Remove action)KeyChange_Remove(bool Remove)Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)SetAdvanceInstructionKey_Remove(address accountAddress,address instructionKey,KeyChange_Remove change)- Enums:
marketKindspot0, perp1, withmarketIdthe market's number.marginModecross0, isolated1.triggerRefmark0, index1, last2.orderTypelimit0, market1.timeInForceioc0, gtc1.slotssigns asslot: takeProfit0, stopLoss1, both2. - JSON to signed names: a plan's
limitPricesigns ashasPriceandprice; an entry's or TWAP'sbaseQtyasquantity; an entry'sopeningMarginashasOpeningMarginandopeningMargin, and itspostOnlyas is,falsewhen left out;tpandslashasTakeProfit/takeProfitandhasStopLoss/stopLoss;appBuilderIdandbuilderFeeBpsashasBuilderFeeandbuilderFee. A missing side, entry or Builder Fee signs its flagfalseand zeros. - Target:
targetKind0withparentOrderIdand 16 zero bytes, or1with0andorigClOrdId. - Keys:
omsDelegateKeysigns as its X and Y coordinates, 32 bytes each.
Enable trading and builder
enableTrading and enableBuilder aren't sent with atlas.sendRawTransaction. Both accept the Terms of Use with one owner signature. The onboarding flow is on Authentication: open an account and enable trading.
enableTrading
Makes the wallet ready to trade: one signature covers Main and every sub-account, and it charges nothing. It comes in two forms:
- With a key bind (the usual first step): the owner signs a
setInstructionKeybind whosestatementsaccept the terms, sent withatlas.sendWalletReadyRequest. - Without one, for example to accept a new terms version: send the signed
TermsAcceptancemessage withatlas.sendRawMessage.
The exact statements lines are on Authentication: the statements. The result is enableTradingApplied: wallet, committed, stamped (whether the wallet's stamp is now the Builder ID of the Builder line) and stampedAtMs (when the bind was stamped). An already ready wallet can send it again without change.
enableBuilder
Makes the wallet ready and issues the account's Builder ID, the one way to become a builder. Send it as an atlas.sendWalletReadyRequest with kind: "enableBuilder" and a Request line naming it, over HTTP (POST /seq/tx). The result is enableBuilderApplied: digest (of the request that issued the Builder ID), accountAddress, builderId (0x + 40 hex, the same on every later acceptance), terms, issuedAt and, when known, stampedAtMs. From a restricted or undetermined region it is refused with -20014 (Restricted region); trading is not affected.
atlas.sendWalletReadyRequest
atlas.sendWalletReadyRequestHTTP or WebSocket/seq/tx · /seq/ws authSubmits an owner's signed setInstructionKey bind together with its statements text, and answers once the wallet is ready. Positional params, in order: [kind, rawTx, statements]. enableTrading works on POST /seq/tx and /seq/ws; enableBuilder is HTTP only, and /seq/ws refuses it with -10013.
kindenumrequiredenableTradingorenableBuilder.rawTxstringrequired- The signed
setInstructionKeybind envelope, exactly asatlas.sendRawTransactiontakes it. Typed only. Any other command is-10013. statementsStatement[]required- The bind's statements,
[{ "label", "value" }], exactly as signed. Different text from what was signed fails the signature (-20009).
{
"jsonrpc": "2.0",
"id": 40,
"method": "atlas.sendWalletReadyRequest",
"params": [
"enableTrading",
"0x0011000080eb8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15…",
[
{ "label": "Atlas Terms of Use", "value": "atlas-terms-of-use@1 0xd7a9a09c83844e83ec08a2e0d7e997472106b41706c6d30f1a7ffbf755253807" }
]
]
}If the bind is refused, read atlas.getAccountState and atlas.getKeys before you retry: the wallet may be ready anyway. Refusals include -12023 (the bind's expiry has passed), -20010 (unknown terms), -20011 (hash mismatch), -20012 (terms not in force), -20014 (enableBuilder from a restricted region) and 157 (an exit-only wallet; an enableBuilder still gets its Builder ID). The bind's expires_at must be no more than 14 days ahead. After a timeout or a lost answer, send the same request again: every step repeats harmlessly.
atlas.sendRawMessage
atlas.sendRawMessageHTTP or WebSocket/seq/tx · /seq/ws authSubmits one signed TermsAcceptance message (enableTrading without a bind) as its bytes: params: [rawMessage]. A message has no nonce. It signs Typed only, under the message domain, and carries an expiresAt in Unix seconds, at most one day ahead (else -12023). An EnableBuilder message is refused with -10013: become a builder with atlas.sendWalletReadyRequest. A wallet no bind has claimed yet is 115: onboard it with atlas.sendWalletReadyRequest. The result is enableTradingApplied. See Authentication: signed messages.
The terms id, version and hash above are illustrative: copy the ones atlas.getTerms returns.
Not in v1
- Batch: one signed command per request.
- Amend in place: there is no
amendOrder. UsereplaceOrder, which loses queue priority. - Close all: there is no
closeAll. Close each position with a reduce-only order. - Set leverage: there is no
setLeverage. Give a new isolated position anopeningMargin, and adjust it withmoveIsolatedMargin. - Per-order self-trade prevention: the wallet's
setStpLeveldecides it for every order. - Cancel in every market at once:
cancelAllOrderstakes one market per request. - Post-only and reduce-only are flags on
placeOrder(postOnlyon limit orders,reduceOnlyon both), not separate commands or time-in-force values.
Order reads
Reads are served at POST /account/rpc, take a named params object, and need no auth. ATLAS account state is public. Market filters take the numeric marketId from atlas.getSymbols; orders and fills carry no symbol, so resolve a market's display label from market discovery.
The list reads return one page, { rows, nextCursor }, newest first; order history, fills and open orders also return coveredThrough. Pass nextCursor back unchanged as cursor, with the same filters, for the next page; null ends the traversal. The cursor is opaque: start again from the first page when you change a filter. A limit outside 1 to 500 is refused with -32602, not adjusted. Where a read takes from and to, they are Unix milliseconds, from inclusive and to exclusive, and they stay fixed across pages.
Coverage. On atlas.getOrderHistory and atlas.getFills, coveredThrough is how far the history is complete, in Unix ms (null when unknown): anything after it may not be in this traversal yet. A cursor can expire; start again from the first page. atlas.getOpenOrders always returns coveredThrough: null.
The Order object
Order
orderIdOrderId"{kind}:{id}:{seq}", for example"perp:1:48213". Present on every order except arejectedplacement, which never got one.historyIdstring- On history rows: the record's stable id, present even on a rejected placement without an
orderId. accountAddressAccountAddressrequired- The account the order belongs to.
clOrdIdClientOrderId- Your current placement id, for orders you placed. Updated by a successful replace.
txIdstring- The id of the signed transaction that placed the order. Absent when no client transaction placed it, such as a TP/SL close or a TWAP child. On a rejected placement it is how you find the row.
marketIdintegerrequired- The numeric market id, including on rejected placements. A refused placement may name a market that isn't listed.
seqUint64Number- The
seqinorderId, as a JSON number. Absent withorderId. sideenumrequiredbuyorsell.typeenumrequiredlimitormarket, as placed.pricedecimal string | nullrequired- A resting or rejected limit order's limit price. A market order, and an order that only took liquidity, shows its average fill price, or
nullwith no fills. sizeSizerequired- The original quantity. Trims don't change it; a replacement starts a new order with its own.
timeInForceenumgtc,iocorfok.postOnlyboolean- As placed;
falsefor a market order. Onatlas.getOrderHistoryrows only. reduceOnlyboolean- As placed;
falseon spot,trueon a TP/SL close. Onatlas.getOrderHistoryrows only. marginModeenumcrossorisolated, as signed. Absent on spot.statusOrderStatusrequiredaccepted,open,partially_filled,filled,cancelled,rejectedorexpired.statusReasonstring- On a
rejectedorder, the refusal's reason, for exampleMARGIN_EXCEEDED. On an order the venue cancelled or cut without your instruction, the cause:SELF_TRADE,DEAD_MAN,IOC_EXPIRED,FOK_KILLED,LIQUIDATION,FORCE_CLOSEorREDUCE_ONLY_TRIM. Absent on a cancel you signed. filledSizeSizerequired- Cumulative fill.
"0"before any fill. remainingSizeSizerequired- Live quantity:
size − filledSize − trimmedSizewhile the order is live,"0"once it is terminal. trimmedSizeSizerequired- Quantity reduce-only trims took off this order in place, neither filled nor cancelled.
"0"when never trimmed. avgFillPricePricerequired"0"before any fill.builderIdBuilderId- The Builder ID the order's Builder Fee goes to. Absent without one.
builderFeeRateBpsdecimal string- The order's Builder Fee rate in bps, fixed at placement.
createdAtTimestampMsrequired- When the order was accepted, or refused. Unix ms, JSON integer.
updatedAtTimestampMsrequired- The last fill, trim, cancel, expiry or refusal. Unix ms, JSON integer.
signerRoleenumowneroragent(a bound key). Absent when no key signed the order, such as a liquidation. An order the advanced-order service placed isagent: useorigin.agentPubkeyXstring- The signing key's x coordinate,
0x+ 64 hex. WhensignerRoleisagent. agentPubkeyYstring- The y coordinate. When
signerRoleisagent. parentOrderIdUint64String- The advanced-order parent the service placed this order for.
originenum- For a TP/SL order:
entry,take_profitorstop_loss. stpLevelenum- Only on an order that self-trade prevention cancelled: the taker wallet's level,
accountorwallet, when the orders met. stpTakerAccountAccountAddress- Only on an order that self-trade prevention cancelled: the account whose order met it.
- 01accepted
- 02open
- 03partially_filled
- 04filled / cancelled / expiredterminal
- 01accepted
- 02open
- 03partially_filled
- 04filled / cancelled / expiredterminal
A market order that fills at once goes straight from accepted to filled. cancelled covers a cancel you sent, self-trade prevention, the dead-man deadline, a reduce-only trim that removed the whole order, a killed FOK, a forced close and a venue cancel. expired is the unfilled remainder of an IOC order. rejected is a placement ATLAS refused.
atlas.getOrder
atlas.getOrderHTTP/account/rpcatlas.getOrderHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getOrder","params":{"orderId":"perp:1:48213"}}'Press Send to see the response.orderIdOrderIdrequired- The venue order id, for example
"perp:1:48213".
Result: Order, or null if there is no such order. Not-found is not an error. A filled or cancelled order is still found.
atlas.getOrderByClOrdId
atlas.getOrderByClOrdIdHTTP/account/rpcThe same Order by your own placement id. The key is the pair (accountAddress, clOrdId): different accounts may use the same id. No market or venue id needed.
atlas.getOrderByClOrdIdHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getOrderByClOrdId","params":{"accountAddress":"0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15","clOrdId":"0x5f1c9a7e3b2d4c6e8a0b1d3f5e7c9a2b"}}'Press Send to see the response.accountAddressAccountAddressrequired- The account the
clOrdIdbelongs to. clOrdIdClientOrderIdrequired- The order's placement id,
0x+ 32 lowercase hex. Not a cancel or replace request's own id.
Result: Order, or null.
A clOrdId is unique among an account's live orders and is free again once its order ends, so over time it can name several orders. The lookup covers every order of the account, live or ended, and returns the newest: the live order using it, otherwise the most recently placed. Read an older one by its orderId. A placement refused before it got an orderId is not found here: look for it in atlas.getOrderHistory, or look its txId up with atlas.getTransactions. null does not show that a placement failed.
atlas.getOpenOrders
atlas.getOpenOrdersHTTP/account/rpcLive orders, most recently updated first.
atlas.getOpenOrdersHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getOpenOrders","params":{"marketId":4294967297,"accountAddress":"0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15","limit":100}}'Press Send to see the response.marketIdinteger- Only this market.
accountAddressAccountAddress- Account scope. Omit and you get all accounts.
limitinteger- 1 to 500. Default 100.
cursorstringnextCursorfrom the previous page. Omit for the first page.
Result: { rows: Order[], nextCursor, coveredThrough }, by updatedAt descending, then orderId. An order that changes between pages can move, so a full traversal is not a point-in-time snapshot. Keep live state with stream.orders.
atlas.getOrderHistory
atlas.getOrderHistoryHTTP/account/rpcEnded orders for one account, most recently updated first: filled, cancelled and expired orders, unfilled IOC and FOK outcomes, and refused placements. Live orders are in atlas.getOpenOrders. Requests refused for their signature or envelope are not recorded.
atlas.getOrderHistoryHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getOrderHistory","params":{"accountAddress":"0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15","marketId":4294967297,"limit":20}}'Press Send to see the response.The first row is a 25 BTC buy refused for margin: it has no orderId or seq, so find it by its txId or clOrdId. The second is the order from the examples above, cancelled with 0.4 filled.
accountAddressAccountAddressrequired- Account to query.
marketIdinteger- Only this market.
signerenumowneroragent. Either one leaves out orders no key signed.fromTimestampMs- Inclusive lower bound on
updatedAt, Unix ms. toTimestampMs- Exclusive upper bound on
updatedAt, Unix ms. limitinteger- 1 to 500. Default 50.
cursorstringnextCursorfrom the previous page.
Result: { rows: Order[], nextCursor, coveredThrough }: the latest state of each ended order and each recorded refusal, by updatedAt descending. historyId identifies each row. An unfilled IOC reads expired with statusReason: "IOC_EXPIRED"; a killed FOK reads cancelled with statusReason: "FOK_KILLED" and nothing filled.
atlas.getFills
atlas.getFillsHTTP/account/rpcYour fills, newest first, each with what it did to the position and the PnL it realized.
atlas.getFillsHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getFills","params":{"marketId":4294967297,"limit":2,"accountAddress":"0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15"}}'Press Send to see the response.marketIdinteger- Only this market.
accountAddressAccountAddress- Account scope. Omit and you get all accounts.
signerenumowneroragent. Either one leaves out fills of orders no key signed, and non-order rows.fromTimestampMs- Inclusive lower bound on
timestamp, Unix ms. toTimestampMs- Exclusive upper bound on
timestamp, Unix ms. limitinteger- 1 to 500. Default 50.
cursorstringnextCursorfrom the previous page.
Result: { rows: Fill[], nextCursor, coveredThrough }, by timestamp descending. Both sides of one trade stay apart across pages.
Fill
tradeIdTradeIdrequired- Trade id, shared by both sides of the trade. Opaque. On a non-order row, the liquidation or ADL id, the same
causeIdas its ledger rows. kindenum- Only on a row that reduced or closed a position without an order:
adl(auto-deleveraging) orvault_assignment(the position backstop took the position, one row per market). Absent on an order-book fill. orderIdOrderId- The order this fill belongs to,
"{kind}:{id}:{seq}". Absent on akindrow. clOrdIdClientOrderId- The order's placement id at execution, when it had one.
marketIdintegerrequired- The numeric market id.
seqUint64Number- The order's
seq. Absent on akindrow. accountAddressAccountAddressrequired- The account this side of the fill belongs to.
sideenumrequiredbuyorsell.pricePricerequired- Fill price. On a
kindrow, the price the position moved at: the ADL price, or the mark for a vault assignment. sizeSizerequired- Fill size.
feeAmountrequired- Exact to 12 decimal places, in the market's quote asset on every market, buys and sells alike. Negative is a rebate. See Spot markets: fees.
builderIdBuilderId- The builder this fill's Builder Fee is attributed to. Absent when the order charges none.
builderFeeAmount- The Builder Fee charged on this fill, in the same asset as
feeand on top of it. liquidityenummakerortaker. Use this, not the id, to tell maker from taker. Absent on akindrow.realizedPnlAmount- Price PnL this fill realized against the position's average entry, excluding
fee."0"when the fill only opened or added. Absent on spot. directionenum- What the fill did to the position:
open_long,open_short(opened or added),close_long,close_short(reduced or closed), orlong_to_short,short_to_long(flipped through zero). Absent on spot. startPositiondecimal string- The position's signed size before this fill: positive long, negative short,
"0"when flat. Absent on spot. liquidationbooleantruewhen the fill's order was a liquidation order.txIdstring- The id of the signed transaction that produced this fill, the same on both sides of the trade: on a maker fill it is the taker's transaction, not the one that placed your order (that is the order's
txId). Absent when no client transaction did, such as a liquidation, a TP/SL close or a TWAP child. timestampTimestampMsrequired- Match time, or the booking time of a
kindrow. Unix ms. signerRoleenumowneroragent: who signed the order behind this side. Absent when no key signed it, and on akindrow.agentPubkeyXstring- When
signerRoleisagent. agentPubkeyYstring- When
signerRoleisagent. parentOrderIdUint64String- The advanced-order parent of the order behind this fill, when the service placed it.
originenumentry,take_profitorstop_loss, withparentOrderIdon a TP/SL order.
atlas.getFundingHistory
atlas.getFundingHistoryHTTP/account/rpcBooked funding payments, newest first. settlementTsMs is when the payment was booked, which may be after the session ended.
atlas.getFundingHistoryHTTP POSTcurl -s https://<api-host>/account/rpc \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"atlas.getFundingHistory","params":{"accountAddress":"0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15","marketId":4294967297,"limit":100}}'Press Send to see the response.accountAddressAccountAddressrequired- Account to query.
marketIdinteger- Only this perp market.
fromTimestampMs- Inclusive lower bound on the booking time, Unix ms.
toTimestampMs- Exclusive upper bound on the booking time, Unix ms.
limitinteger- 1 to 500. Default 100.
cursorstringnextCursorfrom the previous page, unchanged, with the same filters.
Result: FundingHistoryPage
FundingHistoryPage
rowsFundingPayment[]requiredBooked funding, newest first. Two holdings charged in one session are two rows.
›Show 11 child fieldsHide child fields
accountAddressAccountAddressrequired- Account.
marketIdintegerrequired- The numeric market id.
symbolSymbolrequired- The market's display label.
sessionIdUint64Stringrequired- The closed funding session whose charge was booked.
marginModeenumrequired- The holding charged:
cross, orisolatedfor the market's isolated position. settlementHeightintegerrequired- The height at which the payment was booked.
settlementTsMsTimestampMsrequired- When the payment was booked.
positionQuantityDecimalStringrequired- Signed position size at the session boundary: positive long, negative short.
fundingRateDecimalStringrequired- The session's rate as a signed decimal fraction:
"0.0001"is 1 bp. Positive: longs pay shorts. Market funding-rate history is in basis points instead. markPriceDecimalStringrequired- The mark the session charged at.
paymentDecimalStringrequired- The cash booked, in the market's quote asset. Positive: you received. Negative: you paid.
nextCursorstring | nullrequired- Pass back unchanged as
cursor.nullends the traversal.
A cursor can expire; start again from the first page. Each position's running total is cumulativeFunding on atlas.getPositions.
Advanced order reads
The advanced-order reads are served at POST /oms/v1/queries, with the same JSON-RPC envelope and named params. They are HTTP only.
atlas.getOmsDelegateKey
atlas.getOmsDelegateKeyHTTP/oms/v1/queriesThe public key the advanced-order service signs the account's child orders with. Public: no read authorization. It is issued on the first request and stays the same until its binding is removed; the request after that returns a new key. It returns no private key and grants nothing: bind its address with setInstructionKey, then pass it unchanged as omsDelegateKey to a setAdvanceInstructionKey bind. Weight 1.
accountAddressAccountAddressrequired- The account.
{
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"omsDelegateKey": "0x04b2e6d8f0a4c1e3b5d7f9a2c4e6b8d0f1a3c5e7b9d2f4a6c8e0b1d3f5a7c9e2b4d6f8a1c3e5b7d9f0a2c4e6b8d1f3a5c7e9b2d4f6a8c0e1d3f5a7b9c2e4d6f8a1",
"status": "bindable"
}Result: accountAddress, omsDelegateKey (0x04 + 128 hex) and status: bindable (not bound yet: bind it before binding an advance instruction key to it) or bound (a live binding was seen).
atlas.getOmsNonce
atlas.getOmsNonceHTTP/oms/v1/queriesThe last advanced-order nonce a signer spent. Sign its next advanced-order command with this value plus one. Public: no read authorization.
signerAddressaddressrequired- The signing key's address.
{ "gaplessNonce": "41" }Result: gaplessNonce, a decimal string. The sequence is per signer, across every account it signs for, and a recorded rejection spends a value too.
Read authorization
atlas.getAdvancedOrders and atlas.getAdvancedOrder need an Authorization header signed by the account's owner key or a key bound with setAdvanceInstructionKey. An account Bearer token alone does not authorize them.
Authorization: OMS-Read <expiresAtMs>:<chainId>:<signatureHex>The signature is 65 bytes r ‖ s ‖ v with no scheme byte, over EIP-712 ReadAuthorization(address accountAddress,uint64 expiresAtMs) under { name: "atlas", version: "1", chainId, salt: keccak256("atlas/oms/message") }, where chainId is the chain the wallet signed at and the one the header names. It expires at expiresAtMs, at most five minutes ahead. signatureHex is the 130 hex digits, with or without 0x, in either case. A missing or invalid header is -20002.
Both reads take an optional minVersion, a write result's version: the read answers only once it has caught up that far, and is refused with -14002 (Version not projected) rather than answering older state. Retry it shortly.
atlas.getAdvancedOrders
atlas.getAdvancedOrdersHTTP/oms/v1/queries authThe account's parents of the strategies you name, as they stand now, by parentOrderId ascending. A parent of a strategy you don't name is never returned. Child orders are ordinary orders too: read them with the order reads (parentOrderId marks them). Weight 20.
accountAddressAccountAddressrequired- The account.
strategiesstring[]required- At least one of
tpSlandtwap, for example["tpSl", "twap"]. stateenumopenorclosed; omit for both.openis a TP/SL parentpending,armedortriggered, or a TWAPrunning.cursorUint64String- A
nextCursor: parents with a higherparentOrderId. Omit for the first page. limitinteger- 1 to 500. Default 100.
minVersionUint64String- The version the read must have caught up to.
Result: { projectedVersion, items: AdvancedOrder[], nextCursor }. projectedVersion is the version the read answered at.
{
"projectedVersion": "4412",
"items": [
{
"parentOrderId": "90211",
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clOrdId": "0x2c4e6a8b0d1f3e5a7c9b2d4f6a8c0e1d",
"marketId": 4294967297,
"marginMode": "cross",
"parentVersion": "2",
"strategy": {
"type": "tpSl",
"status": "armed",
"endReason": null,
"protects": "long",
"entry": null,
"takeProfit": {
"plan": { "triggerRef": "mark", "triggerPrice": "73000", "orderType": "limit", "limitPrice": "72950", "timeInForce": "gtc" },
"state": "armed",
"childHasFills": false,
"childLogged": false,
"childCancelState": "notRequested"
},
"stopLoss": {
"plan": { "triggerRef": "mark", "triggerPrice": "68000", "orderType": "market", "timeInForce": "ioc" },
"state": "armed",
"childHasFills": false,
"childLogged": false,
"childCancelState": "notRequested"
}
}
},
{
"parentOrderId": "90230",
"accountAddress": "0x8f3a6c1e2b9d4f7a0c5e8b1d3f6a9c2e4b7d0f15",
"clOrdId": "0x3e5a7c9b1d2f4e6a8c0b2d4f6a8c1e3b",
"marketId": 4294967297,
"marginMode": "cross",
"parentVersion": "9",
"strategy": {
"type": "twap",
"status": "running",
"endReason": null,
"side": "buy",
"baseQty": "2",
"durationSeconds": 3600,
"reduceOnly": false,
"startedAtMs": 1791210600000,
"deadlineMs": 1791214200000,
"opportunities": 120,
"filledQty": "0.5",
"remainingQty": "1.5",
"averagePrice": "70184",
"skip": null
}
}
],
"nextCursor": null
}AdvancedOrder
parentOrderIdUint64Stringrequired- The parent's id.
accountAddressAccountAddressrequired- The account.
clOrdIdClientOrderIdrequired- The create request's
clOrdId. An update or cancel never replaces it. marketIdintegerrequired- The numeric market id.
marginModeenumrequiredcrossorisolated.parentVersionUint64Stringrequired- Counts this parent's changes. Not a
minVersion. strategyobjectrequired- The strategy the parent runs, named by
strategy.type:tpSlortwap. Keep a parent whosestrategy.typeyou don't know, with its common fields, rather than failing the read.
strategy (tpSl)
typestringrequiredtpSl.statusenumrequired- The most active side wins:
triggered(a close is working), thenarmed, thenpending(waiting for the entry's first fill). Once no side is open:completeif a side completed, elsecancelled.completeandcancelledare final. endReasonEndReason | nullrequired- Why it was cancelled;
nullunlessstatusiscancelled. protectsenum | nullrequiredlongorshort, the side of the position the parent protects.nulluntil it arms.entryobject | nullrequiredThe entry order, or
nullwithout one.›Show 4 child fieldsHide child fields
clOrdIdClientOrderIdrequired- The client id the service gave the entry order.
planEntryPlanrequired- As sent.
stateenumrequiredoffered(sent, not answered),workingordone.hasFillsbooleanrequired- Whether a fill of the entry was seen. Not that it filled whole.
takeProfitAdvancedOrderSlot | nullrequiredThe take-profit side, or
null.›Show 5 child fieldsHide child fields
planSlotPlanrequired- As sent or last updated.
stateSlotStaterequiredpending,armed,triggered(its close order was accepted and still works; its fills count for this side),complete,{ "faulted": "positionNotOnQtyGrid" }(crossed, but the position isn't on the quantity grid; still watched) or{ "cancelled": endReason }.childHasFillsbooleanrequired- Whether a fill of this side's close order was seen.
childLoggedbooleanrequired- Whether this side's close order reached the engine.
childCancelStateenumrequired- Where cancelling the close order stands, which only cancelling the parent asks for:
notRequested,deciding,requested,notNeeded(the order stopped first) ordone.
stopLossAdvancedOrderSlot | nullrequired- The stop-loss side, with the same fields.
strategy (twap)
typestringrequiredtwap.statusenumrequiredrunningwhile it may send;filledonce the whole total is confirmed filled;endedwhen the deadline came first;stopped, with itsendReason, when something ended it early. Onlyrunningchanges.endReasonEndReason | nullrequired- Why it stopped;
nullunlessstatusisstopped. sideenumrequiredbuyorsell.baseQtydecimal stringrequired- The total.
durationSecondsintegerrequired- As sent.
reduceOnlybooleanrequired- As sent.
startedAtMsintegerrequired- When the service accepted it, Unix ms. The first child is due then.
deadlineMsintegerrequired- After this, Unix ms, it sends nothing new.
opportunitiesintegerrequired- How many scheduled opportunities its plan has.
filledQtydecimal stringrequired- Confirmed fills of its children, including a late fill after it ended.
remainingQtydecimal stringrequired- What is left of the total.
averagePricedecimal string | nullrequired- The volume-weighted average price of its fills;
nullbefore the first. skipenum | nullrequired- Why its latest opportunity sent nothing, while that stands:
belowFloor(the market's maximum order or the shortfall left a child below the starting floor) ornoPrice(no mark to bind to).
endReason values: client (you cancelled it, or its close order was cancelled by you, cancelAllOrders or the dead-man switch), invalid (the position went flat or flipped before a fire, the engine refused or cancelled the close, or the entry ended unfilled), liquidated, expired (the close's time in force ended it), reduceOnlyTrim (the close was trimmed away to fit the position), forceClose (the position was force-closed), childRejected (the engine refused a TWAP child), omsKeyRevoked (the account's delegate key was unbound), marketClosed (the market closed for good), positionFlat (a reduce-only TWAP's position went flat), walletExitOnly (a spot TWAP's wallet became exit-only) and marketAdmissionClosed (the market was closed to new orders before a close order or TWAP child was sent).
atlas.getAdvancedOrder
atlas.getAdvancedOrderHTTP/oms/v1/queries authOne parent, of either strategy, as it stands now, and what was seen of its child orders. It is not the receipt of any one request. Weight 5.
accountAddressAccountAddressrequired- The account.
parentOrderIdUint64Stringrequired- The parent.
limitinteger- Child orders per page, 1 to 500. Default 100.
cursorstringnextCursorfrom the previous page, for older children. Omit for the newest.minVersionUint64String- As on
atlas.getAdvancedOrders.
Result: { projectedVersion, parent: AdvancedOrder, children, nextCursor }. Children come a page at a time, newest first, and every page carries the parent again. Pass nextCursor back as cursor for older children; null ends the traversal. A parent of another account, or one the signer may not read, is -14001 (Unknown advanced order).
children[]
clOrdIdClientOrderIdrequired- The child order's client id.
roleenumrequiredentry,takeProfit,stopLossortwapSlice. Keep a child whoseroleyou don't know.linkedbooleanrequired- ATLAS received the child order. Not that it rests or filled.
outcomesChildOutcome[]required- What was seen, in order:
{ "answered": { refusal, orderId, coreRevision } }(the engine's answer;refusalisnullwhen it took the order, elseorderRejected,commandRejectedordeclined),{ "filled": { orderId, price, quantity, fact } }(one fill), or"ended".orderIdhere is the order'sseqas a string.