{
  "asyncapi": "3.1.0",
  "info": {
    "title": "ATLAS Public API — Streams",
    "version": "1.0.0",
    "description": "Server-push stream.* messages: public market-data streams on /market/ws and account streams on /account/ws."
  },
  "servers": {
    "market": {
      "host": "testnet.atlas.layerzero.network",
      "protocol": "wss",
      "pathname": "/market/ws",
      "description": "Market-data streams (trades, order_book, candles, ticker, bbo, mark_price)."
    },
    "account": {
      "host": "testnet.atlas.layerzero.network",
      "protocol": "wss",
      "pathname": "/account/ws",
      "description": "Account streams (orders, account, funding), by accountAddress."
    }
  },
  "channels": {
    "marketStreams": {
      "address": "/market/ws",
      "servers": [
        {
          "$ref": "#/servers/market"
        }
      ],
      "messages": {
        "streamTrades": {
          "$ref": "#/components/messages/StreamTrades"
        },
        "streamOrderBook": {
          "$ref": "#/components/messages/StreamOrderBook"
        },
        "streamCandles": {
          "$ref": "#/components/messages/StreamCandles"
        },
        "streamTicker": {
          "$ref": "#/components/messages/StreamTicker"
        },
        "streamClosed": {
          "$ref": "#/components/messages/StreamClosed"
        },
        "streamMarkPrice": {
          "$ref": "#/components/messages/StreamMarkPrice"
        },
        "streamBbo": {
          "$ref": "#/components/messages/StreamBbo"
        }
      }
    },
    "accountStreams": {
      "address": "/account/ws",
      "servers": [
        {
          "$ref": "#/servers/account"
        }
      ],
      "messages": {
        "streamOrders": {
          "$ref": "#/components/messages/StreamOrders"
        },
        "streamAccount": {
          "$ref": "#/components/messages/StreamAccount"
        },
        "streamClosed": {
          "$ref": "#/components/messages/StreamClosed"
        },
        "streamAdvancedOrders": {
          "$ref": "#/components/messages/StreamAdvancedOrders"
        }
      }
    }
  },
  "components": {
    "messages": {
      "StreamAccount": {
        "name": "stream.account",
        "x-subscribeArgs": [
          "accountAddress"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "x-authRequired": false,
        "description": "The account reports of one account in the order the Log produced them:\nits balances, positions, funding payments, wallet state and account\nreports, each numbered by the account stream's report number\n(`reportNo`), plus rejects of its transactions.\n\nReport frames (`balance`, `position`, `payment`, `walletState`,\n`accountReport`) carry `reportNo`, which starts at \"1\" and rises by one\nper report of this stream for the account, the report position `gk`,\nthe `logTime` of the entry, and either the `txId` of the transaction\nwhose batch produced the report or the `cause` that names the system\nevent. The ordinal of `gk` counts the reports of this stream in the\nentry; the order and fill reports the same entry produces are on\n`stream.orders`. A balance or position frame leaves at the end of its\nentry and names the batch that last changed it.\n\nEach stream is ordered on its own. `reportNo`, `gk` and the\nsnapshot belong to this stream: the numbers of `stream.orders` and of\n`stream.account` are independent, and nothing orders a frame of one\nstream against a frame of the other. A client that holds both\nsubscriptions must not join them by `reportNo` or `gk`.\n\nOther frames:\n\n- `snapshot` (`snapshot = true`) — the account state, as\n  `atlas.getAccountState` returns it, covering every report of this\n  stream through `reportNo` and the Log through `coveredThrough`. The\n  client replaces the account it holds with it. One also arrives\n  among the reports, numbered like them, when an entry changes the\n  account in a way no balance or position frame shows: ATLAS retired\n  an isolated unit.\n- `gapNotice` — the reports numbered `missing.first` through\n  `missing.last` cannot be delivered; a `snapshot` that covers them follows.\n- `heartbeat` — at least every second: every report of this stream for\n  the account through Log Height `watermark` has been delivered,\n  filtered out or covered by a snapshot, and `scannedThrough` is the\n  highest report number passed, filtered types included, so a jump in\n  `reportNo` that the filter caused is not a loss.\n- `reject` — ATLAS rejected a transaction of the account without logging it. It goes out as soon as it arrives, not ordered\n  against the reports; it takes no report number and is not resumed.\n  A reject goes only to the stream of its command, with the command's\n  `selector`: `stream.orders` for place, replace, cancel and cancel-all\n  commands, `stream.account` for every other command.\n- `health` — reserved for a later release; not emitted.\n\nA subscription with no `afterReportNo` starts with a `snapshot`. One\nthat names `afterReportNo` receives every report of this stream after\nit, once and in order, when the client was away for at most an hour and\nthe missing reports are still in the recording; otherwise a `gapNotice`\nand a `snapshot`. `types` drops whole frames of the types it leaves\nout; `snapshot`, `gapNotice` and `heartbeat` always arrive.\n\nField shapes inside the report bodies MUST be byte-identical to what\nthe matching HTTP reads return for the same resource.\n",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "accountAddress",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "True only on a `snapshot` frame."
            },
            "accountAddress": {
              "$ref": "#/components/schemas/AccountAddress"
            },
            "data": {
              "type": "object",
              "required": [
                "type"
              ],
              "description": "Discriminated payload; the `type` tag selects one frame.",
              "oneOf": [
                {
                  "title": "StreamAccountBalance",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "balance"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "balance"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "balance": {
                      "$ref": "#/components/schemas/Balance"
                    }
                  }
                },
                {
                  "title": "StreamAccountPosition",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "position"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "position"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "position": {
                      "$ref": "#/components/schemas/Position"
                    }
                  }
                },
                {
                  "title": "StreamAccountPayment",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "payment"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "payment"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "payment": {
                      "$ref": "#/components/schemas/FundingPayment"
                    }
                  }
                },
                {
                  "title": "StreamAccountWalletState",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "walletState"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "walletState"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "walletState": {
                      "$ref": "#/components/schemas/WalletState"
                    }
                  }
                },
                {
                  "title": "StreamAccountReport",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "report"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "accountReport"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "report": {
                      "$ref": "#/components/schemas/AccountReport"
                    }
                  }
                },
                {
                  "title": "StreamAccountHealth",
                  "type": "object",
                  "required": [
                    "type",
                    "health"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "health"
                      ]
                    },
                    "health": {
                      "$ref": "#/components/schemas/AccountHealth"
                    }
                  }
                },
                {
                  "title": "StreamAccountReject",
                  "type": "object",
                  "required": [
                    "type",
                    "txId",
                    "reason",
                    "selector"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "reject"
                      ]
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "clientOrderId": {
                      "$ref": "#/components/schemas/ClientOrderId"
                    },
                    "selector": {
                      "$ref": "#/components/schemas/CommandSelector"
                    }
                  }
                },
                {
                  "title": "StreamAccountHeartbeat",
                  "type": "object",
                  "required": [
                    "type",
                    "watermark",
                    "logTime",
                    "scannedThrough"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "heartbeat"
                      ]
                    },
                    "watermark": {
                      "$ref": "#/components/schemas/LogHeight"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "scannedThrough": {
                      "$ref": "#/components/schemas/ReportNo"
                    }
                  }
                },
                {
                  "title": "StreamAccountGapNotice",
                  "type": "object",
                  "required": [
                    "type",
                    "missing"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "gapNotice"
                      ]
                    },
                    "missing": {
                      "$ref": "#/components/schemas/ReportRange"
                    }
                  }
                },
                {
                  "title": "StreamAccountSnapshot",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "coveredThrough",
                    "account"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "snapshot"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "coveredThrough": {
                      "$ref": "#/components/schemas/LogHeight"
                    },
                    "account": {
                      "$ref": "#/components/schemas/AccountState"
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "StreamAdvancedOrders": {
        "name": "stream.advancedOrders",
        "x-subscribeStream": "advanced_orders",
        "x-subscribeArgs": [
          "accountAddress",
          "strategies"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "x-authRequired": true,
        "description": "Server-push events for an account's parent orders of the strategies\nnamed in `strategies`; a parent of another strategy is never pushed.\n\nPrivate. Before subscribing on `/account/ws`, the same connection\nmust bind the requested account with `auth.signIn`. A subscribe with\nno sign-in is refused `-20002` (Authentication required); a\nconnection signed in for another account is refused `-12010` (Account\nmismatch). An `OMS-Read` credential that authorizes the\n`atlas.getAdvancedOrders` / `atlas.getAdvancedOrder` HTTP reads does\nnot by itself authorize this WebSocket subscription.\n\nThe selector `advanced_orders` and the pushed method\n`stream.advancedOrders` differ on purpose: every other stream derives\nits method name from its selector. Subscribe with\n`stream = advanced_orders`.\n\nThe first event after subscribe has `snapshot = true` and carries\nevery open parent of those strategies as\n`data.type = advancedOrders` in `data.advancedOrders`. Every later\nevent has `snapshot = false`, `data.type = advancedOrder`, and carries\nthe complete changed parent in `data.advancedOrder`. Each parent is an\n`AdvancedOrder`.\n\nChild orders and fills are not carried here: they remain on\n`stream.orders`, joined through the child `clOrdId` values returned by\n`atlas.getAdvancedOrder`. The two streams have no cross-stream\nordering guarantee.\n",
        "payload": {
          "$ref": "#/components/schemas/AdvancedOrderStreamPayload"
        }
      },
      "StreamBbo": {
        "name": "stream.bbo",
        "x-subscribeArgs": [
          "marketId"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true  → first delivery after subscribe; clients should replace any cached BBO. false → subsequent deliveries.\n"
            },
            "data": {
              "$ref": "#/components/schemas/BBO"
            }
          }
        }
      },
      "StreamCandles": {
        "name": "stream.candles",
        "x-subscribeArgs": [
          "marketId",
          "interval"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true  → data contains the initial history snapshot, whose candles carry their own finality in `x`. false → data contains one live or finalized candle update; inspect that candle's `x` value.\n"
            },
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Candle"
              }
            }
          }
        }
      },
      "StreamClosed": {
        "name": "stream.closed",
        "x-subscribeArgs": [],
        "description": "Server-initiated subscription termination notice.\nSent before the server stops delivering events for a subscription.\nClients should treat receipt of this message as authoritative subscription termination\nand resubscribe if continued delivery is desired.\n",
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "$ref": "#/components/schemas/StreamClosed"
        }
      },
      "StreamMarkPrice": {
        "name": "stream.mark_price",
        "x-subscribeArgs": [
          "marketId"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true  → first delivery after subscribe; data is the latest periodic snapshot if available, or absent (no frame sent) if none. false → live update on each periodic tick.\n"
            },
            "data": {
              "$ref": "#/components/schemas/MarkPrice"
            }
          }
        }
      },
      "StreamOrderBook": {
        "name": "stream.order_book",
        "description": "Order book for a market: one snapshot, then incremental deltas.\n\nThe first frame after subscribe is a snapshot (`snapshot: true`): `data`\nholds up to 500 levels per side and `updateId`, the book state it shows.\nEvery later frame is a delta (`snapshot: false`) for the subscription's\n`interval` (default 50ms): only the levels that changed during that\ninterval, each `[price, size]` at its new absolute size, where size \"0\"\nremoves the level. A delta is sent only when the book changed. At\n`0ms` (real time) each delta holds one ATLAS revision's changes and is\nsent as soon as the revision commits.\n\nTo merge, keep a book keyed by price and the `updateId` it shows:\n\n1. On a snapshot, replace the whole book and take its `updateId`.\n2. On a delta, skip it if `updateId` <= the book's. Apply it when\n   `prevUpdateId` <= the book's `updateId`: set each level to its size,\n   remove the levels whose size is \"0\", and take the delta's\n   `updateId`. A `prevUpdateId` above the book's means a delta is\n   missing: resubscribe.\n\nThe server joins the snapshot to the deltas that follow it, so a client\nthat applies frames in order only needs the checks to detect faults.\nWhen the server cannot continue a subscription's deltas (for example\nit fell behind), it sends a new snapshot; apply it as in step 1.\n\nUpdate ids are ATLAS revisions: they increase but are not contiguous.\nA delta for an interval longer than the snapshot period can begin\nbefore the snapshot it follows; sizes are absolute, so it still\napplies. Deltas cover every price level while a snapshot holds the top\n500 per side, so a deeper level appears only after it changes.\n",
        "x-subscribeArgs": [
          "marketId"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true → data is the top-N book; replace the local book. The first frame is always a snapshot, and the server resends one when it cannot continue the deltas. false → data is a delta.\n"
            },
            "data": {
              "$ref": "#/components/schemas/OrderBookUpdate"
            }
          }
        }
      },
      "StreamOrders": {
        "name": "stream.orders",
        "x-subscribeArgs": [
          "accountAddress"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "x-authRequired": false,
        "description": "The order reports of one account in the order the Log produced them:\nits orders and fills, each numbered by the order stream's report\nnumber (`reportNo`), plus rejects of its transactions.\n\nReport frames (`order`, `fill`) carry `reportNo`, which starts at \"1\"\nand rises by one per report of this stream for the account, the report\nposition `gk`, the `logTime` of the entry, and either the `txId` of the\ntransaction whose batch produced the report or the `cause` that names\nthe system event. The ordinal of `gk` counts the reports of this stream\nin the entry; the balance and position reports the same entry produces\nare on `stream.account`.\n\nEach stream is ordered on its own. `reportNo`, `gk` and the\nsnapshot belong to this stream: the numbers of `stream.orders` and of\n`stream.account` are independent, and nothing orders a frame of one\nstream against a frame of the other. A client that holds both\nsubscriptions must not join them by `reportNo` or `gk`.\n\nOther frames:\n\n- `snapshot` (`snapshot = true`) — every open order of the account,\n  covering every report of this stream through `reportNo` and the Log\n  through `coveredThrough`.\n- `gapNotice` — the reports numbered `missing.first` through\n  `missing.last` cannot be delivered; a `snapshot` that covers them follows.\n- `heartbeat` — at least every second: every report of this stream for\n  the account through Log Height `watermark` has been delivered,\n  filtered out or covered by a snapshot, and `scannedThrough` is the\n  highest report number passed, filtered types included, so a jump in\n  `reportNo` that the filter caused is not a loss.\n- `reject` — ATLAS rejected a transaction of the account without logging it. It goes out as soon as it arrives, not ordered\n  against the reports; it takes no report number and is not resumed.\n  A reject goes only to the stream of its command, with the command's\n  `selector`: `stream.orders` for place, replace, cancel and cancel-all\n  commands, `stream.account` for every other command.\n\nA subscription with no `afterReportNo` starts with a `snapshot`. One\nthat names `afterReportNo` receives every report of this stream after\nit, once and in order, when the client was away for at most an hour and\nthe missing reports are still in the recording; otherwise a `gapNotice`\nand a `snapshot`. `types` drops whole frames of the types it leaves\nout; `snapshot`, `gapNotice` and `heartbeat` always arrive.\n\nField shapes inside the report bodies MUST be byte-identical to what\nthe matching HTTP reads return for the same resource.\n",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "accountAddress",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "True only on a `snapshot` frame."
            },
            "accountAddress": {
              "$ref": "#/components/schemas/AccountAddress"
            },
            "data": {
              "type": "object",
              "required": [
                "type"
              ],
              "description": "Discriminated payload; the `type` tag selects one frame.",
              "oneOf": [
                {
                  "title": "StreamOrdersOrder",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "order"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "order"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "order": {
                      "$ref": "#/components/schemas/Order"
                    }
                  }
                },
                {
                  "title": "StreamOrdersFill",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "gk",
                    "logTime",
                    "fill"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "fill"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "gk": {
                      "$ref": "#/components/schemas/ReportPosition"
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "cause": {
                      "$ref": "#/components/schemas/ReportCause"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "fill": {
                      "$ref": "#/components/schemas/Fill"
                    }
                  }
                },
                {
                  "title": "StreamOrdersReject",
                  "type": "object",
                  "required": [
                    "type",
                    "txId",
                    "reason",
                    "selector"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "reject"
                      ]
                    },
                    "txId": {
                      "$ref": "#/components/schemas/TxId"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "clientOrderId": {
                      "$ref": "#/components/schemas/ClientOrderId"
                    },
                    "selector": {
                      "$ref": "#/components/schemas/CommandSelector"
                    }
                  }
                },
                {
                  "title": "StreamOrdersHeartbeat",
                  "type": "object",
                  "required": [
                    "type",
                    "watermark",
                    "logTime",
                    "scannedThrough"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "heartbeat"
                      ]
                    },
                    "watermark": {
                      "$ref": "#/components/schemas/LogHeight"
                    },
                    "logTime": {
                      "$ref": "#/components/schemas/TimestampMs"
                    },
                    "scannedThrough": {
                      "$ref": "#/components/schemas/ReportNo"
                    }
                  }
                },
                {
                  "title": "StreamOrdersGapNotice",
                  "type": "object",
                  "required": [
                    "type",
                    "missing"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "gapNotice"
                      ]
                    },
                    "missing": {
                      "$ref": "#/components/schemas/ReportRange"
                    }
                  }
                },
                {
                  "title": "StreamOrdersSnapshot",
                  "type": "object",
                  "required": [
                    "type",
                    "reportNo",
                    "coveredThrough",
                    "openOrders"
                  ],
                  "additionalProperties": false,
                  "properties": {
                    "type": {
                      "type": "string",
                      "enum": [
                        "snapshot"
                      ]
                    },
                    "reportNo": {
                      "$ref": "#/components/schemas/ReportNo"
                    },
                    "coveredThrough": {
                      "$ref": "#/components/schemas/LogHeight"
                    },
                    "openOrders": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "StreamTicker": {
        "name": "stream.ticker",
        "x-subscribeArgs": [
          "marketId"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true  → first delivery after subscribe; clients should replace any cached ticker. false → subsequent deliveries. Every frame carries the full ticker, so clients may replace cached ticker state on every frame.\n"
            },
            "data": {
              "$ref": "#/components/schemas/Ticker"
            }
          }
        }
      },
      "StreamTrades": {
        "name": "stream.trades",
        "x-subscribeArgs": [
          "marketId"
        ],
        "x-originSubscribeMethod": "atlas.subscribe",
        "x-subscriptionIdLocation": "$message.payload#/subscriptionId",
        "payload": {
          "type": "object",
          "required": [
            "subscriptionId",
            "seq",
            "snapshot",
            "data"
          ],
          "additionalProperties": false,
          "properties": {
            "subscriptionId": {
              "$ref": "#/components/schemas/SubscriptionId"
            },
            "seq": {
              "$ref": "#/components/schemas/SeqString"
            },
            "snapshot": {
              "type": "boolean",
              "description": "true  → data contains the most recent trades (up to 50), newest first. The first frame after subscribe is one; a later one means trades may have been missed. Clients should replace any cached tape. false → live event; data contains one new trade.\n"
            },
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Trade"
              }
            }
          }
        }
      }
    },
    "schemas": {
      "AccountAddress": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{40}$",
        "description": "ATLAS account identifier: the account's 20-byte address as `0x` plus 40 hex characters. Responses carry lowercase hex; requests accept any case. A Wallet's first account address is its owner address. EIP-712 signs it as `address`. Not a JSON number and not a decimal string.\n"
      },
      "AccountHealth": {
        "type": "object",
        "required": [
          "equity",
          "unrealizedPnl",
          "usedMargin",
          "maintenanceMargin",
          "availableToTrade",
          "maintenanceBuffer",
          "totalEquity"
        ],
        "additionalProperties": false,
        "properties": {
          "equity": {
            "$ref": "#/components/schemas/Amount",
            "description": "Cross-margin account value: effective collateral plus the sum of **cross** positions' unrealized PnL, exactly as ATLAS evaluates it for new orders. Excludes isolated positions — see totalEquity.\n"
          },
          "unrealizedPnl": {
            "$ref": "#/components/schemas/Amount",
            "description": "Aggregate unrealized PnL across open **cross** positions only (already included in equity). Isolated positions' uPnL is per-position and rolls up only into totalEquity.\n"
          },
          "usedMargin": {
            "$ref": "#/components/schemas/Amount",
            "description": "Committed margin: initial margin for open positions plus the open-order reserve for resting orders. The locked slice of equity; availableToTrade = equity - usedMargin.\n"
          },
          "maintenanceMargin": {
            "$ref": "#/components/schemas/Amount",
            "description": "Maintenance-margin requirement for open positions (the liquidation floor; always <= usedMargin).\n"
          },
          "availableToTrade": {
            "$ref": "#/components/schemas/Amount",
            "description": "equity − usedMargin; the admission gate — risk-increasing actions require this >= 0. The slice of equity not locked as margin — deployable into new positions or withdrawable.\n"
          },
          "maintenanceBuffer": {
            "$ref": "#/components/schemas/Amount",
            "description": "ATLAS's authoritative distance to liquidation; the account is liquidatable exactly when this is <= 0. Computed by ATLAS from its maintenance-mode collateral valuation; NOT derivable from the other fields, and NOT guaranteed to equal equity − maintenanceMargin.\n"
          },
          "totalEquity": {
            "$ref": "#/components/schemas/Amount",
            "description": "Net worth: equity plus every isolated position's equity (isolated margin + its unrealized PnL), from the same account snapshot. Display-only aggregate — never spendable balance; isolated margin cannot back cross orders.\n"
          }
        }
      },
      "AccountLimits": {
        "type": "object",
        "required": [
          "maxIsolatedUnits",
          "maxOpenOrders"
        ],
        "additionalProperties": false,
        "description": "The limits a new order of the account is checked against: the protocol's ceilings, the same for every account. No limit applies per market.\n",
        "properties": {
          "maxIsolatedUnits": {
            "type": "integer",
            "minimum": 0,
            "description": "Most isolated units the account may hold at once. The account has at most one unit per market: its first isolated order on a market opens the unit, whether the order rests or fills, and the unit closes once its position is flat and it has no resting orders. The units held are the distinct markets of the account's isolated positions and isolated open orders. An order that would open one more is refused.\n"
          },
          "maxOpenOrders": {
            "type": "integer",
            "minimum": 0,
            "description": "Most resting orders the account may have across all markets, as `atlas.getOpenOrders` lists them. An order that would rest past it is refused.\n"
          }
        }
      },
      "AccountReport": {
        "type": "object",
        "required": [
          "request",
          "timestampMs",
          "body"
        ],
        "additionalProperties": false,
        "properties": {
          "request": {
            "$ref": "#/components/schemas/RequestRefV1",
            "description": "The request whose input made the change. For a native request `txHash` is its stable request ID.\n"
          },
          "timestampMs": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Venue time of the input that made the change."
          },
          "body": {
            "$ref": "#/components/schemas/AccountReportBody"
          }
        }
      },
      "AccountReportAgentGrantRemoved": {
        "type": "object",
        "required": [
          "kind",
          "agent"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agentGrantRemoved"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/EvmAddress"
          }
        }
      },
      "AccountReportAgentGrantSet": {
        "type": "object",
        "required": [
          "kind",
          "agent"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "agentGrantSet"
            ]
          },
          "agent": {
            "$ref": "#/components/schemas/EvmAddress"
          }
        }
      },
      "AccountReportBody": {
        "description": "The change, selected by `kind`. Amounts are ledger amounts at the venue's 12-decimal scale.\n",
        "oneOf": [
          {
            "$ref": "#/components/schemas/AccountReportDeposit"
          },
          {
            "$ref": "#/components/schemas/AccountReportWithdraw"
          },
          {
            "$ref": "#/components/schemas/AccountReportTransfer"
          },
          {
            "$ref": "#/components/schemas/AccountReportOwnerKeyRotated"
          },
          {
            "$ref": "#/components/schemas/AccountReportAgentGrantRemoved"
          },
          {
            "$ref": "#/components/schemas/AccountReportAgentGrantSet"
          }
        ]
      },
      "AccountReportDeposit": {
        "type": "object",
        "required": [
          "kind",
          "wallet",
          "assetId",
          "amount",
          "fee",
          "balanceAfter"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "deposit"
            ]
          },
          "wallet": {
            "$ref": "#/components/schemas/AccountAddress"
          },
          "assetId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "description": "u32 asset identifier."
          },
          "amount": {
            "$ref": "#/components/schemas/PositiveDecimalString"
          },
          "fee": {
            "$ref": "#/components/schemas/PositiveDecimalString"
          },
          "balanceAfter": {
            "$ref": "#/components/schemas/DecimalString"
          }
        }
      },
      "AccountReportOwnerKeyRotated": {
        "type": "object",
        "required": [
          "kind",
          "newOwnerKey"
        ],
        "additionalProperties": false,
        "description": "Addressed to the wallet whose owner key changed. `newOwnerKey` is null when the rotation leaves the wallet with no owner key.\n",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "ownerKeyRotated"
            ]
          },
          "newOwnerKey": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/OwnerKey"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AccountReportTransfer": {
        "type": "object",
        "required": [
          "kind",
          "assetId",
          "amount",
          "counterparty",
          "balanceAfter",
          "memo"
        ],
        "additionalProperties": false,
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "transfer"
            ]
          },
          "assetId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "description": "u32 asset identifier."
          },
          "amount": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Negative for the sender, positive for the receiver."
          },
          "counterparty": {
            "$ref": "#/components/schemas/AccountAddress"
          },
          "balanceAfter": {
            "$ref": "#/components/schemas/DecimalString"
          },
          "memo": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{128}$",
            "description": "The 64 signed memo bytes, unchanged. All zero means no memo."
          }
        }
      },
      "AccountReportWithdraw": {
        "type": "object",
        "required": [
          "kind",
          "assetId",
          "amount",
          "fee",
          "balanceAfter",
          "zone",
          "recipient",
          "memo"
        ],
        "additionalProperties": false,
        "description": "Value sent to another zone.",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "withdraw"
            ]
          },
          "assetId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "description": "u32 asset identifier."
          },
          "amount": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "The debit, the whole amount the zone receives."
          },
          "fee": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "Always zero, since a withdrawal charges no fee; the field keeps the shape a FIX reader expects."
          },
          "balanceAfter": {
            "$ref": "#/components/schemas/DecimalString"
          },
          "zone": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "description": "The destination zone."
          },
          "recipient": {
            "type": "string",
            "pattern": "^0x([0-9a-f]{2}){1,255}$",
            "description": "The recipient in the receiving zone's own encoding, 0x-hex."
          },
          "memo": {
            "type": "string",
            "pattern": "^0x([0-9a-f]{2}){0,255}$",
            "description": "The withdrawal memo, 0x-hex."
          }
        }
      },
      "AccountState": {
        "type": "object",
        "required": [
          "staked",
          "cross",
          "isolated",
          "walletState",
          "asOf",
          "stpLevel",
          "terms"
        ],
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Venue time of the account snapshot every figure here comes from."
          },
          "staked": {
            "type": "array",
            "description": "The account's staked balance: one row for each asset in which it holds a staking position or a pending unstake, in ascending `asset`. Empty when it stakes nothing.\n",
            "items": {
              "$ref": "#/components/schemas/Balance"
            }
          },
          "cross": {
            "$ref": "#/components/schemas/CrossUnit"
          },
          "isolated": {
            "type": "array",
            "description": "The account's isolated units, one per market it holds in isolated margin, in ascending market id. Empty when it has none.\n",
            "items": {
              "$ref": "#/components/schemas/IsolatedUnit"
            }
          },
          "terms": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TermsVersion"
              },
              {
                "type": "null"
              }
            ],
            "description": "The latest Atlas Terms of Use version accepted by this account's wallet, through enableTrading or enableBuilder. A Sub account returns its Main account's acceptance. Null means the acceptance read succeeded and found no acceptance. A failed read returns service unavailable (-20003), never null. Compare id, version and contentHash with atlas.getTerms to decide whether to ask for a signature. Read at request time, independently of the account snapshot's asOf.\n"
          },
          "walletState": {
            "$ref": "#/components/schemas/WalletState"
          },
          "deadManTimeoutSeconds": {
            "type": "integer",
            "minimum": 5,
            "maximum": 86400,
            "description": "The dead-man timeout the last `cancelAllOrdersAfter` set. Present while the account's dead-man clock is on; absent when it is off, whether never set, set to 0, or ended by its expiry.\n"
          },
          "deadManDeadlineNs": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "When the dead-man clock expires and cancels the account's working orders, Unix nanoseconds: the `deadlineNs` the last `cancelAllOrdersAfter` returned. Present exactly when `deadManTimeoutSeconds` is. Read it after reconnecting to decide whether to post again before it passes.\n"
          },
          "walletAddress": {
            "$ref": "#/components/schemas/AccountAddress",
            "description": "The wallet that holds this account. Absent for an address that holds no account, which shows only its unclaimed balances.\n"
          },
          "limits": {
            "$ref": "#/components/schemas/AccountLimits"
          },
          "stpLevel": {
            "$ref": "#/components/schemas/StpLevel",
            "description": "The self-trade prevention level of this account's wallet, set by `setStpLevel`. A wallet that never set it reads `account`.\n"
          },
          "health": {
            "$ref": "#/components/schemas/AccountHealth",
            "description": "Not returned yet; reserved for a later release. Compute unrealised PnL from the live ticker mark meanwhile."
          }
        }
      },
      "AdvancedOrder": {
        "type": "object",
        "required": [
          "parentOrderId",
          "accountAddress",
          "clOrdId",
          "marketId",
          "marginMode",
          "parentVersion",
          "strategy"
        ],
        "additionalProperties": false,
        "description": "One parent: what every strategy shares, and the one strategy it runs in `strategy`, named by `strategy.type`. Its current state, not the receipt of any one request. A client keeps a parent whose `strategy.type` it does not know, with its common fields, rather than failing the read.\n",
        "properties": {
          "parentOrderId": {
            "$ref": "#/components/schemas/Uint64String"
          },
          "accountAddress": {
            "$ref": "#/components/schemas/AccountAddress"
          },
          "clOrdId": {
            "$ref": "#/components/schemas/ClientOrderId",
            "description": "The create request's `clOrdId`; an update or cancel never replaces it."
          },
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8589934591
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ]
          },
          "parentVersion": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "Counts this parent's reports. Not a command's `version` nor a read's `projectedVersion`, and never a `minVersion`.\n"
          },
          "strategy": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AdvancedOrderTpSl"
              },
              {
                "$ref": "#/components/schemas/AdvancedOrderTwap"
              }
            ]
          }
        }
      },
      "AdvancedOrderEntry": {
        "type": "object",
        "required": [
          "clOrdId",
          "plan",
          "state",
          "hasFills"
        ],
        "additionalProperties": false,
        "properties": {
          "clOrdId": {
            "$ref": "#/components/schemas/ClientOrderId",
            "description": "The client id ATLAS gave the entry order."
          },
          "plan": {
            "$ref": "#/components/schemas/EntryPlan"
          },
          "state": {
            "type": "string",
            "enum": [
              "offered",
              "working",
              "done"
            ],
            "description": "Sent and not yet answered, working on ATLAS, or no longer working."
          },
          "hasFills": {
            "type": "boolean",
            "description": "Whether a fill of the entry was seen; not a size, and not that it filled whole."
          }
        }
      },
      "AdvancedOrderSlot": {
        "type": "object",
        "required": [
          "plan",
          "state",
          "childHasFills",
          "childLogged",
          "childCancelState"
        ],
        "additionalProperties": false,
        "description": "A side's plan and its own state; cancelling or firing one side leaves the other as it is.",
        "properties": {
          "plan": {
            "$ref": "#/components/schemas/SlotPlan"
          },
          "state": {
            "$ref": "#/components/schemas/SlotState"
          },
          "childHasFills": {
            "type": "boolean",
            "description": "Whether a fill of this side's close order was seen; not that it filled whole."
          },
          "childLogged": {
            "type": "boolean",
            "description": "Whether this side's close order was submitted to ATLAS."
          },
          "childCancelState": {
            "type": "string",
            "enum": [
              "notRequested",
              "deciding",
              "requested",
              "notNeeded",
              "done"
            ],
            "description": "Where cancelling the close order stands, which only cancelling the parent asks for: not asked for, decided, its cancel submitted to ATLAS, not needed because the order stopped first, or done.\n"
          }
        }
      },
      "AdvancedOrderStreamPayload": {
        "type": "object",
        "required": [
          "subscriptionId",
          "seq",
          "snapshot",
          "accountAddress",
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "subscriptionId": {
            "$ref": "#/components/schemas/SubscriptionId"
          },
          "seq": {
            "$ref": "#/components/schemas/SeqString"
          },
          "snapshot": {
            "type": "boolean",
            "description": "true on the first event after subscribe, which carries every open parent; false on every later event, which carries one changed parent.\n"
          },
          "accountAddress": {
            "$ref": "#/components/schemas/AccountAddress"
          },
          "data": {
            "type": "object",
            "required": [
              "type"
            ],
            "description": "Discriminated payload, coupled with `snapshot`: a snapshot (`snapshot = true`) carries `type = \"advancedOrders\"` with every open parent in `advancedOrders`; an update (`snapshot = false`) carries `type = \"advancedOrder\"` with one complete parent in `advancedOrder`.\n",
            "oneOf": [
              {
                "title": "StreamAdvancedOrdersSnapshot",
                "type": "object",
                "required": [
                  "type",
                  "advancedOrders"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "advancedOrders"
                    ]
                  },
                  "advancedOrders": {
                    "type": "array",
                    "description": "Every open parent of the subscribed strategies.",
                    "items": {
                      "$ref": "#/components/schemas/AdvancedOrder"
                    }
                  }
                }
              },
              {
                "title": "StreamAdvancedOrdersUpdate",
                "type": "object",
                "required": [
                  "type",
                  "advancedOrder"
                ],
                "additionalProperties": false,
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "advancedOrder"
                    ]
                  },
                  "advancedOrder": {
                    "$ref": "#/components/schemas/AdvancedOrder"
                  }
                }
              }
            ]
          }
        },
        "oneOf": [
          {
            "title": "StreamAdvancedOrdersSnapshotEvent",
            "required": [
              "snapshot",
              "data"
            ],
            "properties": {
              "snapshot": {
                "type": "boolean",
                "enum": [
                  true
                ]
              },
              "data": {
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "advancedOrders"
                    ]
                  }
                }
              }
            }
          },
          {
            "title": "StreamAdvancedOrdersUpdateEvent",
            "required": [
              "snapshot",
              "data"
            ],
            "properties": {
              "snapshot": {
                "type": "boolean",
                "enum": [
                  false
                ]
              },
              "data": {
                "required": [
                  "type"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "advancedOrder"
                    ]
                  }
                }
              }
            }
          }
        ]
      },
      "AdvancedOrderTpSl": {
        "type": "object",
        "required": [
          "type",
          "status",
          "endReason",
          "protects",
          "entry",
          "takeProfit",
          "stopLoss"
        ],
        "additionalProperties": false,
        "description": "A `tpSl` parent: at most one take-profit side and one stop-loss side; an entry's fills join the position and never hold the market on their own.\n",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "tpSl"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TpSlStatus"
          },
          "endReason": {
            "description": "Why it was cancelled; null unless `status` is `cancelled`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EndReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "protects": {
            "description": "The side of the position the parent protects; null until it arms.",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "long",
                  "short"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "entry": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AdvancedOrderEntry"
              },
              {
                "type": "null"
              }
            ]
          },
          "takeProfit": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AdvancedOrderSlot"
              },
              {
                "type": "null"
              }
            ]
          },
          "stopLoss": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AdvancedOrderSlot"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AdvancedOrderTwap": {
        "type": "object",
        "required": [
          "type",
          "status",
          "endReason",
          "side",
          "baseQty",
          "durationSeconds",
          "reduceOnly",
          "startedAtMs",
          "deadlineMs",
          "opportunities",
          "filledQty",
          "remainingQty",
          "averagePrice",
          "skip"
        ],
        "additionalProperties": false,
        "description": "A `twap` parent's terms and progress, shown only to the account's authenticated reads. Its children are ordinary Market + IOC orders.\n",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "twap"
            ]
          },
          "status": {
            "$ref": "#/components/schemas/TwapStatus"
          },
          "endReason": {
            "description": "Why it stopped; null unless `status` is `stopped`.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/EndReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "baseQty": {
            "$ref": "#/components/schemas/PositiveDecimalString"
          },
          "durationSeconds": {
            "type": "integer",
            "minimum": 300,
            "maximum": 604800
          },
          "reduceOnly": {
            "type": "boolean"
          },
          "startedAtMs": {
            "type": "integer",
            "minimum": 0,
            "description": "When ATLAS accepted it, in cluster milliseconds; the first child is due then."
          },
          "deadlineMs": {
            "type": "integer",
            "minimum": 0,
            "description": "After this, in cluster milliseconds, it sends nothing new."
          },
          "opportunities": {
            "type": "integer",
            "minimum": 1,
            "description": "How many scheduled opportunities its plan has."
          },
          "filledQty": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Confirmed fills of its children, including a late fill after it ended."
          },
          "remainingQty": {
            "$ref": "#/components/schemas/DecimalString"
          },
          "averagePrice": {
            "description": "The volume-weighted average price of its fills; null before the first.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/PositiveDecimalString"
              },
              {
                "type": "null"
              }
            ]
          },
          "skip": {
            "description": "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) or `noPrice` (no mark to bind to).\n",
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "belowFloor",
                  "noPrice"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AdvancedOrderType": {
        "type": "string",
        "enum": [
          "limit",
          "market"
        ],
        "description": "Signs as `uint8` limit 0, market 1."
      },
      "AdvancedTimeInForce": {
        "type": "string",
        "enum": [
          "gtc",
          "ioc"
        ],
        "description": "Signs as `uint8` ioc 0, gtc 1."
      },
      "Amount": {
        "type": "string",
        "pattern": "^-?[0-9]+(\\.[0-9]+)?$",
        "description": "Decimal number as a string; parse with a decimal library, never as a float."
      },
      "BBO": {
        "type": "object",
        "description": "Best bid and offer snapshot for a symbol, emitted whenever the top-of-book changes. Prices and sizes are decimal strings. `T` is the order book snapshot timestamp in Unix milliseconds (JSON number). Field names are single letters.\n",
        "required": [
          "marketId",
          "s",
          "b",
          "B",
          "a",
          "A",
          "T"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "s": {
            "$ref": "#/components/schemas/Symbol",
            "description": "Market symbol."
          },
          "b": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Best bid price in the order book."
          },
          "B": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Quantity available at the best bid price."
          },
          "a": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Best ask price in the order book."
          },
          "A": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Quantity available at the best ask price."
          },
          "T": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Order book snapshot timestamp, Unix milliseconds."
          }
        }
      },
      "Balance": {
        "type": "object",
        "required": [
          "place",
          "asset",
          "assetId",
          "total",
          "available",
          "held"
        ],
        "additionalProperties": false,
        "properties": {
          "place": {
            "type": "string",
            "enum": [
              "staked",
              "cross",
              "isolated"
            ],
            "description": "Where the account holds this cash: `staked` in its staking position and pending unstake of the asset, locked and never collateral; `cross` in the cross unit; `isolated` in the isolated unit of the market `symbol` names.\n"
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol",
            "description": "On an `isolated` balance, the market of the isolated unit holding this cash. Absent on a `staked` or `cross` balance.\n"
          },
          "asset": {
            "type": "string",
            "minLength": 1,
            "description": "Asset symbol (e.g. USDT, BTC), the same string as `AssetInfo.symbol`."
          },
          "assetId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4294967295,
            "description": "Asset id of `asset`."
          },
          "total": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Ledger balance, exact to 12 decimal places whatever the asset's own decimals (a fee can leave digits finer than the asset's minor unit).\n"
          },
          "available": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "`total` less `held`, exact to 12 decimal places. On a `staked` balance, the staking position an unstake may take.\n"
          },
          "held": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "What is set aside in this asset: the reserve of resting spot orders plus cash held for pending withdrawals; on a `staked` balance, the pending unstake, which no unstake can take again. `total` − `available`, exact to 12 decimal places. Margin that perp positions and orders use is not held per asset.\n"
          },
          "unstakeDueNs": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "On a `staked` balance with a pending unstake: when the pending unstake returns whole to the cross unit, Unix nanoseconds. Absent otherwise.\n"
          }
        }
      },
      "BuilderId": {
        "type": "string",
        "pattern": "^0x[0-9a-f]{40}$",
        "description": "Builder (Broker) ID: an opaque 20-byte value issued once, by the first `enableBuilder` of the builder's Main, and kept for every later acceptance. It cannot be derived from the Main or any other account. A `0x`-prefixed, 40-lowercase-hex-char string. It is not the builder's account address. EIP-712 signs it as `address`.\n"
      },
      "Candle": {
        "type": "object",
        "required": [
          "marketId",
          "t",
          "T",
          "s",
          "i",
          "o",
          "h",
          "l",
          "c",
          "v",
          "n",
          "x"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "t": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Open time of the candle, Unix milliseconds."
          },
          "T": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Close time of the candle, Unix milliseconds. The next candle's `t` equals this candle's `T`.\n"
          },
          "s": {
            "$ref": "#/components/schemas/Symbol"
          },
          "i": {
            "$ref": "#/components/schemas/Interval"
          },
          "o": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Open price."
          },
          "h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "High price."
          },
          "l": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Low price."
          },
          "c": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Close price."
          },
          "v": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Total base-asset volume traded in this interval."
          },
          "n": {
            "type": "integer",
            "minimum": 0,
            "description": "Number of individual trades that composed this candle (u32)."
          },
          "x": {
            "type": "boolean",
            "description": "True when this publication finalizes the candle window; false for an interim update. A late trade can reopen a previously finalized window, producing x=false before the corrected candle is finalized again with x=true.\n"
          }
        }
      },
      "ClientOrderId": {
        "type": "string",
        "pattern": "^0x[0-9a-f]{32}$",
        "description": "Mandatory client-chosen 128-bit order identity, named after the FIX `ClOrdID` (tag 11) / `OrigClOrdID` (tag 41) tags. A `0x`-prefixed, 32-lowercase-hex-char string (`bytes16`). On a `placeOrder` command, `clientOrderId` is placement identity A. On a `cancelOrder`, `cancelAllOrders` or `replaceOrder` command, `clientOrderId` is the request's own identity, and a `target` names the order by `orderId` or by its `clientOrderId`. Only lowercase hex is accepted; uppercase is rejected as invalid params (`-32602`).\n"
      },
      "CommandSelector": {
        "type": "string",
        "pattern": "^0x[0-9a-f]{4}$",
        "description": "A command's 2-byte selector as `0x` and four lowercase hex digits, the form its signed bytes begin with.\n"
      },
      "CrossUnit": {
        "type": "object",
        "required": [
          "balances",
          "positions"
        ],
        "additionalProperties": false,
        "description": "The account's cross unit, shared by every cross position. Its balances are `place` `cross`; its positions and orders are `marginMode` `cross`.\n",
        "properties": {
          "balances": {
            "type": "array",
            "description": "Cash in every asset, rows as `atlas.getBalances` returns them. For an address that holds no account, what deposits and transfers left there unclaimed: its first account takes it whole as its cross cash.\n",
            "items": {
              "$ref": "#/components/schemas/Balance"
            }
          },
          "positions": {
            "type": "array",
            "description": "Cross positions in any number of markets, rows as `atlas.getPositions` returns them.",
            "items": {
              "$ref": "#/components/schemas/Position"
            }
          }
        }
      },
      "DecimalString": {
        "type": "string",
        "pattern": "^-?[0-9]+(\\.[0-9]+)?$",
        "description": "Decimal number as a string; parse with a decimal library, never as a float."
      },
      "EndReason": {
        "type": "string",
        "enum": [
          "client",
          "invalid",
          "liquidated",
          "expired",
          "reduceOnlyTrim",
          "forceClose",
          "childRejected",
          "omsKeyRevoked",
          "marketClosed",
          "positionFlat"
        ],
        "description": "Why a strategy or one of its sides was cancelled or stopped; one\nvocabulary for every strategy, each using its own subset.\n\n- `client`: the user cancelled it, or its close order was cancelled by\n  the user, Cancel All or Dead-man.\n- `invalid`: no longer valid (the position went flat or flipped before a\n  fire, ATLAS refused the close order or cancelled it for no reason below,\n  or the entry ended with no fill).\n- `liquidated`: the position was liquidated.\n- `expired`: the close order's time in force ended it before it filled in\n  full.\n- `reduceOnlyTrim`: ATLAS trimmed the close order away to fit what the\n  position can still close.\n- `forceClose`: ATLAS force-closed the position.\n- `childRejected`: ATLAS definitively refused a TWAP child.\n- `omsKeyRevoked`: the account's ATLAS key was unbound.\n- `marketClosed`: the market closed for good.\n- `positionFlat`: a reduce-only TWAP's position went flat.\n"
      },
      "EntryPlan": {
        "type": "object",
        "required": [
          "side",
          "baseQty",
          "orderType",
          "timeInForce"
        ],
        "additionalProperties": false,
        "description": "The entry order ATLAS places for a parent created with one; its sides wait `pending` until the entry's first fill. The typed encoding signs it as the struct `EntryPlan`.\n",
        "properties": {
          "side": {
            "$ref": "#/components/schemas/Side",
            "description": "Signs as `uint8` buy 0, sell 1."
          },
          "baseQty": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "Signs as `int64 quantity`, the `Qty` mantissa (scale 8)."
          },
          "orderType": {
            "$ref": "#/components/schemas/AdvancedOrderType"
          },
          "limitPrice": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "Required on `limit` and absent on `market`. Signs as `hasPrice` and `int64 price`."
          },
          "timeInForce": {
            "$ref": "#/components/schemas/AdvancedTimeInForce"
          }
        }
      },
      "ErrorCode": {
        "type": "integer",
        "description": "Stable error code. Protocol rejections use their protocol numbers. Service errors use service-owned ranges; shared errors use the common range. JSON-RPC standard codes retain their protocol meanings.\n"
      },
      "EvmAddress": {
        "type": "string",
        "pattern": "^0x[0-9a-fA-F]{40}$",
        "description": "20-byte EVM address, `0x`-prefixed hex. An ATLAS Wallet is authorised by an address, not by a public key: the bridge relay observes the address a deposit came from, and the Main account address follows from it.\n"
      },
      "Fill": {
        "type": "object",
        "required": [
          "tradeId",
          "accountAddress",
          "marketId",
          "side",
          "price",
          "size",
          "fee",
          "timestamp"
        ],
        "additionalProperties": false,
        "properties": {
          "tradeId": {
            "$ref": "#/components/schemas/TradeId",
            "description": "The trade's id, shared by its maker and taker fills. On a `kind` row, the `liquidationId` or `adlId` instead: the `causeId` of the `atlas.getLedger` rows of the same cause. The rows of one vault assignment, one per market, share it.\n"
          },
          "accountAddress": {
            "$ref": "#/components/schemas/AccountAddress",
            "description": "The account this fill side belongs to: the maker's on a maker fill, the taker's on a taker fill.\n"
          },
          "orderId": {
            "type": "string",
            "pattern": "^[0-9]+:[0-9]+$",
            "description": "Opaque composite identifier of the order that this fill belongs\nto. Always `\"{marketId}:{seq}\"` — the same format for maker fills\n(resting order seq) and taker fills (engine-assigned taker seq).\nUse `liquidity` to distinguish maker\nfrom taker fills rather than parsing the id string. Absent on a\n`kind` row, which has no order.\n"
          },
          "clOrdId": {
            "$ref": "#/components/schemas/ClientOrderId",
            "description": "Client-assigned identity of the order at execution. Maker fills use the resting maker order's current identity; taker fills use the accepted taker request's identity. Omitted when the order has no client-assigned identity.\n"
          },
          "marketId": {
            "description": "Market id the fill belongs to; `atlas.getSymbols` gives its name.\n",
            "type": "integer",
            "minimum": 1
          },
          "seq": {
            "type": "integer",
            "minimum": 0,
            "description": "Order seq, allocated by one counter across every market, as a JSON\nnumber: the resting order's seq on a\nmaker fill and the taker's own order seq on a taker fill. Absent on a\n`kind` row.\n",
            "maximum": 9007199254740991
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "price": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "The trade price. On a `kind` row, the price the position moved at: the market's mark for a vault assignment, the ADL price for ADL.\n"
          },
          "size": {
            "$ref": "#/components/schemas/DecimalString"
          },
          "fee": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Computed fill fee, exact to 12 decimal places as booked (it is not\nrounded to the fee asset's decimals). On every market, spot and perp,\nthe fee is denominated in the market's quote (settlement) asset,\n`quoteAsset` in `atlas.getSymbols`, on buys and sells alike, never in\nthe asset received, and is booked to the wallet on the fill. A\nnegative maker rate gives a negative fee (rebate) in the same asset.\nOn a `kind` row, the fee that cause charged on this market, \"0\" when\nit charged none.\n"
          },
          "liquidity": {
            "$ref": "#/components/schemas/Liquidity",
            "description": "Absent on a `kind` row."
          },
          "timestamp": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Match time of the fill, or the booking time of a `kind` row.\n"
          },
          "kind": {
            "type": "string",
            "enum": [
              "vault_assignment",
              "adl"
            ],
            "description": "Set on a row that closes or reduces a position without an order: `vault_assignment` when the backstop vault takes the account's positions, one row per market, and `adl` when auto-deleveraging reduces it. Absent on an order-book fill. Cash the cause moved beyond this row's `realizedPnl` and `fee`, such as collateral taken by the vault, is in `atlas.getLedger` under the same cause id.\n"
          },
          "signerRole": {
            "type": "string",
            "enum": [
              "owner",
              "agent"
            ],
            "description": "Who authorized the order behind this fill: `owner` (the account's\nown key) or `agent` (a delegated agent key). Attribution is per\nfill side — a maker fill carries the resting order's signer, a\ntaker fill the taker's. Absent when no key signed the order, such as\nan order ATLAS places to liquidate, and on a `kind` row. An order ATLAS placed for a TP/SL parent is\nsigned by the ATLAS key bound to the account, so it is `agent`; use\n`origin` to tell it apart.\n"
          },
          "agentPubkeyX": {
            "type": "string",
            "description": "Delegated agent public-key x-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.\n"
          },
          "agentPubkeyY": {
            "type": "string",
            "description": "Delegated agent public-key y-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.\n"
          },
          "builderId": {
            "$ref": "#/components/schemas/BuilderId",
            "description": "The builder this fill's Builder Fee is attributed to. Absent when the order charges none."
          },
          "builderFee": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Builder Fee charged on this fill, in the same asset as `fee`, booked to the Builder Fee pile.\n"
          },
          "liquidation": {
            "type": "boolean",
            "description": "True when the fill is a liquidation clip. Absent or false otherwise."
          },
          "realizedPnl": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Realized PnL this fill booked on the position, in the market's quote (settlement) asset: the price gain or loss of the part that reduced or closed the position, measured against its average entry cost. \"0\" when the fill only opens or adds. Excludes `fee`. Absent on spot fills.\n"
          },
          "direction": {
            "type": "string",
            "enum": [
              "open_long",
              "open_short",
              "close_long",
              "close_short",
              "long_to_short",
              "short_to_long"
            ],
            "description": "What this fill did to the position it booked into: opened or added to it, reduced or closed it, or flipped it through zero to the other side. Absent on spot fills.\n"
          },
          "startPosition": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Signed size of the position this fill booked into, before the fill: positive long, negative short, \"0\" when flat. Absent on spot fills.\n"
          },
          "txId": {
            "$ref": "#/components/schemas/TxId",
            "description": "Digest of the signed transaction whose processing produced this fill, the same on the maker and taker fills of one trade. Absent when no client-signed transaction produced it, as for a liquidation or an ATLAS-placed child order.\n"
          },
          "parentOrderId": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "The TP/SL parent of the order behind this fill side, as on `Order.parentOrderId`. Absent when ATLAS did not place that order for a parent.\n"
          },
          "origin": {
            "type": "string",
            "enum": [
              "entry",
              "take_profit",
              "stop_loss"
            ]
          }
        }
      },
      "FundingPayment": {
        "type": "object",
        "description": "One FUNDING cash leg lazy settlement booked for the account. Its coordinates are the booking input's, never the session boundary that fixed the charge: a settlement books a closed session on a later input.\n",
        "required": [
          "accountAddress",
          "marketId",
          "symbol",
          "sessionId",
          "marginMode",
          "settlementHeight",
          "settlementTsMs",
          "positionQuantity",
          "fundingRate",
          "markPrice",
          "payment"
        ],
        "additionalProperties": false,
        "properties": {
          "accountAddress": {
            "$ref": "#/components/schemas/AccountAddress"
          },
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8589934591,
            "description": "Market kind tag above the 32-bit identifier (spot 0, perpetual 1)."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol"
          },
          "sessionId": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "Closed session counter whose charge was booked."
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "`isolated` when the charged holding is in the market's isolated unit; `cross` when it is in the cross unit.\n"
          },
          "settlementHeight": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Block height of the input that booked the payment. A payment with no booking height makes the read unavailable.\n"
          },
          "settlementTsMs": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Venue time of the input that booked the payment."
          },
          "positionQuantity": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Signed size of the holding the session charged, in display units: positive long, negative short. The quantity held at the session boundary.\n"
          },
          "fundingRate": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "The session's cutoff funding rate as a signed decimal fraction, e.g. \"0.0001\" is 1 bps. Positive = longs pay shorts; negative = shorts pay longs.\n"
          },
          "markPrice": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "The cut-off mark the session charged at, in display units."
          },
          "payment": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Funding the account received (positive) or paid (negative) at this settlement, in the market's quote (settlement) asset, `quoteAsset` in `atlas.getSymbols`.\n"
          }
        }
      },
      "Interval": {
        "type": "string",
        "enum": [
          "1m",
          "5m",
          "15m",
          "1h",
          "4h",
          "1d"
        ],
        "description": "Candle / kline resolution. ATLAS uses a human-readable suffixed format: numeric value + unit (m=minute, h=hour, d=day). TradingView UDF mapping: \"1\"→1m, \"5\"→5m, \"15\"→15m, \"60\"→1h, \"240\"→4h, \"1D\"→1d. Other resolutions are not offered.\n"
      },
      "IsolatedUnit": {
        "type": "object",
        "required": [
          "marketId",
          "symbol",
          "balance"
        ],
        "additionalProperties": false,
        "description": "One isolated unit: one market's isolated margin. Its cash backs only its own position, and its equity is not collateral for the cross unit. It opens with the account's first isolated order on the market and closes once its position is flat and it has no resting orders.\n",
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8589934591,
            "description": "Market kind tag above the 32-bit identifier (spot 0, perpetual 1)."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol",
            "description": "The unit's market."
          },
          "balance": {
            "$ref": "#/components/schemas/Balance",
            "description": "The unit's cash, in the market's settlement asset; its `total` is the unit's funded margin.\n"
          },
          "position": {
            "$ref": "#/components/schemas/Position",
            "description": "The unit's position; its `size` is 0 until its opening order fills."
          }
        }
      },
      "Liquidity": {
        "type": "string",
        "enum": [
          "maker",
          "taker"
        ],
        "description": "Whether the fill added liquidity (maker, resting order) or removed it (taker, aggressive order).\n"
      },
      "LogHeight": {
        "$ref": "#/components/schemas/Uint64String",
        "description": "The Log Height of an accepted Log entry, as a decimal string."
      },
      "MarkPrice": {
        "type": "object",
        "description": "Committed mark state for a perpetual market, restated periodically for late readers. Spot marks are available through tickers, not this stream.\n`indexPrice` is the last index carried by an applied live mark for this market, in display units. A live mark without an index preserves the previous index.\nPrices and `fundingRate` are decimal strings; both times are `TimestampMs`.\n",
        "required": [
          "marketId",
          "symbol",
          "markPrice",
          "indexPrice",
          "timestamp"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol"
          },
          "markPrice": {
            "$ref": "#/components/schemas/Price",
            "description": "Mark price in display units (decimal string)."
          },
          "indexPrice": {
            "description": "Latest index price in display units (decimal string), or null when no index price has been received for this market.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/Price"
              },
              {
                "type": "null"
              }
            ]
          },
          "fundingRate": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Current periodic funding rate: the average over one settlement session of the clamped, weighted impact premium of the book against the live index, plus a carry leg, capped. A signed decimal fraction at full precision, e.g. \"0.0001\" is 1 bps. Positive = longs pay shorts; negative = shorts pay longs. Omitted until ATLAS has a funding offer; a committed zero is \"0\".\n"
          },
          "nextFundingTime": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Due time of ATLAS's committed next session checkpoint. It remains overdue until the checkpoint runs. Omitted when no checkpoint is queued.\n"
          },
          "timestamp": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Committed input time of this state; periodic restatements preserve it."
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "accountAddress",
          "marketId",
          "side",
          "type",
          "price",
          "size",
          "reduceOnly",
          "status",
          "filledSize",
          "remainingSize",
          "trimmedSize",
          "avgFillPrice",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "properties": {
          "orderId": {
            "type": "string",
            "pattern": "^[0-9]+:[0-9]+$",
            "description": "Venue order id, `\"{marketId}:{seq}\"`. Treat it as opaque; read `marketId` and `seq` from the sibling fields when you need them. Absent on a `rejected` placement, which was never given a venue id."
          },
          "historyId": {
            "type": "string",
            "description": "Stable record identity present on every history row, including refusals without an order: `history:<stream epoch>:<log position>:<ordinal>`.\n"
          },
          "accountAddress": {
            "$ref": "#/components/schemas/AccountAddress",
            "description": "The account the order belongs to."
          },
          "clOrdId": {
            "$ref": "#/components/schemas/ClientOrderId",
            "description": "Current client-assigned identity of the order. Present for client-originated orders and updated after a successful replace.\n"
          },
          "txId": {
            "$ref": "#/components/schemas/TxId",
            "description": "Digest of the signed transaction that placed this order, the same `txId` its `atlas.sendRawTransaction` result or error carries. Absent when no client-signed transaction placed it, as for an ATLAS-placed child order. A client order ATLAS refused has no `orderId`, so its `txId` identifies it.\n"
          },
          "marketId": {
            "description": "Market id from the original request, including refused attempts; `atlas.getSymbols` gives its name. A refused attempt may name a market that is not listed, which has no name to show but this id.\n",
            "type": "integer",
            "minimum": 0
          },
          "seq": {
            "type": "integer",
            "minimum": 0,
            "description": "Order seq as a JSON number, the seq part of `orderId`. One counter\nallocates it across every market, so it alone identifies the order.\nPresent on resting orders (resting order seq) and terminal\npure-taker order rows (taker's own order seq); absent on a\n`rejected` order, as `orderId` is.\n",
            "maximum": 9007199254740991
          },
          "side": {
            "$ref": "#/components/schemas/Side"
          },
          "type": {
            "$ref": "#/components/schemas/OrderType",
            "description": "The order type the account placed."
          },
          "price": {
            "description": "In history, market and terminal pure-taker orders expose the actual fill VWAP. Null when a market order has no fills. Limit orders otherwise retain their limit price, including the submitted signed price on refusals.\n",
            "oneOf": [
              {
                "$ref": "#/components/schemas/DecimalString"
              },
              {
                "type": "null"
              }
            ]
          },
          "size": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Original requested size. Amendments and reduce-only trims do not change it; a replacement starts a new order with its own requested size. A rejected attempt keeps the signed input.\n"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "statusReason": {
            "description": "A rejected order carries the error catalog `reason` that its rejection reply carried. An order that the venue cancelled or cut without an instruction carries its cancel cause; a cancel the client signed, including a replace's cancel of its target, carries none.\n",
            "anyOf": [
              {
                "enum": [
                  "ACCOUNT_NOT_FOUND",
                  "BALANCE_EXCEEDED",
                  "BUILDER_FEE_CAP_EXCEEDED",
                  "BUILDER_FEE_OUT_OF_RANGE",
                  "CLIENT_ORDER_ID_ALREADY_SET",
                  "CLOSE_PRICE_BOUND_EXCEEDED",
                  "FEE_SCHEDULE_NOT_FOUND",
                  "FEE_STATE_UNAVAILABLE",
                  "FX_UNUSABLE",
                  "INSURANCE_WALLET_POSITION_NOT_PERMITTED",
                  "ISOLATED_UNIT_LIMIT_EXCEEDED",
                  "LIQUIDATION_ACTIVE",
                  "MARGIN_EXCEEDED",
                  "MARGIN_MODE_MISMATCH",
                  "MARGIN_MODE_NOT_PERMITTED",
                  "MARGIN_UNIT_EXIT_ONLY",
                  "MARKET_NOT_FOUND",
                  "MATCH_VISIT_CAP_EXCEEDED",
                  "OPENING_MARGIN_INVALID",
                  "OPENING_MARGIN_NOT_PERMITTED",
                  "OPEN_ORDER_LIMIT_EXCEEDED",
                  "ORDER_MALFORMED",
                  "ORDER_NOT_FOUND",
                  "ORDER_SIZE_EXCEEDED",
                  "ORDER_SIZE_OUT_OF_RANGE",
                  "ORDER_TYPE_INVALID",
                  "POSITION_NOTIONAL_CAP_EXCEEDED",
                  "POSITION_NOT_FOUND",
                  "POST_ONLY_TAKE_NOT_PERMITTED",
                  "PRICE_COLLAR_EXCEEDED",
                  "PRICE_TICK_INVALID",
                  "REDUCE_ONLY_BUDGET_EXCEEDED",
                  "REDUCE_ONLY_INVALID",
                  "RISK_UNAVAILABLE",
                  "WALLET_EXIT_ONLY",
                  "WALLET_PENDING",
                  "WITHDRAWABLE_EXCEEDED"
                ],
                "type": "string"
              },
              {
                "enum": [
                  "DEAD_MAN",
                  "FOK_KILLED",
                  "FORCE_CLOSE",
                  "IOC_EXPIRED",
                  "LIQUIDATION",
                  "REDUCE_ONLY_TRIM",
                  "SELF_TRADE"
                ],
                "type": "string"
              }
            ]
          },
          "timeInForce": {
            "type": "string",
            "enum": [
              "gtc",
              "ioc",
              "fok"
            ]
          },
          "postOnly": {
            "type": "boolean",
            "description": "The write's `postOnly` as placed; `false` for a market order."
          },
          "reduceOnly": {
            "type": "boolean",
            "description": "The write's `reduceOnly` as placed; `false` on spot, `true` on an order ATLAS placed to close a position for a TP/SL slot.\n"
          },
          "filledSize": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Cumulative filled quantity. Always present (\"0\" before any fill)."
          },
          "remainingSize": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Executable leaves on this order. While the order is live\n(`open` / `partially_filled`), this equals `size − filledSize − trimmedSize`.\nFor every terminal status (`filled` / `cancelled` / `expired` / `rejected`),\nthis is `\"0\"`. For cancelled or expired orders the unfilled terminal\nquantity is therefore `size − filledSize − trimmedSize`, not `remainingSize`.\n"
          },
          "trimmedSize": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Quantity reduce-only trims removed from this order's leaves in place,\nneither filled nor cancelled. Always present (\"0\" when never trimmed).\nA reduce-only trim that cancels the order adds nothing to it.\n"
          },
          "avgFillPrice": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Volume-weighted average fill price. Always present (\"0\" before any fill)."
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "The margin mode this order was signed with. Absent on spot orders.\n"
          },
          "createdAt": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "When ATLAS accepted the order, or refused it for a `rejected` order.\n"
          },
          "updatedAt": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Last change to the order: a fill, an exchange trim, a cancel, an expiry or ATLAS's refusal.\n"
          },
          "signerRole": {
            "type": "string",
            "enum": [
              "owner",
              "agent"
            ],
            "description": "Who authorized this order: `owner` (the account's own key) or\n`agent` (a delegated agent key). Lets a client filter \"orders my\nbot/agent placed\" vs \"orders I placed as owner\" — the primary key\nstays `accountAddress` (the economic owner). Absent when no key signed\nthe order, such as an order ATLAS places to liquidate. An order ATLAS placed for a TP/SL\nparent is signed by the ATLAS key bound to the account, so it is\n`agent`; use `origin` to tell it apart.\n"
          },
          "agentPubkeyX": {
            "type": "string",
            "description": "Delegated agent public-key x-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.\n"
          },
          "agentPubkeyY": {
            "type": "string",
            "description": "Delegated agent public-key y-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.\n"
          },
          "builderId": {
            "$ref": "#/components/schemas/BuilderId",
            "description": "The `builderFee.builderId` the order was placed with. Absent when it charges no Builder Fee.\n"
          },
          "builderFeeRateBps": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "The order's Builder Fee rate in bps, fixed at placement."
          },
          "stpLevel": {
            "$ref": "#/components/schemas/StpLevel",
            "description": "Present only on the row of an order that self-trade prevention cancelled: the level of the taker's wallet when the orders met.\n"
          },
          "stpTakerAccount": {
            "$ref": "#/components/schemas/AccountAddress",
            "description": "Present only on the row of an order that self-trade prevention cancelled: the account whose order met it.\n"
          },
          "parentOrderId": {
            "$ref": "#/components/schemas/Uint64String",
            "description": "The TP/SL parent (`AdvancedOrder.parentOrderId`) ATLAS placed this order for. Absent on orders ATLAS did not place for a parent.\n"
          },
          "origin": {
            "type": "string",
            "enum": [
              "entry",
              "take_profit",
              "stop_loss"
            ]
          }
        }
      },
      "OrderBookUpdate": {
        "type": "object",
        "required": [
          "marketId",
          "symbol",
          "updateId",
          "bids",
          "asks",
          "timestamp"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol"
          },
          "updateId": {
            "description": "The book state this frame brings the local book to. Update ids increase but are not contiguous.\n",
            "$ref": "#/components/schemas/Uint64String"
          },
          "prevUpdateId": {
            "description": "Delta frames only: the updateId of the previous delta for this symbol and interval. Apply the delta when prevUpdateId <= the local book's updateId < updateId.\n",
            "$ref": "#/components/schemas/Uint64String"
          },
          "bids": {
            "description": "Best bid first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceLevel"
            }
          },
          "asks": {
            "description": "Best ask first.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PriceLevel"
            }
          },
          "timestamp": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "When the book reached the state after this update.\n"
          }
        }
      },
      "OrderStatus": {
        "type": "string",
        "enum": [
          "accepted",
          "open",
          "partially_filled",
          "filled",
          "cancelled",
          "rejected",
          "expired"
        ],
        "description": "Lifecycle state of an order. \"accepted\"        — acknowledged by the matching engine; not yet open in the book. \"open\"            — resting in the order book, waiting to be filled. \"partially_filled\" — partially executed; remainder still open. \"filled\"          — fully executed; no remainder. \"cancelled\"       — cancelled before full fill (by client request, self-trade\n                    prevention, the dead-man deadline, or a venue-initiated cancel).\n\"rejected\"        — not accepted by the matching engine (e.g., insufficient margin). \"expired\"         — timed out by the matching engine; the unfilled remainder of\n                    an IOC order.\nNote: a market order that fills immediately will transition directly accepted → filled without resting in the \"open\" state.\n"
      },
      "OrderType": {
        "type": "string",
        "enum": [
          "limit",
          "market"
        ],
        "description": "Order execution type. \"limit\"  — rests at the specified price or better. \"market\" — executes immediately against available liquidity at best price;\n           ignored price field.\nStop-loss, take-profit and TWAP are advanced orders (`createTpSlOrder`, `createTwapOrder`), not order types.\n"
      },
      "OwnerKey": {
        "type": "string",
        "pattern": "^0x[0-9a-f]{40}$",
        "description": "A wallet owner key, 0x-hex (20 bytes)."
      },
      "Position": {
        "type": "object",
        "required": [
          "marketId",
          "symbol",
          "size",
          "marginMode"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "maximum": 8589934591,
            "description": "Market kind tag above the 32-bit identifier (spot 0, perpetual 1)."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol"
          },
          "size": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Signed position size. Positive is long; negative is short.\n"
          },
          "entryPrice": {
            "$ref": "#/components/schemas/DecimalString"
          },
          "unrealizedPnl": {
            "$ref": "#/components/schemas/Amount",
            "description": "The position's unrealised profit or loss at the mark, in the market's settlement asset. Absent when that service holds no fresh figure for this position: absent means unknown, and a client must not put an estimate in its place.\n"
          },
          "realizedPnl": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Cumulative realized PnL of this position: the price gain or loss booked each time it is reduced or closed, measured against its average entry cost. Price PnL excludes trading fees, Builder Fees and funding.\n"
          },
          "cumulativeFunding": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Net funding this position has received (positive) or paid (negative) since it opened, in the market's quote (settlement) asset; the sum of its `atlas.getFundingHistory` payments.\n"
          },
          "isolatedMargin": {
            "$ref": "#/components/schemas/Amount",
            "description": "Isolated margin funding this position: the cash of its isolated unit, quote-denominated decimal string exact to 12 decimal places (absent on cross positions).\n"
          },
          "marginMode": {
            "type": "string",
            "enum": [
              "cross",
              "isolated"
            ],
            "description": "`isolated` when the position is held in its own isolated unit; `cross` when it is in the cross unit.\n"
          },
          "liquidationPrice": {
            "$ref": "#/components/schemas/Price",
            "description": "The price at which this position would be liquidated, computed from the current marks and rounded onto the price grid against the account: up for a long, down for a short. Absent when that service holds no fresh figure for this position. The authoritative liquidation trigger stays account health.maintenanceBuffer (<= 0 means liquidatable).\n"
          }
        }
      },
      "PositiveDecimalString": {
        "type": "string",
        "pattern": "^[0-9]+(\\.[0-9]+)?$"
      },
      "Price": {
        "type": "string",
        "pattern": "^[0-9]+(\\.[0-9]+)?$"
      },
      "PriceLevel": {
        "description": "`[price, size]`, both decimal strings; size \"0\" removes the level.",
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/DecimalString"
        },
        "minItems": 2,
        "maxItems": 2
      },
      "ReportCause": {
        "type": "string",
        "enum": [
          "advanceClock"
        ],
        "description": "The system event whose batch produced a report that no transaction produced: `advanceClock` is the clock advance that books funding and expiries.\n"
      },
      "ReportNo": {
        "$ref": "#/components/schemas/Uint64String",
        "description": "A report number of the account on one stream as a decimal string. The first report of an account on a stream is \"1\", and each later one is one above the previous; it is never skipped, reused or reset. \"0\" stands for no report yet.\n"
      },
      "ReportPosition": {
        "type": "object",
        "required": [
          "height",
          "ordinal"
        ],
        "additionalProperties": false,
        "description": "Where a report sits in the Log: the Log Height of the entry that produced it and its ordinal among every report of that entry on the same stream, every account's, counted from 0. Report positions rise strictly in the order of the stream.\n",
        "properties": {
          "height": {
            "$ref": "#/components/schemas/LogHeight"
          },
          "ordinal": {
            "$ref": "#/components/schemas/Uint64Number"
          }
        }
      },
      "ReportRange": {
        "type": "object",
        "required": [
          "first",
          "last"
        ],
        "additionalProperties": false,
        "description": "The report numbers from `first` through `last`, both included.",
        "properties": {
          "first": {
            "$ref": "#/components/schemas/ReportNo"
          },
          "last": {
            "$ref": "#/components/schemas/ReportNo"
          }
        }
      },
      "RequestRefV1": {
        "type": "object",
        "required": [
          "txHash",
          "requestIndex"
        ],
        "additionalProperties": false,
        "properties": {
          "txHash": {
            "type": "string",
            "pattern": "^0x[0-9a-fA-F]{64}$",
            "description": "The request's transaction (0x-hex, 32 bytes): a native transaction's identifier, the `txId` `atlas.getTransactionReceipt` takes: the digest its credential signs.\n"
          },
          "requestIndex": {
            "type": "integer",
            "minimum": 0,
            "maximum": 65535,
            "description": "Zero-based slot index within the signed requests[]."
          }
        }
      },
      "SeqString": {
        "type": "string",
        "pattern": "^[1-9][0-9]*$",
        "description": "Per-subscription monotonically increasing counter as a decimal string; resets to \"1\" on each subscribe, no leading zeros.\n"
      },
      "Side": {
        "type": "string",
        "enum": [
          "buy",
          "sell"
        ],
        "description": "Order or trade direction. \"buy\" = bid; \"sell\" = ask.\n"
      },
      "Size": {
        "type": "string",
        "pattern": "^[0-9]+(\\.[0-9]+)?$"
      },
      "SlotPlan": {
        "type": "object",
        "required": [
          "triggerRef",
          "triggerPrice",
          "orderType",
          "timeInForce"
        ],
        "additionalProperties": false,
        "description": "One side of a `tpSl` parent: the price it watches and the close order ATLAS places when it fires. A side has no `side`, `baseQty` or `reduceOnly`: the close is a reduce-only order for the whole position at that moment. A take-profit fires when the price reaches `triggerPrice` in the position's favour, a stop-loss when it reaches it against the position. The typed encoding signs it as the struct `SlotPlan`.\n",
        "properties": {
          "triggerRef": {
            "$ref": "#/components/schemas/TriggerRef"
          },
          "triggerPrice": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "Signs as `int64 triggerPrice`, the `Price` mantissa (scale 10)."
          },
          "orderType": {
            "$ref": "#/components/schemas/AdvancedOrderType",
            "description": "The close order's type."
          },
          "limitPrice": {
            "$ref": "#/components/schemas/PositiveDecimalString",
            "description": "The `limit` close's price, which may differ from `triggerPrice`; required on `limit` and absent on `market`. Signs as `hasPrice` and `int64 price` (scale 10), zero when absent.\n"
          },
          "timeInForce": {
            "$ref": "#/components/schemas/AdvancedTimeInForce",
            "description": "The close order's time in force: `gtc` for a `limit` close, `ioc` or `gtc` for a `market` close.\n"
          }
        }
      },
      "SlotState": {
        "description": "- `pending`: waiting for the entry's first fill.\n- `armed`: watching the trigger.\n- `{\"faulted\": \"positionNotOnQtyGrid\"}`: crossed, but the position is\n  not on the order quantity grid, so no exact close exists; still watched.\n- `triggered`: ATLAS accepted its close order, which still works. Its\n  fills, partial ones included, count for this side.\n- `complete`: the close order filled in full, or filled and the position\n  is flat.\n- `{\"cancelled\": code}`: ended without a close order, ATLAS refused it, or\n  the close order was cancelled; a fill before the cancel still counts.\n\nOnce a side fires, its close order is an ordinary reduce-only order placed\nfor the position at that moment. The ATLAS does not cancel it when the\nposition later goes flat or flips; only cancelling the parent does. So if\nyou close the position by other means, a resting close order can still\nfill and open a position the other way: cancel the parent or the close\norder if you do not want that.\n",
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "pending",
              "armed",
              "triggered",
              "complete"
            ]
          },
          {
            "type": "object",
            "required": [
              "faulted"
            ],
            "additionalProperties": false,
            "properties": {
              "faulted": {
                "type": "string",
                "enum": [
                  "positionNotOnQtyGrid"
                ]
              }
            }
          },
          {
            "type": "object",
            "required": [
              "cancelled"
            ],
            "additionalProperties": false,
            "properties": {
              "cancelled": {
                "$ref": "#/components/schemas/EndReason"
              }
            }
          }
        ]
      },
      "StpLevel": {
        "type": "string",
        "enum": [
          "account",
          "wallet"
        ],
        "description": "Which of a taker's own orders self-trade prevention cancels: `account`\ncancels a crossing maker of the same account; `wallet` cancels a crossing\nmaker of any account in the same wallet."
      },
      "StreamClosed": {
        "type": "object",
        "required": [
          "subscriptionId",
          "seq",
          "snapshot",
          "reasonCode",
          "message"
        ],
        "additionalProperties": false,
        "properties": {
          "subscriptionId": {
            "$ref": "#/components/schemas/SubscriptionId"
          },
          "seq": {
            "$ref": "#/components/schemas/SeqString"
          },
          "snapshot": {
            "type": "boolean",
            "enum": [
              false
            ]
          },
          "reasonCode": {
            "$ref": "#/components/schemas/ErrorCode"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "SubscriptionId": {
        "type": "string",
        "minLength": 1,
        "description": "Opaque id unique within a WebSocket connection; invalidated when it closes."
      },
      "Symbol": {
        "type": "string",
        "pattern": "^[A-Z0-9]+(/[A-Z0-9]+|-[A-Z0-9]+(-(PERP|SPOT))?)$",
        "examples": [
          "BTC-USD-PERP",
          "ETH-USD-PERP",
          "ETH-USDT",
          "BTC-USDT",
          "BTC-USD-SPOT",
          "ZRO/USDT",
          "UST10Y/USDT"
        ]
      },
      "TermsVersion": {
        "type": "object",
        "required": [
          "id",
          "version",
          "contentHash"
        ],
        "additionalProperties": false,
        "description": "Identifies one exact version of the Atlas Terms of Use, which a wallet accepts by naming it in the terms line of its statements. The server must verify all three values against a published terms record; an unknown ID or version, or a mismatched content hash, must be rejected. Published content and its ID/version/hash binding must be immutable and retained for verification. The content hash covers the exact bytes served at the document's `documentUrl`.\n",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "Stable identifier of the terms document, independent of its version."
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "description": "Published revision of the identified terms document."
          },
          "contentHash": {
            "type": "string",
            "pattern": "^0x[0-9a-f]{64}$",
            "description": "keccak256 of the exact published terms content, as `0x` plus 64 lowercase hex characters.\n"
          }
        }
      },
      "Ticker": {
        "type": "object",
        "required": [
          "marketId",
          "symbol",
          "bestBid",
          "bestAsk",
          "lastPrice",
          "lastSize",
          "open24h",
          "high24h",
          "low24h",
          "volume24h",
          "volumeQuote24h",
          "tradeCount24h",
          "priceChange24h",
          "priceChangePct24h",
          "mode",
          "timestamp"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "symbol": {
            "type": "string",
            "minLength": 1,
            "description": "Catalogue label shared by markets with the same published symbol."
          },
          "bestBid": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Best bid price in the order book."
          },
          "bestAsk": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Best ask price in the order book."
          },
          "lastPrice": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Price of the most recent trade."
          },
          "lastSize": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Size of the most recent trade."
          },
          "open24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Opening price at the start of the rolling 24-hour window."
          },
          "high24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Highest traded price in the rolling 24-hour window."
          },
          "low24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Lowest traded price in the rolling 24-hour window."
          },
          "volume24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Total base-asset volume in the rolling 24-hour window."
          },
          "volumeQuote24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Total notional traded in the rolling 24-hour window, in the market's `quoteAsset`.\n"
          },
          "tradeCount24h": {
            "$ref": "#/components/schemas/Uint64Number",
            "description": "Number of trades in the rolling 24-hour window."
          },
          "priceChange24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Absolute price change over the rolling 24-hour window. Encoded as a signed DecimalString (may be negative).\n"
          },
          "priceChangePct24h": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Percentage price change over the rolling 24-hour window, e.g. \"2.53\" means +2.53 %.  Signed DecimalString (may be negative).\n"
          },
          "mode": {
            "type": "string",
            "enum": [
              "normal",
              "reduce_only",
              "close_only"
            ],
            "description": "Market trading mode. Always present.\n"
          },
          "timestamp": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Time at which this snapshot was taken, Unix milliseconds."
          },
          "markPrice": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Live mark price. On a perpetual market it values unrealized PnL and liquidation; on a spot pair it centres the market-order collar.\n"
          },
          "fundingRate": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Current periodic funding rate as a signed decimal fraction at full precision, e.g. \"0.0001\" is 1 bps. Positive = longs pay shorts; negative = shorts pay longs. Present only for perpetual markets with a committed funding offer; omitted when no offer exists. A committed zero is \"0\".\n"
          },
          "nextFundingTime": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Due time of ATLAS's committed next session checkpoint. Present only for perpetual markets with a queued checkpoint; remains overdue until it runs.\n"
          },
          "impactBid": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Impact bid price used as the short-side input to the mark-price calculation. Present only for perpetual markets and only when the book has enough depth on the bid side; otherwise omitted.\n"
          },
          "impactAsk": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Impact ask price used as the long-side input to the mark-price calculation. Present only for perpetual markets and only when the book has enough depth on the ask side; otherwise omitted.\n"
          },
          "openInterest": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Total outstanding open interest in base units (e.g. \"12.5\" BTC). The canonical, price-independent value tracked by ATLAS; changes only as positions open/close. Present only for perpetual markets.\n"
          },
          "openInterestValue": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Open interest in quote notional, in the market's `quoteAsset` (e.g. \"750000\" USDT), derived server-side as `openInterest × markPrice` using the same markPrice emitted on this ticker. Present only for perpetual markets.\n"
          },
          "indexPrice": {
            "$ref": "#/components/schemas/DecimalString",
            "description": "Optional index price in the market's quote asset. Omit when the index source is unavailable; never substitute zero.\n"
          }
        }
      },
      "TimestampMs": {
        "type": "integer",
        "minimum": 0,
        "description": "Unix timestamp in milliseconds as a JSON integer."
      },
      "TpSlStatus": {
        "type": "string",
        "enum": [
          "pending",
          "armed",
          "triggered",
          "complete",
          "cancelled"
        ],
        "description": "A `tpSl` parent's summary of its sides. The most active side wins: `triggered` (a close order works), then `armed`, then `pending` (waiting for the entry's first fill). Once no side is open it is `complete` if one side completed, else `cancelled` with its `endReason`. `complete` and `cancelled` are final. Only a `pending` or `armed` side holds the parent's `(accountAddress, marketId, marginMode)`: once none is left, a new create is taken there even while a close order of this parent still works.\n"
      },
      "Trade": {
        "type": "object",
        "required": [
          "marketId",
          "symbol",
          "price",
          "size",
          "side",
          "timestamp",
          "tradeId"
        ],
        "additionalProperties": false,
        "properties": {
          "marketId": {
            "type": "integer",
            "minimum": 0,
            "description": "Market ID returned by atlas.getSymbols."
          },
          "symbol": {
            "$ref": "#/components/schemas/Symbol"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "size": {
            "$ref": "#/components/schemas/Size"
          },
          "side": {
            "$ref": "#/components/schemas/Side",
            "description": "Aggressor side: the side of the order that crossed the spread and triggered the match.\n"
          },
          "timestamp": {
            "$ref": "#/components/schemas/TimestampMs",
            "description": "Match time of the trade.\n"
          },
          "tradeId": {
            "$ref": "#/components/schemas/TradeId"
          },
          "liquidation": {
            "type": "boolean",
            "description": "True when this trade is a liquidation clip, the same flag as `Fill.liquidation` on the fills it produced. Absent or false otherwise. Filtering `stream.trades` on it gives an exchange-wide liquidation feed.\n"
          }
        }
      },
      "TradeId": {
        "type": "string",
        "minLength": 1
      },
      "TriggerRef": {
        "type": "string",
        "enum": [
          "mark",
          "index",
          "last"
        ],
        "description": "The price a side watches. Signs as `uint8` mark 0, index 1, last 2."
      },
      "TwapStatus": {
        "type": "string",
        "enum": [
          "running",
          "filled",
          "ended",
          "stopped"
        ],
        "description": "`running` while it may send; `filled` once the whole total is confirmed filled; `ended` when the deadline arrived first; `stopped`, with its `endReason`, when something ended it early. Only `running` changes.\n"
      },
      "TxId": {
        "type": "string",
        "pattern": "^0x[0-9a-f]{64}$",
        "description": "Transaction identifier as `0x` plus 64 lowercase hex characters: the digest the transaction's credential signs, its Opaque or Typed digest (not a hash of the signature). It is the submission identity and the result and dedup key of the signed transaction. It is not the per-key timestamp nonce and not a clOrdId. A changed command with an already-consumed timestamp has a new identifier but must still fail nonce replay.\n"
      },
      "Uint64Number": {
        "type": "integer",
        "minimum": 0,
        "description": "Bounded unsigned integer as a JSON number (e.g. resting-order seq, block height)."
      },
      "Uint64String": {
        "type": "string",
        "pattern": "^[0-9]+$",
        "description": "Unsigned 64-bit integer as a decimal string; allows \"0\"."
      },
      "WalletState": {
        "type": "string",
        "enum": [
          "pending",
          "active",
          "exit_only"
        ],
        "description": "The state of the account's wallet. It is one setting of the wallet, so\nevery account of the wallet reads the same value.\n`pending`: the default, until the wallet completes `enableTrading`. The\nwallet cannot add risk or transfer to another wallet.\n`active`: the wallet may trade.\n`exit_only`: set by the Atlas operator. The whole wallet can reduce,\nexit, withdraw and transfer between its own accounts, and cannot add\nrisk or transfer to another wallet. Its resting orders stay."
      }
    }
  }
}
