openrpc: 1.3.2
info:
  title: ATLAS Public API
  version: 1.0.0
  description: "The atlas.* JSON-RPC methods: market data, account reads and trading writes, with every shared type under components.schemas."
servers:
  - name: testnet
    url: https://testnet.atlas.layerzero.network
    summary: ATLAS testnet. Every request needs an X-Api-Key header.
methods:
  - name: atlas.getBalances
    paramStructure: by-name
    summary: Get account balances.
    description: |
      Spendable balances per asset (`total` / `available`), taken from ATLAS's account state: one row per asset in each place the account holds it, `place` naming the staked balance, the cross unit or an isolated unit, and `symbol` naming an isolated unit's market. This is **cash on hand, not mark-to-market account value**: it excludes unrealized position PnL, and it does not surface funding as its own line. An address that holds no account returns what deposits and transfers left there unclaimed, as `cross` rows: the cross cash its first account takes. An address that holds neither an account nor an unclaimed balance is refused (`unknown_account`).
    x-rateLimit:
      defaultWeight: 5
      overrides:
        - when:
            parameter: accountAddress
            present: false
          weight: 40
    params:
      - name: accountAddress
        required: false
        description: "Account to query. Always pass it: when omitted, the result sums every account (one staked row and one cross row per asset, with the balances of unclaimed addresses counted as cross) and costs more."
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: balances
      schema:
        type: array
        items:
          $ref: "#/components/schemas/Balance"
    errors:
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -12015
        message: Unknown account
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getPositions
    paramStructure: by-name
    summary: Get open positions.
    description: |
      The account's open positions. A position that has closed is not listed, except an isolated unit that still holds margin, listed with `size` `0` and its `isolatedMargin` until the margin is withdrawn.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: marketId
        required: false
        description: Only this market's rows; the market id atlas.getSymbols returns.
        schema:
          type: integer
          minimum: 0
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: positions
      schema:
        type: array
        items:
          $ref: "#/components/schemas/Position"
    errors:
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -12015
        message: Unknown account
      - code: -20008
        message: Symbol not found
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getTransfers
    paramStructure: by-name
    summary: Booked transfers into and out of an account.
    description: |
      Returns the account's booked transfers, most recent first, each with
      its memo unchanged. A transfer appears only once it is booked, so every
      row's status is `transferComplete`. A transfer ATLAS rejected never
      appears; the write's reply carries the rejection. Pass
      `transferId` to look up one transfer. Use `cursor` for keyset
      pagination.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: transferId
        required: false
        description: Return only this transfer.
        schema:
          type: string
          pattern: ^0x[0-9a-f]{64}$
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          `nextCursor` from the previous page. Omit for the first page.
        schema:
          $ref: "#/components/schemas/TransferCursor"
    result:
      name: transferHistoryPage
      schema:
        $ref: "#/components/schemas/TransferHistoryPage"
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getLedger
    paramStructure: by-name
    summary: Every balance change of an account, most recent first.
    description: |
      The account's own cash legs from booked Transactions: trades, fees,
      funding, interest, transfers, withdrawals, liquidations, ADL and force closes. Filter
      `type` to `liquidation` / `adl` for liquidation history. Only the
      account's own legs are returned, never another party's legs or fee
      attribution. A funding or interest leg is one settlement row: its `causeId` is the
      session it books, and its `timestamp` is the input that booked it, never
      the session boundary that fixed the charge.

      A row's `causeId` is the id of what booked it:

      | `type` | `kind` | `causeId` |
      |---|---|---|
      | `fill` | | The fill's `tradeId` |
      | `deposit` | | The request digest of the request that booked it: a `CreateBridgeDeposit`, or an asset-creation request whose initial mint is nonzero |
      | `withdrawal` | | The `withdrawalId` |
      | `transfer` | `internal` | The Transfer ID, its own `transactionId` |
      | `transfer` | `isolated_add`, `isolated_remove` | Its own `transactionId` |
      | `transfer` | `stake`, `unstake`, `unstake_release` | Its own `transactionId` |
      | `funding`, `interest` | | The session's `sessionId` |
      | `liquidation` | `vault_assignment`, `purse_credit` | The `liquidationId` |
      | `adl` | | The `adlId` |
      | `force_close` | | The sequence of the entry that booked the force close |

      A `causeId` is unique only within its `type`, and within its `kind` on a
      transfer, so match on those too. Rows of one cause share it: a withdrawal's
      single debit is read by its `withdrawalId`.

      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ rows, nextCursor, coveredThrough }`, ordered by timestamp descending
      at full source precision, then by source position, booking ordinal and
      legIndex descending. `transactionId` is an opaque composite identity,
      not a numeric sequence or a lexicographic sort key. Pass the opaque
      nextCursor unchanged with the same filters; null ends traversal.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: asset
        required: false
        description: Asset symbol to filter by, as `AssetInfo.symbol` lists it.
        schema:
          type: string
          minLength: 1
      - name: type
        required: false
        schema:
          type: string
          enum:
            - fill
            - deposit
            - withdrawal
            - transfer
            - funding
            - interest
            - liquidation
            - adl
            - force_close
      - name: from
        required: false
        description: Range start, Unix milliseconds, inclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Range end, Unix milliseconds, exclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep all filters unchanged.
        schema:
          type: string
    result:
      name: ledgerPage
      schema:
        $ref: "#/components/schemas/LedgerPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getAccountState
    paramStructure: by-name
    summary: Get balances, positions, and onboarding status for an account.
    description: |
      Single aggregated view of an account, grouped by margin unit: the
      cross unit and each isolated unit, each with its own balances and
      positions; plus the state of its wallet (`walletState`) and its latest
      accepted Atlas Terms of Use version (`terms`).
      `accountAddress` is a required request parameter — there is no
      aggregate account-state view. An address that holds no account but
      what deposits and transfers left there unclaimed reads as a read-only
      view until its owner's first command opens its account: the unclaimed
      balances in `cross.balances`, `staked`, `cross.positions` and
      `isolated` empty, `walletState` `pending` and no `walletAddress`. An address that holds
      neither is refused (`unknown_account`), as in `atlas.getBalances` and
      `atlas.getPositions`.
    x-rateLimit:
      defaultWeight: 10
    params:
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: accountState
      schema:
        $ref: "#/components/schemas/AccountState"
    errors:
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -20003
        message: Service unavailable
      - code: -12015
        message: Unknown account
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getKeys
    paramStructure: by-name
    summary: The wallet's owner, its owner nonce and its instruction keys with their bindings.
    description: |
      Takes any account and returns, for the wallet that holds it, the address
      its owner signs as, the owner key's last accepted gapless nonce and
      every instruction key bound to one of its accounts. The owner address is
      the wallet's owner key, or the identity of the signer policy that owns
      it, and is null when the wallet has no owner. Each binding carries its
      scope, Builder Fee caps and nonce mode, and a `GAPLESS` binding its last
      accepted gapless nonce. A known wallet without bound keys returns an
      empty `keys` array. A key bound in several wallets appears in each with
      that wallet's bindings.

      The values are eventually consistent: they follow the committed
      commands with a delay. A client that signs the next gapless nonce
      from an older value is refused with `NONCE_NOT_NEXT`; it reads again
      and signs the value read plus one.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: accountAddress
        required: true
        description: Any account in the wallet.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: keyList
      schema:
        $ref: "#/components/schemas/KeyList"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getSignerPolicy
    paramStructure: by-name
    summary: The signer policy record stored under an identity.
    description: |
      Returns the identity, threshold and members of the policy record that
      an accepted `createSignerPolicy` created under `identity`, as its outcome
      reported it. A record never changes once created. Null when ATLAS holds no record under `identity`: for an address that is no
      policy identity, and for a policy whose `createSignerPolicy` ATLAS has
      not read yet. An unreadable history returns -20003, never null.
    x-authRequired: false
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: identity
        required: true
        description: The policy identity, the address the policy signs as.
        schema:
          $ref: "#/components/schemas/EvmAddress"
    result:
      name: policy
      schema:
        $ref: "#/components/schemas/SignerPolicyLookupResult"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getVersion
    paramStructure: by-name
    summary: Build identity of the responding service and the venue's Typed transaction signing domain.
    description: |-
      The build that answered: release version, git SHA, commit time and build time. Takes no parameters. Served on `/seq/rpc`, `/account/rpc` and `/market/rpc`.

      `signing.transactionDomain` is the venue's transaction domain: its `name`, `version` and `salt`. Sign a Typed transaction under `EIP712Domain(string name,string version,uint256 chainId,bytes32 salt)` with these values and a `chainId` you choose, and send that `chainId` with the request. An Opaque signature commits to the same `salt`.
    x-rateLimit:
      defaultWeight: 1
    params: []
    result:
      name: versionInfo
      schema:
        $ref: "#/components/schemas/VersionInfo"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: diagnostics
        url: https://testnet.atlas.layerzero.network/seq/rpc
  - name: atlas.getAccounts
    paramStructure: by-name
    summary: A wallet's accounts, its Main and Subs.
    description: |
      Takes a wallet address, which is its Main account's address, and
      returns every account in that wallet, the Main first. To
      find the wallet of a Sub, read `walletAddress` from
      `atlas.getAccountState` for that Sub.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: walletAddress
        required: true
        description: The wallet's address, which is its Main account's address. A Sub's address is refused.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: walletAccounts
      schema:
        $ref: "#/components/schemas/WalletAccounts"
    errors:
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -12015
        message: Unknown account
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getPortfolioHistory
    paramStructure: by-name
    summary: Account value, capital-adjusted PnL and traded volume over time.
    description: |
      Snapshots of the explicitly requested account in the Margin Base.
      Omit window for day, week, month and all_time, in that order.

      Day is 24 hours, week is 7 days, and month is 30 days before request
      time. Snapshots with missing account values are skipped. Every window
      ends at the latest usable snapshot at or before request time inside the complete history. Its baseline is the latest usable snapshot at
      or before the cutoff; if none exists, the first usable retained snapshot
      starts partial history. all_time also starts at the first usable retained
      snapshot. Changes cover the interval
      after that baseline through the end, with actual endpoint timestamps;
      no arbitrary-time boundary value or opening zero is invented. A stale
      single snapshot yields one account-value point, zero PnL and zero volume.

      Each window preserves its baseline and end, oldest first, without a
      point cap. Interior display buckets select the latest usable actual
      sample. Fixed widths are 5 minutes, 1 hour, 4 hours and 1 day for day,
      week, month and all_time. Buckets align to UTC boundaries; returned
      points retain actual observation timestamps. Every usable capital-flow
      observation is retained as well, including zero-net flows. Downsampling
      does not change endpoint PnL or volume.

      Trading fees and maker rebates affect PnL.
      PnL removes deposits, withdrawals, account transfers and non-trading
      payouts, including builder, referral, broker and reward credits.

      Volume is actual, unweighted execution notional for the requested account,
      converted to the Margin Base at execution time. all_time volume measures
      the cumulative-counter difference since the first usable retained
      observation, not lifetime volume before that observation.

      Before usable proven snapshots exist, windows is empty and
      coveredThrough is null. Missing account values are skipped before
      selecting endpoints or bucket winners, so a later missing value does
      not hide an earlier usable value in the same bucket. Unreadable history, missing capital counters at selected
      observations, and missing volume counters at either endpoint are
      service-unavailable errors. Skipping an unavailable account value cannot
      repair unknown cumulative counters. Coverage describes how far the history is complete, not continuous price availability or the time of the latest usable value.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: window
        required: false
        schema:
          $ref: "#/components/schemas/HistoryWindow"
    result:
      name: portfolioHistory
      schema:
        $ref: "#/components/schemas/PortfolioHistory"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getTerms
    paramStructure: by-name
    summary: Published terms documents and where to fetch their text.
    description: |
      Without params, returns the version of the Atlas Terms of Use in force:
      the newest version whose `effectiveAt` has passed, or none before the
      first. With `id`, that version only if it has that ID; add `version`
      for any published version.
      A signer accepts exactly the returned `terms` (ID, version and content
      hash); acceptance of anything else is rejected. Fetch the text from
      `documentUrl` and check that keccak256 of the downloaded bytes equals
      `terms.contentHash` before showing it for acceptance.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: id
        required: false
        schema:
          type: string
          minLength: 1
      - name: version
        required: false
        description: Requires `id`.
        schema:
          type: string
          minLength: 1
    result:
      name: terms
      schema:
        type: array
        items:
          $ref: "#/components/schemas/Terms"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getBuilder
    paramStructure: by-name
    summary: The builder's Builder ID, terms accepted and volume stats.
    description: |
      One read for the builder dashboard. `terms` is the Atlas Terms of Use
      version the builder last accepted, so the portal asks only for a newer
      one. The Builder Tier is private: `atlas.getBuilderPayouts`
      reports it.

      In `stats`, `builderVolume` is paid flow from wallets stamped with the
      Builder ID; `appVolume` is flow through orders carrying the Builder
      ID. A liquidation fill counts in Builder Volume and not in App Volume.
      `builderFee` is the Builder Fee charged on App Volume fills, counted
      when the fill happens, before it is paid out. The Builder Rebate is
      not in the buckets: it is computed per payout period, and
      `atlas.getBuilderPayouts` reports it.

      Buckets align to UTC: the hour, or the day at 00:00. Give either
      `window` (relative to now) or `from` / `to` (a fixed range, such as
      a payout period). The range's start is rounded down to a bucket
      boundary, so a `week` window with `1d` buckets returns 8 buckets,
      the last one partial. A range and interval that would exceed 1,000
      buckets are refused with -32602. While the volumes cannot be read,
      `stats` is null, never zero volume.

      Public: no token. The builder is `accountAddress`, its Main; an
      account with no Builder ID from `enableBuilder` is -12024 (Not a
      builder).
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: The builder's Main account.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: window
        required: false
        description: Default `day` when `from` is absent. Not allowed with `from`.
        schema:
          $ref: "#/components/schemas/HistoryWindow"
      - name: from
        required: false
        description: Inclusive range start in Unix milliseconds; replaces `window`.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Exclusive range end in Unix milliseconds. Only with `from`; defaults to now.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: interval
        required: false
        description: Default `1d`.
        schema:
          $ref: "#/components/schemas/Interval"
    result:
      name: builder
      schema:
        $ref: "#/components/schemas/Builder"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12024
        message: Not a builder
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getBuilderPayouts
    paramStructure: by-name
    summary: The builder's Builder Tier and its Builder Fee and Builder Rebate payouts, newest first.
    description: |
      One row per kind and asset per payout period. Each row gives its period as
      `periodStart` / `periodEnd`, and `nextPayoutAt` gives when the next
      payout is scheduled, or null when none is.

      `tier` comes from the latest applied tier snapshot. Until a snapshot includes this builder,
      `snapshotAt`, `tier`, `rebatePct`, `qualifiedBy`, `stakedZro` and
      `builderVolume14d` are null and `nextTier` is the lowest tier's entry.
      If the tier cannot be read, the call returns -20003 (Service unavailable), never a
      fabricated tier.

      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ tier, rows, nextCursor, nextPayoutAt }`. Pass the opaque nextCursor
      unchanged; null ends traversal.

      Private: send `Authorization: Bearer <accessToken>` from `auth.login`.
      The builder is `accountAddress`, its Main, and the token must cover it,
      because the tier and payouts can carry deal terms. An account with no
      Builder ID from `enableBuilder` is -12024 (Not a builder).
      From a restricted region, it is -20014
      (Restricted region).
    x-authRequired: true
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: The builder's Main account. The access token must cover it.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page.
        schema:
          type: string
    result:
      name: builderPayoutPage
      schema:
        $ref: "#/components/schemas/BuilderPayoutPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -12009
        message: Forbidden
      - code: -12024
        message: Not a builder
      - code: -20003
        message: Service unavailable
      - code: -20014
        message: Restricted region
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getBuilderTiers
    paramStructure: by-name
    summary: "The Builder Tier table: each tier's Builder Rebate and the Builder Volume or staked ZRO that reaches it."
    description: |
      Served from the published Builder Tier table, lowest tier first.
      Reads never use built-in values. An unavailable or empty table is -20003
      (Service unavailable).

      Public: no token.
    x-rateLimit:
      defaultWeight: 5
    params: []
    result:
      name: builderTiers
      schema:
        $ref: "#/components/schemas/BuilderTierTable"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getFeeTier
    paramStructure: by-name
    summary: The wallet's user fee tier, its 14-day weighted volume and what the next tier needs.
    description: |
      `userTier` is served from the latest tier snapshot; reads never compute
      a tier themselves. Until a snapshot includes the wallet, `snapshotAt`,
      `userTier`, `weightedVolume14d` and `nextTier` are null. An unknown account is -12015 (Unknown account). If the tier cannot be read, the call returns -20003 (Service unavailable), never a fabricated tier. The
      staking tier, which discounts the fee at this tier, is
      `atlas.getStakingState`.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: accountAddress
        required: true
        description: Any account of the wallet.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: feeTier
      schema:
        $ref: "#/components/schemas/FeeTier"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getStakingState
    paramStructure: by-name
    summary: The wallet's staking tier, the ZRO staked across it and what the next tier needs.
    description: |
      `stakingTier` is served from the latest applied tier snapshot; reads
      never compute a tier themselves. Until a snapshot includes the wallet,
      `snapshotAt`, `stakingTier`, `stakedZro` and `nextTier` are null. If the tier cannot be read, the call returns -20003 (Service unavailable), never a
      fabricated tier.

      Private: send `Authorization: Bearer <accessToken>` from `auth.login`.
      Owner-key and bound-key sessions are accepted. The token must cover
      `accountAddress`, the session must still be live, and the key must still
      act for that account. The result covers the whole wallet (Main and all
      Subs), including its total staked ZRO, even when the key is bound only
      to the requested account.
    x-authRequired: true
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: accountAddress
        required: true
        description: Any account of the wallet. The access token must cover it.
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: stakingState
      schema:
        $ref: "#/components/schemas/StakingState"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -12019
        message: Token expired
      - code: -12020
        message: Token invalid
      - code: -12009
        message: Forbidden
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getBuilderUsers
    paramStructure: by-name
    summary: The builder's users, each with its volume, Builder Fee and Builder Rebate for one payout period.
    description: |
      One row per wallet: every wallet stamped with the builder's Builder ID,
      with when it was stamped, and every other wallet that traded through
      the builder's app in the period. Pass `periodStart` from a
      `atlas.getBuilderPayouts` row to read a closed period, whose rows
      split its payouts by wallet; omit it for the current, open period.

      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ periodStart, periodEnd, rows, nextCursor, asOf }`, rows by
      `walletAddress` ascending. Pass the opaque nextCursor unchanged with
      the same `periodStart`; null ends traversal.

      Private: send `Authorization: Bearer <accessToken>` from `auth.login`.
      The builder is `accountAddress`, its Main, and the token must cover it,
      because the per-wallet list would show a builder's users to other
      builders. An account with no Builder ID from `enableBuilder` is -12024
      (Not a builder).
      From a restricted region, it is -20014
      (Restricted region).
    x-authRequired: true
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: The builder's Main account. The access token must cover it.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: periodStart
        required: false
        description: |
          `periodStart` of the payout period to read, as `atlas.getBuilderPayouts` gives it. Omit for the current, open period.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep `periodStart` unchanged.
        schema:
          type: string
    result:
      name: builderUserPage
      schema:
        $ref: "#/components/schemas/BuilderUserPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -12009
        message: Forbidden
      - code: -12024
        message: Not a builder
      - code: -20003
        message: Service unavailable
      - code: -20014
        message: Restricted region
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getPlatformStats
    paramStructure: by-name
    summary: Platform-wide totals for one window, for public dashboards.
    description: |
      Totals across every market. The server refreshes them in the background; `asOf` says when they were computed.

      Errors:

      - `-32602` Invalid params: unknown window.
      - `-20003` Service unavailable: totals have not been computed yet; retry with backoff.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: window
        required: false
        description: Default `day`.
        schema:
          $ref: "#/components/schemas/HistoryWindow"
          default: day
    result:
      name: platformStats
      schema:
        $ref: "#/components/schemas/PlatformStats"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getTime
    paramStructure: by-name
    summary: Current server Unix time in milliseconds.
    description: |-
      Public clock read served on `/market/rpc` and `/seq/rpc`; no authentication or signed transaction is required. Omit `params` or send an empty object. Each path answers from its own server's clock, so a client with no other source of server time can sign a nonce whose millisecond lies inside the venue's nonce window.

      Returns the responding server's current wall-clock time as a JSON integer of milliseconds since the Unix epoch in UTC. The server reads its clock for each request; responses must not be cached.

      Use the response together with the client's send and receive times to estimate clock offset. Network latency limits that estimate's accuracy. This is the responding server's clock, not a block timestamp, and clock adjustments can make successive values move backwards. The two paths can differ by the skew between their servers. The TradingView `/udf/time` endpoint returns Unix seconds.
    x-rateLimit:
      defaultWeight: 1
    params: []
    result:
      name: serverTime
      schema:
        $ref: "#/components/schemas/TimestampMs"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: diagnostics
        url: https://testnet.atlas.layerzero.network/seq/rpc
  - name: atlas.getSymbols
    paramStructure: by-name
    summary: List supported market symbols and trading parameters.
    description: |
      Returns the catalogue of tradable symbols and their static trading
      parameters (decimals, tick/lot/min sizes, risk config, status, mode).
      All inputs are optional; with none supplied the response is the full
      catalogue sorted by symbol.

      Optional server-side helpers:
        - `kind`, `status`, `mode`, `quoteAsset` — exact-match filters.
        - `query` — case-insensitive substring search on symbol / base asset.
        - `sortBy` + `sortDir` — server-side sort (default `symbol` asc).
        - `limit` + `offset` — simple paging (no cursor; result stays an array).

      This is the static catalogue only. For live market data use
      `atlas.getTicker` / `atlas.getTickers`.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: kind
        required: false
        description: Filter by market kind. Absent = all markets.
        schema:
          type: string
          enum:
            - perp
            - spot
      - name: sortBy
        required: false
        description: Field to sort by. Default `symbol`.
        schema:
          type: string
          enum:
            - symbol
            - marketId
            - baseAsset
            - quoteAsset
            - kind
            - status
            - mode
          default: symbol
      - name: sortDir
        required: false
        description: Sort direction. Default `asc`.
        schema:
          type: string
          enum:
            - asc
            - desc
          default: asc
      - name: query
        required: false
        description: Case-insensitive substring match over symbol and base asset.
        schema:
          type: string
      - name: status
        required: false
        description: Filter by market status. Absent = all.
        schema:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
      - name: mode
        required: false
        description: Filter by trading mode. Absent = all.
        schema:
          type: string
          enum:
            - NORMAL
            - REDUCE_ONLY
            - CLOSE_ONLY
      - name: quoteAsset
        required: false
        description: Filter to a single quote/settlement asset (e.g. "USDT").
        schema:
          type: string
      - name: limit
        required: false
        description: Max rows to return, applied after sorting. Absent = all.
        schema:
          type: integer
          minimum: 1
      - name: offset
        required: false
        description: Rows to skip before `limit`, for simple paging. Default 0.
        schema:
          type: integer
          minimum: 0
    result:
      name: symbols
      schema:
        type: array
        items:
          $ref: "#/components/schemas/SymbolInfo"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getAssets
    paramStructure: by-name
    summary: List every asset in the catalogue.
    description: |
      Returns every asset id ATLAS has created, sorted by `assetId`,
      including assets that no market references. The reserved slot 0 is not
      listed.
      `atlas.getSymbols` names only the assets its markets reference. Takes no
      parameters.
    x-rateLimit:
      defaultWeight: 5
    params: []
    result:
      name: assets
      schema:
        type: array
        items:
          $ref: "#/components/schemas/AssetInfo"
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getOrderBook
    paramStructure: by-name
    summary: Get a point-in-time order book snapshot for one market by ID.
    description: |
      Returns the full or depth-limited order book.
      Use `depth` to limit the number of price levels returned per side.
      A known market with no book yet returns empty `bids` and `asks` with
      `timestamp` 0; an unknown market ID is -20008.
      For live updates, subscribe to `stream.order_book` instead.
    x-rateLimit:
      defaultWeight: 5
      overrides:
        - when:
            parameter: depth
            present: false
          weight: 20
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
      - name: depth
        required: false
        description: |
          Maximum number of price levels to return per side, at least 1. Absent = full depth. A value above the stored depth returns every stored level. UI presets commonly use 1, 5, 10, 20, 50, and 100.
        schema:
          type: integer
          minimum: 1
    result:
      name: orderBook
      schema:
        $ref: "#/components/schemas/OrderBookSnapshot"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getTicker
    paramStructure: by-name
    summary: Get the current ticker for one market by ID.
    description: |
      Returns the market's ticker: best bid/ask, last trade, the rolling
      24-hour statistics (open, high, low, base and quote volume, price
      change), market `mode`, and (for perpetuals) mark price, impact bid/ask,
      funding rate, next funding time and open interest.
      For live updates subscribe to `stream.ticker`.

      Errors:

      - `-32602` Invalid params: missing or malformed market ID.
      - `-20008` Symbol not found: market ID is not in the market catalogue.
      - `-20003` Service unavailable: market state cannot be read; retry with backoff.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
    result:
      name: ticker
      schema:
        $ref: "#/components/schemas/Ticker"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getBBO
    paramStructure: by-name
    summary: Get the current best bid and offer for one market by ID.
    description: |
      Returns the top-of-book bid and ask with sizes.
      For live updates, subscribe to `stream.bbo` instead.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
    result:
      name: bbo
      schema:
        $ref: "#/components/schemas/BBO"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getTrades
    paramStructure: by-name
    summary: Get public trades for one market by ID, most recent first.
    description: |
      Returns the market's matched trades in reverse execution order (most
      recent first). Use `cursor` for keyset pagination: pass the opaque
      `nextCursor` from the previous page unchanged with the same `marketId`;
      a null `nextCursor` ends traversal. Paging reaches back only as far as
      the service's per-market trade retention. For live updates, subscribe to
      `stream.trades` instead.

      Errors:

      - `-32602` Invalid params: missing or malformed market ID, limit not an integer or outside 1..500, or an invalid, expired or query-mismatched cursor.
      - `-20008` Symbol not found: market ID is not in the market catalogue.
      - `-20003` Service unavailable: trade history cannot be read; retry with backoff.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
      - name: limit
        required: false
        description: Number of trades to return. Default 50, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep `marketId` unchanged.
        schema:
          type: string
    result:
      name: tradeHistoryPage
      schema:
        $ref: "#/components/schemas/TradeHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getCandles
    paramStructure: by-name
    summary: Get historical OHLCV candles for one market by ID and interval.
    description: |
      Returns candles in ascending time order (oldest first), at most `limit`
      of them. With both `from` and `to` (Unix milliseconds, like the candle's
      `t` and `T`), returns the latest `limit` candles in that range; page
      backward by setting `to` to the earliest returned open time `t`. Provide
      only `to` to page backward through the latest candles strictly before
      that time. Otherwise it returns the most recent `limit` candles.
      Cursor pages hold persisted candles only, not the current live candle;
      merge the `stream.candles` snapshot and updates for the live tip.
      Continue paging until a response adds no new candle open times; the service
      may enforce a lower effective page limit than the requested `limit`.
      Finalized candles carry `x: true`; the current live candle, when included,
      carries `x: false`.
      The TradingView UDF `/udf/history` endpoint serves the same candles with
      times in Unix seconds.
      For live updates, subscribe to `stream.candles` instead.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
      - name: interval
        required: true
        schema:
          $ref: "#/components/schemas/Interval"
      - name: from
        required: false
        description: Range start, Unix milliseconds, inclusive. Must not be later than `to`.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: |
          Range end, Unix milliseconds, exclusive. Without `from`, this is a backward pagination cursor and returns the latest candles before this time.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of candles to return, for every query form. Default 500, max 1000.
        schema:
          type: integer
          minimum: 1
          maximum: 1000
    result:
      name: candles
      schema:
        type: array
        items:
          $ref: "#/components/schemas/Candle"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getTickers
    paramStructure: by-name
    summary: Get the current ticker for listed markets in one call.
    description: |
      Omit all selectors to read every listed market. Supply at most one of
      `symbol`, `symbols` or `marketIds`. Each symbol selects every listed
      market with that symbol. Results follow requested key order, then catalogue
      order within each symbol. Each market ID appears once.

      Errors:

      - `-32602` Invalid params: malformed or conflicting selectors.
      - `-20008` Symbol not found: a requested symbol or market ID is unknown. The whole call fails; no partial result is returned.
      - `-20003` Service unavailable: market state cannot be read; retry with backoff.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: symbol
        required: false
        schema:
          type: string
          minLength: 1
      - name: marketIds
        required: false
        schema:
          type: array
          items:
            type: integer
            minimum: 0
      - name: symbols
        required: false
        description: Symbols to match.
        schema:
          type: array
          items:
            type: string
            minLength: 1
    result:
      name: tickers
      schema:
        type: array
        items:
          $ref: "#/components/schemas/Ticker"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getInterestRates
    paramStructure: by-name
    summary: Current committed interest offers per asset, in basis points.
    description: Assets without a committed offer are omitted; a committed zero is retained.
    x-rateLimit:
      defaultWeight: 5
    params: []
    result:
      name: interestRates
      schema:
        type: array
        items:
          $ref: "#/components/schemas/InterestRate"
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getInterestRateHistory
    paramStructure: by-name
    summary: Committed interest offers and frozen session rates for one asset.
    description: |
      Most recent first, with the same keyset pagination and history coverage as funding history. sessionId is null for an applied offer and identifies the completed session for a frozen rate. Absent rates produce no row; zero is retained. Pass nextCursor unchanged with the same filters; null ends traversal.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: assetId
        required: true
        schema:
          $ref: "#/components/schemas/Uint64String"
      - name: from
        required: false
        description: Range start, Unix milliseconds, inclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Range end, Unix milliseconds, exclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: Opaque nextCursor from the preceding page; omit for the first page and keep filters unchanged.
        schema:
          type: string
    result:
      name: interestRateHistoryPage
      schema:
        $ref: "#/components/schemas/InterestRateHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getFundingRateHistory
    paramStructure: by-name
    summary: Final funding rates for completed sessions of one perpetual market.
    description: |
      Returns the market's frozen session rates in reverse chronological order
      (most recent first). Each row identifies a completed session and carries the
      venue time of its checkpoint. Predicted offers are excluded. Skipped hours
      and checkpoints with no funding rate produce no row; a frozen zero is retained.
      Use `cursor` for keyset
      pagination — pass the opaque `nextCursor` from the previous page unchanged.
      Keep filters unchanged. Ordering includes a unique source-event tie-breaker
      so records sharing a timestamp are not skipped.
      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ rows, nextCursor, coveredThrough }`; null nextCursor ends traversal.

      `-32602` Invalid params also covers a market that is not a perpetual, a
      `from` not earlier than `to`, and a cursor that is malformed or was issued
      for other filters.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
      - name: from
        required: false
        description: Range start, Unix milliseconds, inclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Range end, Unix milliseconds, exclusive.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep all filters unchanged.
        schema:
          type: string
    result:
      name: fundingRateHistoryPage
      schema:
        $ref: "#/components/schemas/FundingRateHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getMarkPriceHistory
    paramStructure: by-name
    summary: Historical mark prices for one market by ID.
    description: |
      Returns the mark prices ATLAS applied to the market, in reverse
      chronological order (most recent first). Use `cursor` for keyset
      pagination — pass the opaque `nextCursor` from the previous page unchanged.
      Keep filters unchanged. Ordering includes a unique source-event tie-breaker
      so records sharing a timestamp are not skipped.
      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ rows, nextCursor, coveredThrough }`; null nextCursor ends traversal.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: marketId
        required: true
        schema:
          type: integer
          minimum: 0
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep all filters unchanged.
        schema:
          type: string
    result:
      name: markPriceHistoryPage
      schema:
        $ref: "#/components/schemas/MarkPriceHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.getIndexPriceHistory
    paramStructure: by-name
    summary: Historical applied index prices for one asset.
    description: |
      Returns the index prices ATLAS applied for the asset, in reverse
      chronological order (most recent first). Rejected inputs are not
      included. Use
      `cursor` for keyset pagination — pass the opaque `nextCursor` from the
      previous page unchanged. Keep filters unchanged. Ordering includes a
      unique source-event tie-breaker so records sharing a timestamp are not skipped.
      Pagination parameters are flat: `limit` and `cursor`. Returns
      `{ rows, nextCursor, coveredThrough }`; null nextCursor ends traversal.

      `-32602` Invalid params also covers an asset symbol `atlas.getAssets`
      does not list, and a cursor that is malformed or was issued for other
      filters.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: asset
        required: true
        description: Asset symbol, as `atlas.getAssets` lists it in `symbol`.
        schema:
          type: string
          minLength: 1
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page, passed unchanged. Omit for the first page; keep all filters unchanged.
        schema:
          type: string
    result:
      name: indexPriceHistoryPage
      schema:
        $ref: "#/components/schemas/IndexPriceHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: market data
        url: https://testnet.atlas.layerzero.network/market/rpc
  - name: atlas.subscribe
    paramStructure: by-name
    summary: Create one real-time stream subscription.
    description: |
      Establishes a server-push subscription on the current WebSocket connection.
      Each call creates exactly one subscription.
      Multiple subscriptions are created by issuing multiple independent calls.
      The returned `subscriptionId` is used to correlate push messages and cancel
      the subscription with `atlas.unsubscribe`.

      ## Available streams

      | stream         | Required params          | Endpoint              | Description |
      |----------------|--------------------------|-----------------------|-------------|
      | `trades`       | `marketId`               | `/market/ws`   | Individual matched executions |
      | `order_book`   | `marketId` (`interval`)  | `/market/ws`   | Top-N snapshot, then deltas every `interval` |
      | `candles`      | `marketId`, `interval`   | `/market/ws`   | OHLCV candle updates |
      | `ticker`       | `marketId`               | `/market/ws`   | 24h stats + best bid/ask |
      | `mark_price`   | `marketId`               | `/market/ws`   | Mark/index price bundle (perps only) |
      | `bbo`          | `marketId`               | `/market/ws`   | Best bid/offer (price + size) |
      | `orders`       | `accountAddress` (`types`, `afterReportNo`) | `/account/ws` | Order and fill reports of the account |
      | `account`      | `accountAddress` (`types`, `afterReportNo`) | `/account/ws` | Balance, position, payment, wallet state and account reports of the account |
      | `advanced_orders` | `accountAddress`, `strategies` | `/account/ws`    | Parent order updates of the named strategies (private) |

      ## Stream endpoints

      Market-data streams (`trades`, `order_book`, `candles`, `ticker`,
      `mark_price`, `bbo`) are served by `/market/ws`. Account
      streams (`orders`, `account`, `advanced_orders`) are served by
      `/account/ws`.

      The market-data streams, `orders` and `account` are public and require
      no authentication: ATLAS is a DEX and that state is public on-chain, so
      any client may subscribe to any `accountAddress`. The `advanced_orders`
      stream is private. Its pushed method `stream.advancedOrders` does not
      derive its name from the `advanced_orders` selector as every other stream
      does, so subscribe with `stream = advanced_orders`. Before subscribing,
      the same connection must bind the requested account with `auth.signIn`
      (`/account/ws`). A subscribe without that binding is refused `-20002`
      (Authentication required); a connection bound to another account is
      refused `-12010` (Account mismatch). The `OMS-Read` authorization that
      the `atlas.getAdvancedOrders` / `atlas.getAdvancedOrder` HTTP reads use
      does not by itself authorize this WebSocket subscription.

      Which params each stream requires is `x-paramsSchema`
      (`SubscribeParams`): `marketId` for the market streams, plus an optional
      `interval` for order_book and `interval` for candles, and
      `accountAddress` for the account streams (`orders`, `account`,
      `advanced_orders`). Each param below is optional on
      its own; a missing required param is refused with -32602.

      Errors:

      - `-32602` Invalid params: unknown stream, a missing or malformed param the stream requires (marketId for market streams, marketId and interval for candles, accountAddress for account streams), or a missing or unpublished interval (candles, order_book).
      - `-20002` Authentication required: the private `advanced_orders` stream was subscribed without a successful `auth.signIn` binding on this connection.
      - `-12010` Account mismatch: this connection is signed in for a different account than the requested `accountAddress`.
      - `-20008` Symbol not found: market ID is not in the market catalogue.
      - `-20003` Service unavailable: the market catalogue cannot be read; retry with backoff.
      - `-20005` Subscription limit exceeded: this connection already holds the maximum number of subscriptions; unsubscribe one first.
    x-paramsSchema:
      $ref: "#/components/schemas/SubscribeParams"
    x-rateLimit:
      defaultWeight: 5
      overrides:
        - when:
            parameter: accountAddress
            present: true
          weight: 10
    x-subscriptionBinding:
      idResultPath: $.result.subscriptionId
      messages:
        - stream.trades
        - stream.order_book
        - stream.candles
        - stream.ticker
        - stream.mark_price
        - stream.bbo
        - stream.orders
        - stream.account
        - stream.advancedOrders
      lifetime: connection
      resume: false
      snapshotSupported: true
    params:
      - name: stream
        required: true
        description: Stream type to subscribe to.
        schema:
          type: string
          enum:
            - trades
            - order_book
            - candles
            - ticker
            - mark_price
            - bbo
            - orders
            - account
            - advanced_orders
      - name: marketId
        required: false
        description: Market ID returned by atlas.getSymbols. Required for the market streams.
        schema:
          type: integer
          minimum: 0
      - name: symbol
        required: false
        description: |
          Market symbol. Ignored for account-scoped streams; a market stream refuses it.
        schema:
          $ref: "#/components/schemas/Symbol"
      - name: interval
        required: false
        description: |
          Candle interval (`1m` … `1d`), required when stream=candles. Order book delta interval (`50ms`), optional when stream=order_book and defaulting to the first ATLAS offers (`50ms`). Ignored otherwise; an interval ATLAS does not offer is refused with -32602.
        schema:
          $ref: "#/components/schemas/SubscribeInterval"
      - name: accountAddress
        required: false
        description: |
          Account identifier. Required for the `orders` / `account` / `advanced_orders` streams. For the public `orders` and `account` streams any `accountAddress` may be subscribed to with no authentication; `advanced_orders` additionally requires the connection to be signed in for that account with `auth.signIn`. Ignored for market-data streams.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: strategies
        required: false
        description: |
          The parent order strategies to receive, at least one. Required for the `advanced_orders` stream, which never pushes a parent of a strategy not named; ignored otherwise.
        schema:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: "#/components/schemas/AdvancedOrderStrategyType"
      - name: types
        required: false
        description: |
          The frame types to receive, at least one; omitted, every type. `orders` carries `order`, `fill` and `reject`; `account` carries `balance`, `position`, `payment`, `walletState`, `accountReport` and `reject`. A frame of another type is dropped whole (a type the stream never carries matches nothing); `snapshot`, `gapNotice` and `heartbeat` frames always arrive. Ignored for other streams.
        schema:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: "#/components/schemas/ReportFilterType"
      - name: afterReportNo
        required: false
        description: |
          For the `orders` and `account` streams: the last report number the client holds on that stream ("0" for none); each stream numbers its own reports, so a number of one stream means nothing on the other. The subscription then delivers every report of the stream after it, or a `gapNotice` and a `snapshot` when the recording cannot. Omitted, the subscription starts with a `snapshot`. Ignored for other streams.
        schema:
          $ref: "#/components/schemas/ReportNo"
    result:
      name: subscribeResult
      schema:
        type: object
        required:
          - subscriptionId
          - snapshotSupported
        additionalProperties: false
        properties:
          subscriptionId:
            $ref: "#/components/schemas/SubscriptionId"
          snapshotSupported:
            type: boolean
            description: |
              true if the stream delivers a snapshot=true first event immediately after subscription confirmation. `advanced_orders` does, and `orders` and `account` each do when they name no `afterReportNo`: the first frame is that stream's `snapshot`.
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -12010
        message: Account mismatch
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
      - code: -20005
        message: Subscription limit exceeded
    servers:
      - name: market streams
        url: wss://testnet.atlas.layerzero.network/market/ws
      - name: account streams
        url: wss://testnet.atlas.layerzero.network/account/ws
  - name: atlas.unsubscribe
    paramStructure: by-name
    summary: Cancel one active subscription.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: subscriptionId
        required: true
        schema:
          $ref: "#/components/schemas/SubscriptionId"
    result:
      name: unsubscribeResult
      schema:
        type: object
        required:
          - success
        additionalProperties: false
        properties:
          success:
            type: boolean
    errors:
      - code: -20004
        message: Subscription not found
    servers:
      - name: market streams
        url: wss://testnet.atlas.layerzero.network/market/ws
      - name: account streams
        url: wss://testnet.atlas.layerzero.network/account/ws
  - name: atlas.sendRawTransaction
    paramStructure: by-position
    summary: Submit one pre-assembled, pre-signed raw transaction (HTTP or WebSocket).
    description: |
      Submits one signed transaction as its envelope: the client assembles
      `Transaction<Command> {chainId, authority, signer, nonce, command}`, computes its digest
      (Opaque or Typed, the one form the command allows), signs it
      and encodes the signed envelope (see `rawTx`); the server only
      decodes, verifies and executes. This is the only method that takes a
      transaction; a signed message (`enableTrading`'s form `acceptance`,
      `enableBuilder`) is sent to `atlas.sendRawMessage`. ATLAS's wallet grant, which only
      the wallet service may sign, is taken by this method, and its outcome
      is awaited.

      Signing (full rules in `SignatureHex`): the
      scheme byte is `0x01` Opaque or `0x11` Typed; `v` is 0 or 1 and `s`
      is at most half the curve order. Opaque signs
      `keccak256(0x19 0x00 ‖ atlas_validator ‖ 0x00 ‖ 0x01 ‖ salt ‖ keccak256(transaction))`
      (defined in `SignatureHex`): an EIP-191 frame, then the protocol's
      transaction salt `keccak256("atlas")`, the same in every deployment, and
      the hash of the transaction's bytes as `rawTx` lays them out, its chain
      id first.
      Typed signs EIP-712 `AtlasTransaction(uint8 txType,bytes1 sigSuite,<Transaction>
      transaction)` over `<Transaction>(uint32 chainId,address authority,address
      signer,<Nonce> nonce,bytes2 selector,<Command> command)`, with `txType` 0, `sigSuite` the
      scheme byte and the command's selector, under {name `atlas`, version `"1"`, the
      domain chain id the signing wallet chose, which the envelope carries,
      salt `keccak256("atlas")`}; an Opaque envelope carries no domain
      chain id. Every transaction's own `chainId` is its deployment's Atlas
      zone id (see `atlas.getVersion` `signing.chainId`), and a transaction
      for another chain id is rejected `ATLAS_CHAIN_ID_MISMATCH`. `authority`
      is the account whose authority the command exercises: the account the
      command names, or, for a command only the owner key may sign, the main
      account of that account's wallet (for a main account, the account
      itself); a transaction naming any other is
      rejected `AUTHORITY_MISMATCH`. `signer` is the signing key's
      Ethereum address, and a signature that recovers to any other key is
      refused. Each command's EIP-712 encode type and allowed modes are in its `x-signing` block.
      The nonce's form is its slot's mode: the owner key's slot is gapless,
      and an instruction key's slot takes the mode its bind named in
      `nonceMode`. `<Nonce>` is
      `Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)` or
      `Nonce_Increasing(bool Increasing,uint64 time_stamp_nonce)`, its `bool`
      true, and `<Transaction>` is `Transaction_` followed by the nonce's
      variant and the suffix of the command's type. A value of an enum whose
      variants carry fields signs as the struct of its variant,
      `bool <Variant>` true, under the field's own name, and a struct that
      holds one is named after the variants it holds. A published encode type is
      the gapless form; for an increasing nonce replace
      `Transaction_Gapless` with `Transaction_Increasing`,
      `Nonce_Gapless nonce` with `Nonce_Increasing nonce` and the
      `Nonce_Gapless(bool Gapless,uint64 gapless_nonce,uint64 expires_at)`
      definition with
      `Nonce_Increasing(bool Increasing,uint64 time_stamp_nonce)`, which sorts
      in the same place. A command whose type depends on its value publishes
      one string per form, keyed by the variants it holds in field order:
      `spot` or `perp` by the market; for `placeOrder` then `Limit` or
      `Market` by the `orderType` and `Cross` or `Isolated` by the
      `marginMode` (`spotLimitCross` to `perpMarketIsolated`; isolated signs
      `OrderMarginMode_Isolated(bool Isolated,bool hasOpeningMargin,int128 openingMargin)`,
      with `hasOpeningMargin` false and `openingMargin` 0 when the order
      names none); for `cancelOrder` and `replaceOrder` then `OrderId` or
      `ClientOrderId` by the key of `target`. Each field's wire value and mantissa
      scale is in its description under Actions.
      Trading commands, `internalTransfer`, `stake` and `unstake` are Opaque or
      Typed; `setStpLevel`,
      `setInstructionKey`, `rotateOwnerKey`, `createSubAccount`,
      `transfer` and `withdraw` are Typed only. Signed value = integer
      mantissa: `Qty` scale 8, `Price` scale 10, `Amount` scale 12.

      Who may sign: trading commands (place, cancel, cancelAllOrders)
      accept a live trading key bound to that account. The owner key is no
      exception: unless it is itself bound to the account, a trading command
      it signs is refused `TRADING_GRANT_REQUIRED`. `cancelAllOrdersAfter`
      accepts a live trading key of any scope bound to
      that account, and moves the account's one dead-man clock. `moveIsolatedMargin`
      accepts a live trading key with the Full scope.
      `createSubAccount`, `setStpLevel` and `rotateOwnerKey`
      accept the owner key only. `setInstructionKey`, `transfer` and
      `withdraw` accept the owner key of the account's wallet only.
      `internalTransfer`, `stake` and
      `unstake` accept a Trading Only trading key bound to the account; the
      owner key signs one only once bound to the account itself. For commands whose result this call awaits, grant and nonce
      refusals use the corresponding JSON-RPC error code.
      For the publish-only commands listed under Unreported outcomes, later refusals are not returned. The signer is
      recovered from the signature, so a signature over a digest the venue
      does not compute (a different `eip712EncodeType`, domain or field
      encoding) recovers to an unrelated key and is refused
      `TRADING_GRANT_REQUIRED`, even when the owner key signed it. A wallet
      must complete `enableTrading` before it can place orders
      (`ACCOUNT_NOT_ENABLED`).

      Positional envelope: `params: [rawTx]`. One signed
      command per submission. No batch. GTC and IOC are both
      admitted in the PlaceOrder schema. A `market` PlaceOrder carries its own signed
      time in force, `gtc` or `ioc`, with no default: ATLAS derives its price protection from committed prices and market policy, and the unfilled quantity rests (`gtc`) or expires (`ioc`). Without a committed price the order is refused.

      `setInstructionKey` with a bind awaits ATLAS's outcome and returns
      `setInstructionKeyApplied` with `stampedAtMs`, the
      time ATLAS stamped on the bind; a refused bind returns its refusal.
      A bind whose statements accept the Atlas Terms of Use is sent instead,
      with its statements text, to `atlas.sendWalletReadyRequest`, whose
      onboarding service submits it to ATLAS unchanged.
      Removing a key, with `setInstructionKey`, is
      acknowledged once submitted and reports no ATLAS outcome.

      Unreported outcomes: `createSubAccount` is acknowledged once submitted,
      over either transport, with `{"status": "ok"}`;
      ATLAS's later refusal is not reported back, so confirm the effect from
      the account's events before relying on it. `internalTransfer`,
      `transfer` and `withdraw` await ATLAS's outcome:
      `{"status": "ok", "transferId"}` once booked. `moveIsolatedMargin`, `stake`
      and `unstake` await ATLAS's outcome too: `{"status": "ok"}` once ATLAS applies
      the command, or its rejection as a JSON-RPC error with the code of the
      failing check.
      A booked `unstake` starts the pending unstake period; it does not mean
      the funds are available yet. A missing outcome returns `TRADING_WRITE_TIMEOUT`,
      which does not establish whether the command applied. Check account state
      before retrying to avoid applying the command twice.

      HTTP POST `/seq/tx` or WebSocket JSON-RPC at `/seq/ws`. Both accept every public command and answer the same
      result; the WebSocket is optional.

      Successful awaited operations return the command's applied result.
      A confirmed rejection returns `error.code` and `error.message`; once the
      command decodes, an order request's error also echoes its own client
      order id as `error.data.clOrdId`, and a retryable refusal carries
      `error.data.retryAfterMs`.
      Timeout and uncertain submission use distinct error codes and do not
      establish whether the command applied.
      JSON-RPC `id` correlates the response; internal transaction identifier
      correlation is not repeated in the error. The shared error catalog defines each code.
      CancelAllOrdersAfter returns ATLAS receipt/deadline times in nanoseconds.
      `createSubAccount` answers `TransactionSubmitted` once the request is
      submitted; ATLAS's outcome, including the new address, arrives in the
      account-created event committed under the request's transaction
      identifier.
      A schema or signature refusal before submission is a
      JSON-RPC error with a definitive refusal code.

      The advanced-order kinds (`createTpSlOrder`, `updateTpSlOrder`,
      `cancelTpSlOrder`, `createTwapOrder`, `cancelTwapOrder`,
      `cancelAllTwaps`) and the advanced-order key kind
      (`setAdvanceInstructionKey`) are advanced-order requests: each is verified under its own typed domain and its decision is answered before this call returns, as
      `"accepted"` or `{"rejected": reason}` in the result's `result`; a
      result does not by itself mean the request was accepted. ATLAS tells them apart from ATLAS's commands by their command selector.
      After a timeout or a lost answer the outcome is unknown, not refused:
      resend the same signed request rather than re-signing with a new
      nonce. A resend is not promised its first answer, and a nonce refusal
      does not prove the first one applied.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: rawTx
        required: true
        description: |
          `0x`-prefixed hex of one signed transaction envelope. Bytes, in order: the transaction type `0x00`; the scheme byte; the transaction; under a Typed scheme the 8-byte big-endian domain `chainId` (a `u64`, the wallet's chain) the signature was made at; then the proof, its length `65` as a one-byte VLQ count (`0x41`) and the signature `r ‖ s ‖ v`. The transaction is the same bytes under either scheme: `chainId (4 bytes, big-endian, the deployment's Atlas zone id) ‖ authority (20 bytes, the account whose authority the command exercises) ‖ signer (20 bytes) ‖ nonce ‖ command`, the nonce its variant's tag byte then its fields as big-endian `u64`s, and the command its 2-byte selector then its Bounded Canonical Encoding. The Opaque digest preimage ends in the hash of these transaction bytes. Bytes after the proof are refused.
        schema:
          type: string
          pattern: ^0x[0-9a-f]+$
    result:
      name: sendRawTransactionResult
      schema:
        $ref: "#/components/schemas/SendTransactionResult"
    errors:
      - code: -32700
        message: Parse error
      - code: -32600
        message: Invalid request
      - code: -32601
        message: Method not found
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -20002
        message: Authentication required
      - code: -20009
        message: Invalid signature
      - code: -10003
        message: Sender mismatch
      - code: -20001
        message: Rate limit exceeded
      - code: -10006
        message: Ingress busy
      - code: -10007
        message: Ingress unavailable
      - code: -10008
        message: Outcome unavailable
      - code: -10009
        message: Auth unavailable
      - code: -10010
        message: Trading write timeout
      - code: -10011
        message: Publication unknown
      - code: -10013
        message: Unsupported command
      - code: 218
        message: Selector not found
      - code: -10014
        message: Invalid protocol version
      - code: -10015
        message: Command disabled
      - code: 102
        message: Account not found
      - code: 34
        message: Market not found
      - code: 44
        message: Order not found
      - code: 33
        message: Client order id already set
      - code: 32
        message: Order malformed
      - code: 62
        message: Balance exceeded
      - code: 61
        message: Margin exceeded
      - code: 318
        message: Position notional cap exceeded
      - code: 49
        message: Margin mode not permitted
      - code: 38
        message: Order type invalid
      - code: 47
        message: Reduce only invalid
      - code: 288
        message: Reduce only budget exceeded
      - code: 42
        message: Order size out of range
      - code: -11018
        message: Risk unavailable
      - code: 53
        message: Margin unit exit only
      - code: 54
        message: Liquidation active
      - code: 48
        message: Position not found
      - code: 59
        message: Post only take not permitted
      - code: 65
        message: Open order limit exceeded
      - code: 51
        message: Isolated unit limit exceeded
      - code: -11030
        message: Fx unusable
      - code: -11031
        message: Fee state unavailable
      - code: 46
        message: Builder fee out of range
      - code: 40
        message: Price tick invalid
      - code: 43
        message: Order size exceeded
      - code: 205
        message: Asset not found
      - code: -11049
        message: Margin config unavailable
      - code: 9
        message: Amount invalid
      - code: 135
        message: Transfer destination invalid
      - code: 99
        message: Key binding not found
      - code: 93
        message: Dms timeout out of range
      - code: 91
        message: Sub account allowance exceeded
      - code: 206
        message: Bridge withdrawal route not found
      - code: -11095
        message: Unauthorized
      - code: 1
        message: Envelope malformed
      - code: 3
        message: Transaction type not found
      - code: 305
        message: Rate invalid
      - code: -11111
        message: Trading grant required
      - code: 21
        message: Nonce stale
      - code: 23
        message: Nonce too far ahead
      - code: -11114
        message: Not activated
      - code: 20
        message: Nonce malformed
      - code: 22
        message: Nonce too old
      - code: 290
        message: Nonce not next
      - code: 100
        message: Builder fee cap out of range
      - code: 45
        message: Builder fee cap exceeded
      - code: 101
        message: Owner key already set
      - code: 227
        message: Dms round pending
      - code: 98
        message: Key ceiling exceeded
      - code: -11195
        message: Mark unusable
      - code: 30
        message: Wallet pending
      - code: 219
        message: Wallet exit only
      - code: 160
        message: Owner key proof invalid
      - code: 342
        message: Bridge withdrawal below minimum
      - code: 256
        message: Staking asset not permitted
      - code: 158
        message: Unstake pending
      - code: 141
        message: Unstake exceeded
      - code: 27
        message: Power row not found
      - code: 28
        message: Signer key not permitted
      - code: 18
        message: Suite not permitted
      - code: 24
        message: Signer key not found
      - code: -10017
        message: Duplicate request id
    servers:
      - name: signed writes
        url: https://testnet.atlas.layerzero.network/seq/tx
      - name: signed writes (WebSocket)
        url: wss://testnet.atlas.layerzero.network/seq/ws
  - name: atlas.sendWalletReadyRequest
    paramStructure: by-position
    summary: Submit one signed setInstructionKey bind and its statements text to the onboarding service (HTTP or WebSocket).
    description: |
      Submits the `WalletReadyRequest` of one wallet: `kind`, what the
      request asks for; `rawTx`, the canonical encoding of one envelope; and
      `statements`, the full statements text of that envelope's
      `setInstructionKey` bind. The owner key of the wallet signs the bind of
      an app's key once; the same signature binds the key in ATLAS and is the
      owner's acceptance of the Atlas Terms of Use, which its statements
      carry. The app sends this one request: the onboarding service submits the
      bind to ATLAS itself, unchanged. To recover from a timeout, a lost
      answer or a refusal whose cause is gone, the app resends the same
      request.

      Positional envelope: `params: [kind, rawTx, statements]`, in that
      order. Any other shape is refused `-32602` (Invalid params). No method
      assembles an envelope from parts of a request: `rawTx` is the envelope
      exactly as the owner signed it for ATLAS.

      The endpoint checks `kind`, the envelope's bytes as for
      `atlas.sendRawTransaction` (its encoding, its command selector
      `218`, a forbidden suite `18`, and its signature `-20009`) and that its command
      is a `setInstructionKey` bind (any other command `-10013`), then
      forwards `kind`, `rawTx` and `statements` unchanged to the onboarding service, sends none of them to ATLAS, and relays its answer. Without an onboarding service it refuses
      `-10013`.
      From a restricted region, it refuses
      `enableBuilder` with `-20014` before it reads `rawTx`.

      The onboarding service checks, in order: the envelope and its bind; the
      statements, by the grammar and caps of `EnableTrading` (`-32602`),
      before it hashes them; the wallet
      (a Main, or an address that holds only what deposits left there, whose
      key signs); the signature, recovered from the digest it rebuilds from
      the envelope with the commitment of `statements`, never from a digest
      in the request, so a statements text other than the one signed fails
      it (`-20009`); the bind's `expires_at` (`-12023` Signature expired),
      only for a request not yet on record, since a recorded one resumes;
      then the terms line, which must name the version of the Atlas Terms of
      Use in force (`-20010` Unknown terms, `-20011` Terms hash mismatch,
      `-20012` Terms not in force). It records the request. For `enableTrading` it sends the
      unchanged bind and the one-row activation grant concurrently. It records
      the signed stamp when the grant applies, even if the bind is refused,
      subject to the existing valid stamp rule. It answers `enableTradingApplied`
      after both commands apply. For `enableBuilder` it waits for the bind to
      apply before sending the grant, then issues the Builder ID or returns the one
      already issued, and answers `enableBuilderApplied` (an exit-only wallet
      gets its Builder ID and the refusal `157`). Its
      `stampedAtMs` is the time ATLAS stamped on the bind, the start of the
      new key's nonce channels plus the skew, present whenever the onboarding service has it from ATLAS's answer to the bind. A bind ATLAS refuses
      answers with ATLAS's refusal. A resent request
      whose bind ATLAS refuses for its used nonce continues as applied when
      the key reads bound as the bind signs it, is refused when the key reads
      bound otherwise, and while nothing shows the bind yet has no outcome
      (`-10011`) until the bind's `expires_at` passes. The grant carries only the wallet configuration row. Every step repeats harmlessly.

      `kind` picks the onboarding service's path: `enableTrading` makes the wallet
      ready; `enableBuilder` makes the wallet ready and gets the Builder ID,
      the Builder Portal's one owner signature that binds its key. The bind
      signs its kind in its `Request` statement: a `Request` line that names
      another kind than `kind`, or an `enableBuilder` that carries none,
      fails the signature (`-20009`).

      HTTP POST `/seq/tx` or WebSocket JSON-RPC at `/seq/ws`. Both answer the same result; the WebSocket is
      optional.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: kind
        required: true
        description: |
          What the request asks for: `enableTrading`, or `enableBuilder`.
        schema:
          type: string
          enum:
            - enableTrading
            - enableBuilder
      - name: rawTx
        required: true
        description: |
          The owner's signed `setInstructionKey` bind as `atlas.sendRawTransaction` takes it: the same `0x`-prefixed hex of the envelope's bytes, unchanged. Typed only.
        schema:
          type: string
          pattern: ^0x[0-9a-f]+$
      - name: statements
        required: true
        description: |
          The full statements text of the bind, whose commitment the envelope carries: the terms line, then optionally the `Builder` line, then the `Request` line naming `kind`, required for `enableBuilder` and optional for `enableTrading`, each exactly as signed.
        schema:
          type: array
          items:
            $ref: "#/components/schemas/Statement"
    result:
      name: sendWalletReadyRequestResult
      schema:
        oneOf:
          - $ref: "#/components/schemas/EnableTradingResult"
          - $ref: "#/components/schemas/EnableBuilderApplied"
    errors:
      - code: -32700
        message: Parse error
      - code: -32600
        message: Invalid request
      - code: -32601
        message: Method not found
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -20001
        message: Rate limit exceeded
      - code: -20003
        message: Service unavailable
      - code: -20009
        message: Invalid signature
      - code: -10007
        message: Ingress unavailable
      - code: -10011
        message: Publication unknown
      - code: -10013
        message: Unsupported command
      - code: 218
        message: Selector not found
      - code: -10017
        message: Duplicate request id
      - code: 22
        message: Nonce too old
      - code: 100
        message: Builder fee cap out of range
      - code: 101
        message: Owner key already set
      - code: 98
        message: Key ceiling exceeded
      - code: 157
        message: Wallet state transition invalid
      - code: 115
        message: Wallet not found
      - code: 160
        message: Owner key proof invalid
      - code: 18
        message: Suite not permitted
      - code: 290
        message: Nonce not next
      - code: -12023
        message: Signature expired
      - code: -20010
        message: Unknown terms
      - code: -20011
        message: Terms hash mismatch
      - code: -20012
        message: Terms not in force
      - code: -20014
        message: Restricted region
    servers:
      - name: signed writes
        url: https://testnet.atlas.layerzero.network/seq/tx
      - name: signed writes (WebSocket)
        url: wss://testnet.atlas.layerzero.network/seq/ws
  - name: atlas.sendRawMessage
    paramStructure: by-position
    summary: Submit one signed message, enableTrading's acceptance or enableBuilder (HTTP or WebSocket).
    description: |
      Submits one signed message as its bytes (see `rawMessage`): the
      signed-message type `0x00`, a signer, one typed message of the
      protocol's registry of messages, then a typed or opaque credential. A message
      has no nonce; no system
      orders or applies it. The endpoint checks the bytes and, under a
      single-key suite, the signature, then forwards the bytes unchanged to
      the onboarding service, which reads
      every message of the registry: `TermsAcceptance`, the form
      `acceptance` of `enableTrading`, and `EnableBuilder` (see each
      message's schema for what the service does and answers). No method
      assembles a signed message from parts of a request.
      From a restricted region, ATLAS refuses an `EnableBuilder` message with `-20014` once its bytes
      decode.

      Signing: Typed, scheme byte `0x11`, or Opaque, scheme byte `0x01`; a
      policy signs Typed only, and an opaque policy suite is refused as a
      digest mode the message does not permit. `enableTrading`'s acceptance
      is Typed only. An Opaque signature is over
      `keccak256(0x19 0x00 ‖ message_validator ‖ 0x00 ‖ 0x01 ‖ salt ‖
      keccak256(chainId ‖ signer ‖ message))`, `message_validator` the last
      20 bytes of `keccak256("atlas/message/v1")`, `salt` the message
      domain's and `message` the message's selector and its Bounded
      Canonical Encoding, as `rawMessage` lays them out. A Typed signature is EIP-712
      over the message's struct, whose first members are `bytes1 sigSuite`
      (the scheme byte) and `bytes2 selector` (the message's command
      selector), under {name `atlas`, version `"1"`, the `chainId` the
      credential carries, salt `keccak256("atlas/message")`},
      the message domain, never a transaction domain. Each message's encode
      type is in its `x-signing` block. `signer` is the signing key's
      Ethereum address, and a signature that recovers to any other key is
      refused. A message carries its own time, which the service that reads
      it checks against its clock: `TermsAcceptance` its `expiresAt` and
      `EnableBuilder` its `issuedAtMs`.

      The registry of messages, its salt
      (`atlas/protocol/messages@0`) and its message domain are
      provisional.

      HTTP POST `/seq/tx` or WebSocket JSON-RPC at `/seq/ws`. Both answer the same result; the WebSocket is
      optional.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: rawMessage
        required: true
        description: |
          `0x`-prefixed hex of one signed message. Bytes, in order: the signed-message type `0x00`; the scheme byte `0x11`; the 4-byte big-endian `chainId` (a `u32`, the deployment's Atlas zone id); `signer` (20); the message, its 2-byte command selector then the Bounded Canonical Encoding of its struct, which carries no `sigSuite`, no `selector` and no `chainId`; the 8-byte big-endian domain chain id (a `u64`) the signature was made at; then the proof, its length `65` as a one-byte VLQ count (`0x41`) and the signature `r ‖ s ‖ v`. There is no nonce. Bytes after the signature are refused.
        schema:
          type: string
          pattern: ^0x[0-9a-f]+$
    result:
      name: sendRawMessageResult
      schema:
        $ref: "#/components/schemas/SendRawMessageResult"
    errors:
      - code: -32700
        message: Parse error
      - code: -32600
        message: Invalid request
      - code: -32601
        message: Method not found
      - code: -32602
        message: Invalid params
      - code: -32603
        message: Internal error
      - code: -20001
        message: Rate limit exceeded
      - code: -20003
        message: Service unavailable
      - code: -20009
        message: Invalid signature
      - code: -10007
        message: Ingress unavailable
      - code: -10011
        message: Publication unknown
      - code: -10013
        message: Unsupported command
      - code: 1
        message: Envelope malformed
      - code: 218
        message: Selector not found
      - code: 157
        message: Wallet state transition invalid
      - code: 115
        message: Wallet not found
      - code: 160
        message: Owner key proof invalid
      - code: 18
        message: Suite not permitted
      - code: -12023
        message: Signature expired
      - code: -20010
        message: Unknown terms
      - code: -20011
        message: Terms hash mismatch
      - code: -20012
        message: Terms not in force
      - code: -20014
        message: Restricted region
    servers:
      - name: signed writes
        url: https://testnet.atlas.layerzero.network/seq/tx
      - name: signed writes (WebSocket)
        url: wss://testnet.atlas.layerzero.network/seq/ws
  - name: atlas.getOrder
    paramStructure: by-name
    summary: Get one order by order ID.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: orderId
        required: true
        schema:
          $ref: "#/components/schemas/OrderId"
    result:
      name: order
      schema:
        $ref: "#/components/schemas/OrderLookupResult"
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getOrderByClOrdId
    paramStructure: by-name
    summary: Get one order by its account-scoped client order ID.
    description: |
      Returns the same Order object as atlas.getOrder, or null. The key is
      (accountAddress, clOrdId): different accounts may use the same client
      ID, so clOrdId alone is not a complete reference. No symbol or
      exchange-assigned orderId is required.

      A client ID is unique among the account's live orders and is free again
      once its order has ended, so over time it can name several orders. The
      lookup returns the newest of them: the live order when one uses the ID,
      otherwise the most recently placed one. Read an older one by its
      `orderId`. The lookup covers every order of the account ATLAS
      holds, live or ended. A placement ATLAS refused before it assigned an `orderId` is not found. A cancel request's own
      `requestClOrdId` does not identify the order it targets.

      This reads order state, not the outcome of the request that placed the
      order. Null means no order of the account has this ID; it does
      not show that the placement failed.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: accountAddress
        required: true
        description: Account in which the client order ID is resolved.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: clOrdId
        required: true
        description: Client-assigned order identity, not a cancel request's own ID.
        schema:
          $ref: "#/components/schemas/ClientOrderId"
    result:
      name: order
      schema:
        $ref: "#/components/schemas/OrderLookupResult"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getOpenOrders
    paramStructure: by-name
    summary: List open orders, optionally filtered by symbol and account.
    description: |
      Returns one page of open orders, most recent first: `updatedAt`
      descending, then `orderId` as the stable tie-break. Pass `nextCursor`
      back as `cursor`, with the same filters, for the next page; a null
      `nextCursor` ends the traversal. An order that changes between pages
      can move, so a full traversal is not a point-in-time snapshot.
    x-rateLimit:
      defaultWeight: 5
      overrides:
        - when:
            parameter: accountAddress
            present: false
          weight: 40
    params:
      - name: marketId
        required: false
        description: Only this market's rows; the market id atlas.getSymbols returns.
        schema:
          type: integer
          minimum: 0
      - name: accountAddress
        required: false
        description: |
          Account scope. When omitted the query is NOT account-filtered and returns open orders across all accounts. Always pass `accountAddress`.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: limit
        required: false
        description: Number of orders to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: Opaque `nextCursor` from the previous page; omit for the first page.
        schema:
          type: string
    result:
      name: openOrders
      schema:
        $ref: "#/components/schemas/OrderHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getFills
    paramStructure: by-name
    summary: List fill records, optionally filtered by symbol, account and time range.
    description: |
      Returns one page of fills, most recent first: `timestamp` descending,
      with a stable tie-break that keeps both sides of a trade apart. Pass
      `nextCursor` back as `cursor`, with the same filters, for the next
      page; a null `nextCursor` ends the traversal. `from` is inclusive and
      `to` exclusive on `timestamp`; both stay fixed across pages. Pages read a complete history snapshot; `coveredThrough` is how far it covers. The cursor pins that snapshot and expires if the snapshot is withdrawn.
    x-rateLimit:
      defaultWeight: 20
      overrides:
        - when:
            parameter: accountAddress
            present: false
          weight: 40
    params:
      - name: marketId
        required: false
        description: Only this market's rows; the market id atlas.getSymbols returns.
        schema:
          type: integer
          minimum: 0
      - name: limit
        required: false
        description: Number of fills to return. Default 50, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: accountAddress
        required: false
        description: |
          Account scope. When omitted, fills are NOT account-filtered and are returned across all accounts. Always pass `accountAddress`.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: signer
        required: false
        description: |
          Optional signer-attribution filter. `owner` returns only fills from orders the account owner signed; `agent` only those a delegated agent key signed. Omitted includes all recorded rows; either filter excludes service-origin and unknown attribution. Secondary to `accountAddress`.
        schema:
          type: string
          enum:
            - owner
            - agent
      - name: from
        required: false
        description: Inclusive lower bound on `timestamp` in Unix milliseconds; omit for no lower bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Exclusive upper bound on `timestamp` in Unix milliseconds; omit for no upper bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: cursor
        required: false
        description: Opaque `nextCursor` from the previous page; omit for the first page.
        schema:
          type: string
    result:
      name: fillHistoryPage
      schema:
        $ref: "#/components/schemas/FillHistoryPage"
    errors:
      - code: -12015
        message: Unknown account
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getOrderHistory
    paramStructure: by-name
    summary: List terminal-state orders for an account, optionally filtered by symbol.
    description: |
      Returns one page of the latest terminal order states and recorded
      pre-allocation placement refusals, most recent first by `updatedAt`
      and source log identity. Includes filled, cancelled, rejected and
      expired orders, including unfilled IOC/FOK outcomes. Refusals without
      an execution report are outside this history. The live counterpart is
      `atlas.getOpenOrders`. Pass `nextCursor` back as `cursor`, with the
      same filters, for the next page; a null `nextCursor` ends the
      traversal. `from` is inclusive and `to` exclusive on `updatedAt`; both
      stay fixed across pages. `historyId` identifies each returned record;
      `orderId` and `seq` are absent before allocation and `symbol` is null for
      an unknown market. `coveredThrough` is how far the pinned snapshot covers. A cursor expires if its snapshot is withdrawn.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: marketId
        required: false
        description: Only this market's rows; the market id atlas.getSymbols returns.
        schema:
          type: integer
          minimum: 0
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: limit
        required: false
        description: Number of orders to return. Default 50, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: signer
        required: false
        description: |
          Optional signer-attribution filter. `owner` returns only orders the account owner signed; `agent` only those a delegated agent key signed. Omitted includes all recorded rows; either filter excludes service-origin and unknown attribution. Secondary to `accountAddress`.
        schema:
          type: string
          enum:
            - owner
            - agent
      - name: from
        required: false
        description: Inclusive lower bound on `updatedAt` in Unix milliseconds; omit for no lower bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Exclusive upper bound on `updatedAt` in Unix milliseconds; omit for no upper bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: cursor
        required: false
        description: Opaque `nextCursor` from the previous page; omit for the first page.
        schema:
          type: string
    result:
      name: orderHistoryPage
      schema:
        $ref: "#/components/schemas/OrderHistoryPage"
    errors:
      - code: -12015
        message: Unknown account
      - code: -32602
        message: Invalid params
      - code: -20008
        message: Symbol not found
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getFundingHistory
    paramStructure: by-name
    summary: Booked funding payments for an account.
    description: |
      Returns one page of the FUNDING cash legs lazy settlement posted for the
      account, most recent first: one row per booked payment, at the input that
      booked it, never at the session boundary that fixed the charge. The
      booking coordinates are `settlementHeight` and `settlementTsMs`; a
      payment with no booking height makes the read unavailable. `fundingRate`
      is the session's cutoff rate as a signed decimal fraction, and `payment`
      is the amount the booking moved, positive received and negative paid.
      Amounts are display-unit decimal strings. `from` is inclusive and `to`
      exclusive on the booking time; both stay fixed across pages, and an
      account that has not settled the session has no row. Pass `nextCursor`
      back as `cursor`, with the same filters, for the next page; a null
      `nextCursor` ends the traversal. A page pins the history snapshot its first page captured, and a cursor expires if that snapshot is withdrawn. If history cannot be read, the call returns -20003.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        description: Account to query.
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: marketId
        required: false
        description: Only this market's rows; the market id atlas.getSymbols returns.
        schema:
          type: integer
          minimum: 0
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: cursor
        required: false
        description: |
          Opaque `nextCursor` from the previous page; omit for the first page, and keep all filters unchanged.
        schema:
          type: string
      - name: from
        required: false
        description: Inclusive lower bound on the booking time in Unix milliseconds; omit for no lower bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Exclusive upper bound on the booking time in Unix milliseconds; omit for no upper bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
    result:
      name: fundingHistoryPage
      schema:
        $ref: "#/components/schemas/FundingHistoryPage"
    errors:
      - code: -12015
        message: Unknown account
      - code: -20008
        message: Symbol not found
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getOmsDelegateKey
    paramStructure: by-name
    summary: The TP/SL delegate key of one account.
    description: |
      The public key ATLAS signs the account's TP/SL child orders with,
      issued on the first request. Later requests return the same key until
      ATLAS removes its grant; the request after that returns a new key. Public:
      no read authorization. It returns no private key and grants nothing:
      bind its address with `setInstructionKey` (`INSTRUCTION_KEY_SCOPE_REDUCE_ONLY` for TP/SL on a
      live position, `INSTRUCTION_KEY_SCOPE_FULL` for one with an entry), then
      pass it unchanged as `omsDelegateKey` to a `setAdvanceInstructionKey` bind. It does not answer
      whether an instruction key is bound.
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: accountAddress
        required: true
        schema:
          $ref: "#/components/schemas/AccountAddress"
    result:
      name: omsDelegateKey
      schema:
        $ref: "#/components/schemas/OmsDelegateKey"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getAdvancedOrders
    paramStructure: by-name
    summary: One page of an account's advanced orders.
    description: |
      The account's parents of the strategies named in `strategies`, by
      `parentOrderId` ascending, as they stand now: not the receipt of any one
      create, update or cancel. A parent of a strategy not named is never
      returned, so a client only meets the strategies it reads. Spends no
      nonce. Child orders are ordinary orders too, read with the order reads.

      HTTP only, with the header
      `Authorization: OMS-Read <expiresAtMs>:<chainId>:<signatureHex>`:
      a 65-byte recoverable signature, with no scheme byte, by the account's owner key or a
      key bound with `setAdvanceInstructionKey` over `ReadAuthorization(address accountAddress,uint64
      expiresAtMs)` under the advanced-order message domain {name `atlas`, version `1`,
      `chainId`, salt `keccak256("atlas/oms/message")`}. It
      expires at `expiresAtMs` (milliseconds), at most five minutes ahead.

      `minVersion` is a command's `version`: the read answers only once it has caught up to that version, and is refused as -14002 rather than answering
      older state.
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: strategies
        required: true
        description: The strategies to read; at least one.
        schema:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            $ref: "#/components/schemas/AdvancedOrderStrategyType"
      - name: state
        required: false
        description: Only `open` or only `closed` parents; omit for both.
        schema:
          $ref: "#/components/schemas/AdvancedOrderState"
      - name: cursor
        required: false
        description: |
          A `nextCursor`: parents with a higher `parentOrderId`. Omit for the first page.
        schema:
          $ref: "#/components/schemas/Uint64String"
      - name: limit
        required: false
        description: Parents per page. Default 100.
        schema:
          type: integer
          minimum: 1
          maximum: 500
      - name: minVersion
        required: false
        description: The advanced-order version the read must have reached.
        schema:
          $ref: "#/components/schemas/Uint64String"
    result:
      name: advancedOrderPage
      schema:
        $ref: "#/components/schemas/AdvancedOrderPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -14002
        message: Version not projected
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getAdvancedOrder
    paramStructure: by-name
    summary: One advanced order and its child orders.
    description: |
      One parent, of any strategy, as it stands now and what was seen of its
      child orders. Not the receipt of any one request: it cannot recover what a
      given create, update or cancel answered. Spends no nonce.

      Read authorization and `minVersion` as on `atlas.getAdvancedOrders`.
      A parent of another account, or one the signer may not read, is
      -14001.
    x-rateLimit:
      defaultWeight: 5
    params:
      - name: accountAddress
        required: true
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: parentOrderId
        required: true
        schema:
          $ref: "#/components/schemas/Uint64String"
      - name: minVersion
        required: false
        description: The advanced-order version the read must have reached.
        schema:
          $ref: "#/components/schemas/Uint64String"
    result:
      name: advancedOrder
      schema:
        $ref: "#/components/schemas/AdvancedOrderDetail"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20002
        message: Authentication required
      - code: -14001
        message: Unknown advanced order
      - code: -14002
        message: Version not projected
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getTransactionReceipt
    paramStructure: by-name
    summary: Get a signed transaction's receipt by its transaction identifier.
    description: |
      What became of one signed transaction. `committed` once ATLAS applied
      it in the Log, which never unwinds; the receipt carries nothing more
      until the transaction's zone block is final. Null when no applied
      entry carries the txId: it was refused before the Log, refused by
      ATLAS, or not yet recorded. Null alone does not prove the transaction
      will not apply.

      A receipt carries no result and no refusal. Read an account's
      recorded outcomes, including ATLAS's recorded refusals, with
      atlas.getTransactions and its txId filter.

      Public; no authentication is required. An unreadable history returns
      -20003, never null.

      Recovery after -10010 `trading_write_timeout`, -32603 `internal_error`
      or a lost reply:

      1. `committed`: the transaction took effect; do not resend it.
      2. Null: look the txId up with atlas.getTransactions for the acting
         account. A recorded refusal (`error`) means nothing changed; resend
         the signed bytes only when the code is retryable, no higher nonce
         of the key on the same channel has applied (step 3) and the nonce
         has not expired; otherwise fix the cause and sign again with a new
         nonce. No record: resend the identical signed request, with the
         same nonce and signature. A transaction identifier applies at most
         once: if an earlier attempt has applied, or applies first, the
         resend is refused 21 `nonce_not_greater` and has no effect. Do not
         sign the same intent again with a new nonce while the first
         outcome is open: both could apply.
      3. Once a later transaction with the same key and channel (higher
         nonce) has applied, the earlier signed request cannot apply in
         the future.
    x-authRequired: false
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: txId
        required: true
        description: Transaction identifier of the submitted transaction, not its signature hash.
        schema:
          $ref: "#/components/schemas/TxId"
    result:
      name: receipt
      schema:
        $ref: "#/components/schemas/TransactionReceiptResult"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getTransactionByHash
    paramStructure: by-name
    summary: Get a signed transaction and its credential by its transaction identifier.
    description: |
      What one signed transaction is: its signed fields and the credential
      that signed them, decoded from the signed bytes the Log recorded, so
      every field equals what was signed. It answers once any attempt of the
      transaction is recorded, applied or refused by ATLAS; read what it did
      with atlas.getTransactionReceipt.

      Every attempt of one txId carries the same transaction, but the
      credential holds no byte of the txId, so another sender can attach a
      wrong proof to the same transaction. The answer is the first applied
      attempt's, else a recorded refusal of an attempt whose signature
      verified. Null when no such attempt is recorded: it was refused before
      the Log, its signature did not verify, or it is not yet recorded. Null
      does not prove the transaction was never sent.

      Public; no authentication is required. An unreadable history returns
      -20003, never null.
    x-authRequired: false
    x-rateLimit:
      defaultWeight: 1
    params:
      - name: txId
        required: true
        description: Transaction identifier of the submitted transaction, not its signature hash.
        schema:
          $ref: "#/components/schemas/TxId"
    result:
      name: transaction
      schema:
        $ref: "#/components/schemas/SignedTransactionResult"
    errors:
      - code: -32602
        message: Invalid params
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
  - name: atlas.getTransactions
    paramStructure: by-name
    summary: List an account's recorded signed transactions and their outcomes.
    description: |
      Durably recorded signed transactions that act for `accountAddress`,
      with each transaction's recorded outcome.
      Includes recorded ATLAS refusals (`error`). A recorded attempt without
      an applied outcome or refusal is `pending`; receiving a submission at
      ATLAS alone does not create a history record. Advanced-order requests are outside this read's coverage.

      Only these kinds are served: placeOrder, cancelOrder,
      replaceOrder, cancelAllOrders, cancelAllOrdersAfter,
      enableTrading, setStpLevel, createSubAccount, createSignerPolicy,
      internalTransfer, transfer, withdraw, stake, unstake and
      rotateOwnerKey. For any other kind, account listing omits it,
      and filtering by it returns invalid params. Command mappings can be extended
      without changing TransactionRecord or the page envelope.

      Public; no authentication is required. Return only the specified
      account's records.

      Both reads stop at the same point in the committed history. This
      bounds visibility for supported recorded transactions; it does not
      promise a record for every submitted request. Absence alone does not
      prove failure; atlas.getTransactionReceipt describes recovery by txId.

      Filters combine with AND. txId selects zero or one row in the
      account and still returns a page object; an unknown or another
      account's txId returns empty rows, not an error. If the history cannot be read, the call returns -20003, never empty success.

      from is inclusive and to exclusive on immutable createdAt. Equal bounds
      return empty rows. Order by createdAt descending, then txId ascending.
      Pass nextCursor unchanged with the same account and filters; null ends
      traversal. A pending record's outcome can arrive after it was paged.
    x-authRequired: false
    x-rateLimit:
      defaultWeight: 20
    params:
      - name: accountAddress
        required: true
        schema:
          $ref: "#/components/schemas/AccountAddress"
      - name: txId
        required: false
        description: Transaction identifier of the submitted transaction, not its signature hash.
        schema:
          $ref: "#/components/schemas/TxId"
      - name: kind
        required: false
        description: Command kind, its key in the command registry; an unknown or unsupported kind is invalid params.
        schema:
          $ref: "#/components/schemas/CommandKind"
      - name: from
        required: false
        description: Inclusive createdAt lower bound in Unix milliseconds; omit for no lower bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: to
        required: false
        description: Exclusive createdAt upper bound in Unix milliseconds; omit for no upper bound.
        schema:
          $ref: "#/components/schemas/TimestampMs"
      - name: limit
        required: false
        description: Number of rows to return. Default 100, max 500.
        schema:
          type: integer
          minimum: 1
          maximum: 500
          default: 100
      - name: cursor
        required: false
        description: Opaque nextCursor from the previous page; omit for the first page.
        schema:
          type: string
    result:
      name: transactionHistoryPage
      schema:
        $ref: "#/components/schemas/TransactionHistoryPage"
    errors:
      - code: -32602
        message: Invalid params
      - code: -12015
        message: Unknown account
      - code: -20003
        message: Service unavailable
    servers:
      - name: account reads
        url: https://testnet.atlas.layerzero.network/account/rpc
components:
  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.
    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.
        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.
        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.
        maintenanceMargin:
          $ref: "#/components/schemas/Amount"
          description: |
            Maintenance-margin requirement for open positions (the liquidation floor; always <= usedMargin).
        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.
        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.
        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.
    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.
      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.
        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.
    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.
          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.
          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.
        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.
        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.
        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.
        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`.
        health:
          $ref: "#/components/schemas/AccountHealth"
          description: Not returned yet; reserved for a later release. Compute unrealised PnL from the live ticker mark meanwhile.
    AdvanceInstructionKeyChange:
      oneOf:
        - type: object
          required:
            - kind
            - omsDelegateKey
          additionalProperties: false
          properties:
            kind:
              const: bind
            omsDelegateKey:
              $ref: "#/components/schemas/OmsPublicKey"
        - type: object
          required:
            - kind
          additionalProperties: false
          properties:
            kind:
              const: remove
    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.
      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`.
        strategy:
          oneOf:
            - $ref: "#/components/schemas/AdvancedOrderTpSl"
            - $ref: "#/components/schemas/AdvancedOrderTwap"
    AdvancedOrderChild:
      type: object
      required:
        - clOrdId
        - role
        - linked
        - outcomes
      additionalProperties: false
      properties:
        clOrdId:
          $ref: "#/components/schemas/ClientOrderId"
        role:
          type: string
          enum:
            - entry
            - takeProfit
            - stopLoss
            - twapSlice
          description: |
            Which part of the parent's strategy placed it. A client keeps a child whose `role` it does not know.
        linked:
          type: boolean
          description: The child was submitted to ATLAS; not that it rests or filled.
        outcomes:
          type: array
          items:
            $ref: "#/components/schemas/ChildOutcome"
    AdvancedOrderDetail:
      type: object
      required:
        - projectedVersion
        - parent
        - children
      additionalProperties: false
      properties:
        projectedVersion:
          $ref: "#/components/schemas/ProjectedVersion"
        parent:
          $ref: "#/components/schemas/AdvancedOrder"
        children:
          type: array
          description: The parent's child orders and what was seen of them; empty when none.
          items:
            $ref: "#/components/schemas/AdvancedOrderChild"
    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.
    AdvancedOrderPage:
      type: object
      required:
        - projectedVersion
        - items
        - nextCursor
      additionalProperties: false
      properties:
        projectedVersion:
          $ref: "#/components/schemas/ProjectedVersion"
        items:
          type: array
          description: By `parentOrderId`, ascending.
          items:
            $ref: "#/components/schemas/AdvancedOrder"
        nextCursor:
          description: Pass as `cursor` for the next page; null when there is none.
          oneOf:
            - $ref: "#/components/schemas/Uint64String"
            - type: "null"
    AdvancedOrderResult:
      type: object
      required:
        - type
        - accountAddress
        - clOrdId
        - parentOrderId
        - result
        - version
      additionalProperties: false
      properties:
        type:
          type: string
          enum:
            - createAdvancedOrderResult
            - updateAdvancedOrderResult
            - cancelAdvancedOrderResult
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        clOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: This request's own `clOrdId`.
        parentOrderId:
          description: |
            The parent the request created or resolved to; for an `occupied` create, the open parent that holds the market. Null when there is none.
          oneOf:
            - $ref: "#/components/schemas/Uint64String"
            - type: "null"
        result:
          $ref: "#/components/schemas/OmsRequestResult"
        version:
          $ref: "#/components/schemas/OmsVersion"
    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.
    AdvancedOrderState:
      type: string
      enum:
        - open
        - closed
      description: |
        Whether a parent's strategy still works: `open` is a `tpSl` parent `pending`, `armed` or `triggered`, or a `twap` parent `running`; every other status is `closed`.
    AdvancedOrderStrategyType:
      type: string
      enum:
        - tpSl
        - twap
      description: A parent's strategy, as `strategy.type` names it.
    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.
      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.
      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).
          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.
    AssetInfo:
      type: object
      required:
        - assetId
        - symbol
        - decimals
        - withdrawalMinimum
        - withdrawalZones
      additionalProperties: false
      properties:
        assetId:
          description: |
            Numeric asset id, including ZRO at 0.
          type: integer
          minimum: 0
        symbol:
          type: string
          minLength: 1
        decimals:
          description: Fixed-point scale of the asset's raw amounts.
          type: integer
          minimum: 0
          maximum: 18
        withdrawalMinimum:
          $ref: "#/components/schemas/PositiveDecimalString"
          description: |
            The minimum withdrawal of this asset, in the asset's own units, on the venue's 10^-9 withdrawal grid: a `Withdraw` of a lower `amount` is rejected. 0 when none is set.
        withdrawalZones:
          description: |
            The Zero zones a `Withdraw` of this asset may name as its `destinationZone`, ascending: each a configured route, which says nothing of the bridge's live health. Empty when the asset has none.
          type: array
          uniqueItems: true
          items:
            type: integer
            minimum: 0
            maximum: 4294967295
    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.
      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.
        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.
        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).
        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.
        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.
        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.
    BindingBuilderFeeCap:
      type: object
      required:
        - perpBps
        - spotBps
      additionalProperties: false
      description: |
        The highest Builder Fee rates, in bps, the key may sign on the bound account's orders, by market class. Exact decimals, never rounded or clipped.
      properties:
        perpBps:
          $ref: "#/components/schemas/DecimalString"
        spotBps:
          $ref: "#/components/schemas/DecimalString"
    Builder:
      type: object
      required:
        - builderId
        - terms
        - stats
      additionalProperties: false
      description: |
        One public read for the builder dashboard: the Builder ID, the Atlas Terms of Use accepted, and the volume stats. The Builder Tier, payouts and users are private, read with `atlas.getBuilderPayouts` and `atlas.getBuilderUsers`.
      properties:
        builderId:
          $ref: "#/components/schemas/BuilderId"
        terms:
          oneOf:
            - $ref: "#/components/schemas/TermsVersion"
            - type: "null"
          description: |
            The Atlas Terms of Use version this builder's wallet last accepted, through `enableBuilder` or `enableTrading`; `null` when it has accepted none. When `atlas.getTerms` shows a newer version in force, the portal asks the builder to accept it with `enableBuilder`.
        stats:
          oneOf:
            - $ref: "#/components/schemas/BuilderStats"
            - type: "null"
          description: |
            Null while the volumes cannot be read, such as during a fill history outage; retry later. Zeros are never reported in its place.
    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`.
    BuilderPayout:
      type: object
      required:
        - payoutId
        - kind
        - periodStart
        - periodEnd
        - paidAt
        - asset
        - assetId
        - amount
        - creditedAccountAddress
      additionalProperties: false
      properties:
        payoutId:
          type: string
          minLength: 1
        kind:
          type: string
          enum:
            - builder_fee
            - builder_rebate
        periodStart:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            Inclusive start of the payout period, on a UTC period boundary. The payout covers fills whose time is at or after it and before `periodEnd`.
        periodEnd:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            Exclusive end of the payout period, on a UTC period boundary; the next period starts here.
        paidAt:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When the payout was credited to `creditedAccountAddress`.
        asset:
          type: string
          minLength: 1
          description: Asset symbol of the payout, the same string as `AssetInfo.symbol`.
        assetId:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: Asset id of `asset`.
        amount:
          $ref: "#/components/schemas/DecimalString"
        creditedAccountAddress:
          $ref: "#/components/schemas/AccountAddress"
    BuilderPayoutPage:
      type: object
      required:
        - tier
        - rows
        - nextCursor
        - nextPayoutAt
      additionalProperties: false
      properties:
        tier:
          $ref: "#/components/schemas/BuilderTier"
        rows:
          type: array
          description: Newest period first, one row per kind and asset per period.
          items:
            $ref: "#/components/schemas/BuilderPayout"
        nextCursor:
          oneOf:
            - type: string
            - type: "null"
        nextPayoutAt:
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
          description: When the next payout is scheduled; null when none is.
    BuilderStats:
      type: object
      required:
        - interval
        - totals
        - series
        - asOf
      additionalProperties: false
      description: |
        Volumes and `builderFee` are in the Margin Base (the asset every Asset Mark Price is quoted in, e.g. USDT). They count only fills of markets quoted in the Margin Base; fills of any other market are left out.
      properties:
        window:
          $ref: "#/components/schemas/HistoryWindow"
          description: The requested window; absent when the request gave `from`.
        interval:
          $ref: "#/components/schemas/Interval"
        totals:
          type: object
          required:
            - builderVolume
            - appVolume
            - builderFee
            - stampedUsers
            - newUsers
          additionalProperties: false
          properties:
            builderVolume:
              $ref: "#/components/schemas/DecimalString"
            appVolume:
              $ref: "#/components/schemas/DecimalString"
            builderFee:
              $ref: "#/components/schemas/DecimalString"
            stampedUsers:
              $ref: "#/components/schemas/Uint64Number"
            newUsers:
              $ref: "#/components/schemas/Uint64Number"
        series:
          type: array
          maxItems: 1000
          description: Oldest first. A bucket without trades is returned with zeros, never omitted.
          items:
            type: object
            required:
              - t
              - partial
              - builderVolumePerps
              - builderVolumeSpot
              - appVolume
              - builderFee
              - stampedUsers
              - newUsers
            additionalProperties: false
            properties:
              t:
                $ref: "#/components/schemas/TimestampMs"
                description: Bucket start, aligned to UTC. The bucket covers `[t, t + interval)`.
              partial:
                type: boolean
                description: True for the current, unfinished bucket.
              builderVolumePerps:
                $ref: "#/components/schemas/DecimalString"
              builderVolumeSpot:
                $ref: "#/components/schemas/DecimalString"
              appVolume:
                $ref: "#/components/schemas/DecimalString"
              builderFee:
                $ref: "#/components/schemas/DecimalString"
                description: Builder Fee charged on this bucket's App Volume fills.
              stampedUsers:
                $ref: "#/components/schemas/Uint64Number"
                description: Wallets stamped with this Builder ID at the bucket end.
              newUsers:
                $ref: "#/components/schemas/Uint64Number"
                description: Wallets stamped during the bucket.
        asOf:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            The stats cover fills up to this time; later fills are not counted yet.
    BuilderTier:
      type: object
      required:
        - tier
        - rebatePct
        - qualifiedBy
        - stakedZro
        - builderVolume14d
        - nextTier
        - snapshotAt
      additionalProperties: false
      description: |
        The Builder Tier from the latest applied tier snapshot: the higher of the volume tier (14-day Builder Volume) and the staking tier (ZRO staked across the builder's wallet). Below both the lowest volume threshold and the lowest staking threshold there is no tier.
      properties:
        tier:
          oneOf:
            - type: string
            - type: "null"
          description: |
            Builder Tier name from the Builder Tier table, such as `B0`; null before `snapshotAt` or below both the lowest volume threshold and the lowest staking threshold.
        rebatePct:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: The Builder Rebate percentage of the tier; null without a tier.
        qualifiedBy:
          oneOf:
            - type: string
              enum:
                - volume
                - staking
            - type: "null"
          description: |
            Which path gave the tier: `volume` (14-day Builder Volume) or `staking` (ZRO staked). When both reach a tier, the higher one is applied and named here. Null without a tier.
        stakedZro:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: ZRO staked across the builder's wallet at `snapshotAt`; null when `snapshotAt` is null.
        builderVolume14d:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: 14-day Builder Volume at `snapshotAt`; null when `snapshotAt` is null.
        nextTier:
          oneOf:
            - $ref: "#/components/schemas/BuilderTierThreshold"
            - type: "null"
          description: What the next tier needs, by either path.
        snapshotAt:
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
          description: |
            The latest applied tier snapshot that includes this builder; null before one does, such as before the first snapshot or for a builder registered after the latest one.
    BuilderTierTable:
      type: object
      required:
        - tiers
      additionalProperties: false
      description: The published Builder Tier table.
      properties:
        tiers:
          type: array
          description: The tiers, lowest first.
          items:
            $ref: "#/components/schemas/BuilderTierThreshold"
    BuilderTierThreshold:
      type: object
      required:
        - tier
        - rebatePct
        - builderVolume14d
        - stakedZro
      additionalProperties: false
      description: One Builder Tier table entry.
      properties:
        tier:
          type: string
          description: Builder Tier name, such as `B0`.
        rebatePct:
          $ref: "#/components/schemas/DecimalString"
          description: The tier's Builder Rebate percentage.
        builderVolume14d:
          $ref: "#/components/schemas/DecimalString"
          description: 14-day Builder Volume that reaches the tier.
        stakedZro:
          $ref: "#/components/schemas/DecimalString"
          description: Staked ZRO that reaches the tier.
    BuilderUser:
      type: object
      required:
        - walletAddress
        - builderVolume
        - appVolume
        - builderFee
        - builderRebate
      additionalProperties: false
      description: |
        One wallet's part of the builder's flow in the period. Volumes and amounts are in the Margin Base, as in `atlas.getBuilder`.
      properties:
        walletAddress:
          $ref: "#/components/schemas/AccountAddress"
          description: The wallet, named by its Main address.
        stampedAt:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When the wallet was stamped with this Builder ID. Absent when it is not, so it is listed only for trading through the builder's app.
        builderVolume:
          $ref: "#/components/schemas/DecimalString"
          description: |
            The wallet's paid flow in the period, on any app; "0" when the wallet is not stamped with this Builder ID.
        appVolume:
          $ref: "#/components/schemas/DecimalString"
          description: The wallet's flow in the period through orders carrying this Builder ID.
        builderFee:
          $ref: "#/components/schemas/DecimalString"
          description: Builder Fee charged on the wallet's App Volume fills in the period.
        builderRebate:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: |
            Builder Rebate on the wallet's Builder Volume in the period. Null while the period is open: the rebate is computed when it closes.
    BuilderUserPage:
      type: object
      required:
        - periodStart
        - periodEnd
        - rows
        - nextCursor
        - asOf
      additionalProperties: false
      properties:
        periodStart:
          $ref: "#/components/schemas/TimestampMs"
          description: Inclusive start of the payout period the rows cover.
        periodEnd:
          $ref: "#/components/schemas/TimestampMs"
          description: Exclusive end of the payout period the rows cover.
        rows:
          type: array
          description: |
            Every wallet stamped with this Builder ID by the period's end, and every other wallet that traded through the builder's app in the period, by `walletAddress` ascending. The rows of a closed period split that period's `builder_fee` and `builder_rebate` payouts by wallet.
          items:
            $ref: "#/components/schemas/BuilderUser"
        nextCursor:
          description: Pass back as `cursor`, with the same `periodStart`, for the next page; null on the last page.
          oneOf:
            - type: string
            - type: "null"
        asOf:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            The rows cover fills up to this time; later fills are not counted yet. A closed period's rows are final.
    CancelAdvancedOrderResult:
      allOf:
        - $ref: "#/components/schemas/AdvancedOrderResult"
        - properties:
            type:
              const: cancelAdvancedOrderResult
    CancelAllOrdersAfterApplied:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - receivedAtNs
      additionalProperties: false
      properties:
        type:
          type: string
          const: cancelAllOrdersAfterApplied
        txId:
          $ref: "#/components/schemas/TxId"
          description: The transaction identifier.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        receivedAtNs:
          $ref: "#/components/schemas/Uint64String"
        deadlineNs:
          $ref: "#/components/schemas/Uint64String"
          description: Absent when the Post turned the clock off.
    CancelAllOrdersAfterResult:
      oneOf:
        - $ref: "#/components/schemas/CancelAllOrdersAfterApplied"
    CancelAllOrdersApplied:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - cancelledCount
      additionalProperties: false
      properties:
        type:
          type: string
          const: cancelAllOrdersApplied
        txId:
          $ref: "#/components/schemas/TxId"
          description: The transaction identifier.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        cancelledCount:
          type: integer
          minimum: 0
          maximum: 4294967295
    CancelAllOrdersResult:
      oneOf:
        - $ref: "#/components/schemas/CancelAllOrdersApplied"
    CancelApplied:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - requestClOrdId
      additionalProperties: false
      description: |
        ATLAS applied the cancel. Distinguishes request C (`requestClOrdId`)
        from the target. The target echoes the form the request used:
        `origClOrdId` for a cancel by placement identity A, or
        `origOrderId` for a cancel by venue id. Exactly one is present, so
        a zero `origClOrdId` is never overloaded to mean "absent".
        When ATLAS resolved the live order, `orderId` (`{kind}:{id}:{seq}`)
        is the venue identity.
      properties:
        type:
          type: string
          const: cancelApplied
        txId:
          $ref: "#/components/schemas/TxId"
          description: The transaction identifier.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        requestClOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: Cancel-request identity C, the request's own `requestClOrdId`.
        origClOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: |
            Target live-order identity A. Present when the request targeted by A.
        origOrderId:
          $ref: "#/components/schemas/OrderId"
          description: |
            Target venue identity `{kind}:{id}:{seq}` as signed. Present when the request targeted by venue id.
        marketId:
          type: integer
          minimum: 0
          maximum: 8589934591
          description: Resolved market when ATLAS found the live order. Omitted if not resolved.
        orderId:
          $ref: "#/components/schemas/OrderId"
          description: Resolved venue order id `{kind}:{id}:{seq}` when known. Omitted if not resolved.
        seq:
          $ref: "#/components/schemas/Uint64Number"
          description: The per-market order seq in `orderId`; present exactly when `orderId` is.
    CancelOrderResult:
      description: |
        Closed result union for the `cancelOrder` command
        of a signed transaction. Tagged on `type`. Distinguishes
        cancel-request C from target A on applied results.
        Refusals before submission are JSON-RPC errors, not members of this union.
      oneOf:
        - $ref: "#/components/schemas/CancelApplied"
    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`.
        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.
    ChildOutcome:
      description: |
        One thing seen of a child order. `orderId` is ATLAS's order id in the
        parent's market; `revision` and `coreRevision` are ATLAS revisions.

        - `{"answered": {refusal, orderId, coreRevision}}`: ATLAS's answer.
          `refusal` is null when ATLAS took it.
        - `{"filled": {orderId, price, quantity, fact}}`: one fill; `fact` names
          the ATLAS fact by `revision` and `ordinal`.
        - `ended`: the order stopped working.
      oneOf:
        - type: object
          required:
            - answered
          additionalProperties: false
          properties:
            answered:
              type: object
              required:
                - refusal
                - orderId
                - coreRevision
              additionalProperties: false
              properties:
                refusal:
                  oneOf:
                    - type: string
                      enum:
                        - orderRejected
                        - commandRejected
                        - declined
                    - type: "null"
                orderId:
                  oneOf:
                    - $ref: "#/components/schemas/Uint64String"
                    - type: "null"
                coreRevision:
                  oneOf:
                    - $ref: "#/components/schemas/Uint64String"
                    - type: "null"
        - type: object
          required:
            - filled
          additionalProperties: false
          properties:
            filled:
              type: object
              required:
                - orderId
                - price
                - quantity
                - fact
              additionalProperties: false
              properties:
                orderId:
                  $ref: "#/components/schemas/Uint64String"
                price:
                  $ref: "#/components/schemas/DecimalString"
                quantity:
                  $ref: "#/components/schemas/DecimalString"
                fact:
                  type: object
                  required:
                    - revision
                    - ordinal
                  additionalProperties: false
                  properties:
                    revision:
                      $ref: "#/components/schemas/Uint64String"
                    ordinal:
                      type: integer
                      minimum: 0
        - type: string
          const: ended
    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`).
    CommandKind:
      type: string
      description: |
        The name of a command: its key in the command registry, such as `placeOrder`.
    CommittedRef:
      type: object
      required:
        - revision
        - position
      additionalProperties: false
      description: Committed ATLAS revision and recorded completion position.
      properties:
        revision:
          $ref: "#/components/schemas/Uint64String"
          description: Committed ATLAS revision as a uint string.
        position:
          $ref: "#/components/schemas/Uint64String"
          description: Recorded position of the completion as a uint string.
    CreateAdvancedOrderResult:
      allOf:
        - $ref: "#/components/schemas/AdvancedOrderResult"
        - properties:
            type:
              const: createAdvancedOrderResult
    CreateSignerPolicyApplied:
      description: |
        The record the applied `createSignerPolicy` created: the identity the venue assigned it and its threshold and ordered members, the same record `atlas.getSignerPolicy` returns.
      type: object
      required:
        - type
        - txId
        - identity
        - threshold
        - members
      additionalProperties: false
      properties:
        type:
          const: createSignerPolicyApplied
        txId:
          $ref: "#/components/schemas/TxId"
        identity:
          $ref: "#/components/schemas/EvmAddress"
        threshold:
          type: integer
          minimum: 1
          maximum: 10
          description: How many member signatures a proof of the policy needs.
        members:
          type: array
          minItems: 2
          maxItems: 10
          description: The members' addresses, in strictly increasing order.
          items:
            $ref: "#/components/schemas/EvmAddress"
    CreateSignerPolicyResult:
      oneOf:
        - $ref: "#/components/schemas/CreateSignerPolicyApplied"
    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`.
      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.
          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.
    EnableBuilderApplied:
      type: object
      required:
        - type
        - digest
        - accountAddress
        - builderId
        - terms
        - issuedAt
      additionalProperties: false
      description: |
        The terms are recorded, ATLAS has made the wallet ready, and the account holds `builderId`. `digest` and `issuedAt` are those of the request that issued the Builder ID.
      properties:
        type:
          const: enableBuilderApplied
        digest:
          type: string
          pattern: ^0x[0-9a-f]{64}$
          description: |
            The EIP-712 digest the request that issued the Builder ID signed. It is not the bind's transaction identifier, and every later request returns this same one.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        builderId:
          $ref: "#/components/schemas/BuilderId"
          description: Issued on the first request; the same ID on every later one.
        terms:
          $ref: "#/components/schemas/TermsVersion"
          description: The terms this request accepted.
        issuedAt:
          $ref: "#/components/schemas/TimestampMs"
          description: When the request that issued the Builder ID was made, the `issuedAtMs` it signed for the message `EnableBuilder`, or, for the bind of `atlas.sendWalletReadyRequest`, which signs no time, the onboarding service's time when it issued the Builder ID.
        stampedAtMs:
          $ref: "#/components/schemas/TimestampMs"
          description: As `enableTradingApplied`'s, the time ATLAS stamped on the bind the onboarding service submitted for this `atlas.sendWalletReadyRequest`, in Unix milliseconds. Present whenever the onboarding service has it from ATLAS's answer to that bind; absent for the message `EnableBuilder`, and when the bind was only read as applied.
    EnableTradingResult:
      oneOf:
        - type: object
          required:
            - type
            - wallet
            - committed
          additionalProperties: false
          properties:
            type:
              const: enableTradingApplied
            wallet:
              $ref: "#/components/schemas/AccountAddress"
            committed:
              $ref: "#/components/schemas/CommittedRef"
            stamped:
              type: boolean
              description: Whether the wallet's stamp is now the Builder ID of the request's `Builder` line; `false` when it has none. Present on the answer to `enableTrading`.
            stampedAtMs:
              $ref: "#/components/schemas/TimestampMs"
              description: As `setInstructionKeyApplied`'s, the time ATLAS stamped on the bind the onboarding service submitted for this `atlas.sendWalletReadyRequest`, in Unix milliseconds. Present whenever the onboarding service has it from ATLAS's answer to that bind; absent when the bind was only read as applied, and then the key's record gives it.
    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
        vocabulary for every strategy, each using its own subset.

        - `client`: the user cancelled it, or its close order was cancelled by
          the user, Cancel All or Dead-man.
        - `invalid`: no longer valid (the position went flat or flipped before a
          fire, ATLAS refused the close order or cancelled it for no reason below,
          or the entry ended with no fill).
        - `liquidated`: the position was liquidated.
        - `expired`: the close order's time in force ended it before it filled in
          full.
        - `reduceOnlyTrim`: ATLAS trimmed the close order away to fit what the
          position can still close.
        - `forceClose`: ATLAS force-closed the position.
        - `childRejected`: ATLAS definitively refused a TWAP child.
        - `omsKeyRevoked`: the account's ATLAS key was unbound.
        - `marketClosed`: the market closed for good.
        - `positionFlat`: a reduce-only TWAP's position went flat.
    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`.
      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.
    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.
    FeeTier:
      type: object
      required:
        - walletAddress
        - userTier
        - weightedVolume14d
        - nextTier
        - snapshotAt
      additionalProperties: false
      description: |
        The wallet's user tier from the latest tier snapshot: the tier that its 14-day weighted volume, perps volume plus twice spot volume summed over its Main and every Sub, reaches. The tier selects the wallet's taker and maker rates in the fee schedule. A wallet without a valid Builder stamp never reaches the lowest-fee tier.
      properties:
        walletAddress:
          $ref: "#/components/schemas/AccountAddress"
          description: The wallet's Main account.
        userTier:
          oneOf:
            - type: string
            - type: "null"
          description: User tier name, such as `U2`; null before `snapshotAt`.
        weightedVolume14d:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: |
            The wallet's weighted volume over the 14 days to `snapshotAt`: the quote notional of each fill times its market's Market Discount. Null when `snapshotAt` is null.
        nextTier:
          oneOf:
            - type: object
              required:
                - tier
                - weightedVolume14d
              additionalProperties: false
              description: The next user tier and the 14-day weighted volume that it needs.
              properties:
                tier:
                  type: string
                weightedVolume14d:
                  $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: |
            Null at the highest user tier the wallet can reach, which without a valid Builder stamp is the one below the lowest-fee tier, and when `snapshotAt` is null.
        snapshotAt:
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
          description: |
            The latest tier snapshot that includes this wallet; null before one does, such as before the first snapshot or for a wallet opened after the latest one.
    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.
        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.
        orderId:
          type: string
          pattern: ^[0-9]+:[0-9]+$
          description: |
            Opaque composite identifier of the order that this fill belongs
            to. Always `"{marketId}:{seq}"` — the same format for maker fills
            (resting order seq) and taker fills (engine-assigned taker seq).
            Use `liquidity` to distinguish maker
            from taker fills rather than parsing the id string. Absent on a
            `kind` row, which has no order.
        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.
        marketId:
          description: |
            Market id the fill belongs to; `atlas.getSymbols` gives its name.
          type: integer
          minimum: 1
        seq:
          type: integer
          minimum: 0
          description: |
            Order seq, allocated by one counter across every market, as a JSON
            number: the resting order's seq on a
            maker fill and the taker's own order seq on a taker fill. Absent on a
            `kind` row.
          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.
        size:
          $ref: "#/components/schemas/DecimalString"
        fee:
          $ref: "#/components/schemas/DecimalString"
          description: |
            Computed fill fee, exact to 12 decimal places as booked (it is not
            rounded to the fee asset's decimals). On every market, spot and perp,
            the fee is denominated in the market's quote (settlement) asset,
            `quoteAsset` in `atlas.getSymbols`, on buys and sells alike, never in
            the asset received, and is booked to the wallet on the fill. A
            negative maker rate gives a negative fee (rebate) in the same asset.
            On a `kind` row, the fee that cause charged on this market, "0" when
            it charged none.
        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.
        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.
        signerRole:
          type: string
          enum:
            - owner
            - agent
          description: |
            Who authorized the order behind this fill: `owner` (the account's
            own key) or `agent` (a delegated agent key). Attribution is per
            fill side — a maker fill carries the resting order's signer, a
            taker fill the taker's. Absent when no key signed the order, such as
            an order ATLAS places to liquidate, and on a `kind` row. An order ATLAS placed for a TP/SL parent is
            signed by the ATLAS key bound to the account, so it is `agent`; use
            `origin` to tell it apart.
        agentPubkeyX:
          type: string
          description: |
            Delegated agent public-key x-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.
        agentPubkeyY:
          type: string
          description: |
            Delegated agent public-key y-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.
        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.
        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.
        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.
        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.
        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.
        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.
        origin:
          type: string
          enum:
            - entry
            - take_profit
            - stop_loss
    FillHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: |
            Fills, most recent first: `timestamp` descending, with a stable tie-break that keeps both sides of a trade apart.
          items:
            $ref: "#/components/schemas/Fill"
        coveredThrough:
          description: How far the pinned history snapshot covers; null when unknown.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
        nextCursor:
          description: Pass back as `cursor` for the next page; null on the last page.
          oneOf:
            - type: string
            - type: "null"
    FundingHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
      additionalProperties: false
      properties:
        rows:
          type: array
          description: |
            Booking payments, most recent first: `settlementTsMs` descending, then source log position, booking ordinal and journal leg descending.
          items:
            $ref: "#/components/schemas/FundingPayment"
        nextCursor:
          description: |
            Opaque token; pass it back unchanged as `cursor`, with the same filters, for the next page. Null ends the traversal.
          oneOf:
            - type: string
            - type: "null"
    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.
      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.
        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.
        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.
        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.
        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`.
    FundingRate:
      type: object
      required:
        - marketId
        - symbol
        - sessionId
        - rateBps
        - timestamp
      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"
        sessionId:
          $ref: "#/components/schemas/Uint64String"
          description: Closed session counter, not a Unix hour. Skipped hours take no session id.
        rateBps:
          $ref: "#/components/schemas/DecimalString"
          description: Final funding rate frozen for the session, in basis points (signed decimal string).
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: Venue time the session checkpoint committed, Unix milliseconds.
    FundingRateHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Frozen funding rates for completed market sessions, most recent first.
          items:
            $ref: "#/components/schemas/FundingRate"
        nextCursor:
          description: |
            Opaque continuation token. Pass unchanged as `cursor` with the same filters. Null ends traversal; do not infer completion from page length. Preserves the timestamp and unique source-event tie-breaker, not just the last row's timestamp.
          oneOf:
            - type: string
            - type: "null"
        coveredThrough:
          description: |
            Coverage watermark, Unix milliseconds: the history is complete through this time; pagination and filters still limit the rows in this response. Not the last row's timestamp and not a promise of a row at every instant. Newer events may still be arriving. Null when coverage is unknown; if the history cannot be read, the call returns -20003 instead of an empty success.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    HistoryWindow:
      type: string
      enum:
        - day
        - week
        - month
        - all_time
      description: A trailing period ending now; `all_time` starts at the first record.
    IndexPriceHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Applied index prices for the asset, most recent first.
          items:
            $ref: "#/components/schemas/IndexPricePoint"
        nextCursor:
          description: |
            Opaque continuation token. Pass unchanged as `cursor` with the same filters. Null ends traversal; do not infer completion from page length. Preserves the timestamp and unique source-event tie-breaker, not just the last row's timestamp.
          oneOf:
            - type: string
            - type: "null"
        coveredThrough:
          description: |
            Coverage watermark, Unix milliseconds: the history is complete through this time; pagination and filters still limit the rows in this response. Not the last row's timestamp and not a promise of a row at every instant. Newer events may still be arriving. Null when coverage is unknown; if the history cannot be read, the call returns -20003 instead of an empty success.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    IndexPricePoint:
      type: object
      description: |
        One applied index. A live mark carries the index and the code of its quality only, so the rows carry the price, the quality and the time, and null in the other fields (gap `live-index-extra-fields`).
      required:
        - asset
        - assetId
        - quality
        - timestamp
      additionalProperties: false
      properties:
        asset:
          type: string
          minLength: 1
          description: Symbol of the asset the index prices, the same string as `AssetInfo.symbol`.
        assetId:
          type: integer
          minimum: 0
          description: Asset id the index prices.
        indexPrice:
          description: Index price, or null when the asset is unknown to ATLAS.
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
        anchor:
          description: |
            Null: the live mark that carried this index carries no anchor, and neither does the log, so no reader holds one.
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
        freshSources:
          description: |
            Null: the live mark that carried this index carries no count of fresh sources, and neither does the log, so no reader holds one.
          oneOf:
            - type: integer
              minimum: 0
              maximum: 255
            - type: "null"
        regime:
          description: |
            Null: the live mark that carried this index carries no source market session, and neither does the log, so no reader holds one.
          oneOf:
            - type: string
              enum:
                - open
                - pre
                - rth
                - ah
                - overnight
                - dark
                - fut_open
                - fut_halt
                - fut_dark
                - otc_open
                - weekend_thin
                - globex_open
                - auction_open
                - auction_close
                - calc_open
                - official_close
                - fut_settle
                - fixing
                - limit
                - settle
                - weekend
                - holiday
            - type: "null"
        quality:
          type: string
          enum:
            - ok
            - degraded
            - held
        calcTimestamp:
          description: |
            Null: the live mark that carried this index carries no calculator time, and neither does the log, so no reader holds one. `timestamp` is the time ATLAS processed the input that applied it.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: Venue time ATLAS processed the input, Unix milliseconds.
    InstructionKeyScope:
      type: string
      enum:
        - INSTRUCTION_KEY_SCOPE_REDUCE_ONLY
        - INSTRUCTION_KEY_SCOPE_FULL
      description: |
        What a bound trading key may sign on the accounts it is bound to. `INSTRUCTION_KEY_SCOPE_FULL` signs every trading command. `INSTRUCTION_KEY_SCOPE_REDUCE_ONLY` signs cancels, Mass Cancel, the dead-man Post and reduce-only orders; every order it places must be reduce-only. Signed as `uint8`: 2 and 3 in that order; 0 and 1 are retired.
    InterestRate:
      type: object
      required:
        - assetId
        - rateBps
      additionalProperties: false
      properties:
        assetId:
          $ref: "#/components/schemas/Uint64String"
        rateBps:
          $ref: "#/components/schemas/DecimalString"
          description: Committed interest rate in basis points per session, not annualized.
    InterestRateHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          items:
            $ref: "#/components/schemas/InterestRatePoint"
        nextCursor:
          description: Opaque keyset cursor; pass unchanged with the same filters. Null ends traversal.
          oneOf:
            - type: string
            - type: "null"
        coveredThrough:
          description: Ingestion watermark, not the last row timestamp; null when unknown.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    InterestRatePoint:
      type: object
      required:
        - assetId
        - rateBps
        - sessionId
        - timestamp
      additionalProperties: false
      properties:
        assetId:
          $ref: "#/components/schemas/Uint64String"
        rateBps:
          $ref: "#/components/schemas/DecimalString"
          description: Interest rate in basis points per session, not annualized.
        sessionId:
          description: Null for an applied offer; the closed session counter for a frozen rate.
          oneOf:
            - $ref: "#/components/schemas/Uint64String"
            - type: "null"
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: Venue time the offer or session checkpoint committed, Unix milliseconds.
    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.
    IocRemainder:
      description: |
        Explicit IOC remainder fate. Required on every PlaceOrderAccepted.
        Expiry MUST NOT be inferred from a missing field. GTC and FOK use
        notApplicable. IOC uses expired, including expiredSize "0".
      oneOf:
        - $ref: "#/components/schemas/IocRemainderNotApplicable"
        - $ref: "#/components/schemas/IocRemainderExpired"
    IocRemainderExpired:
      type: object
      required:
        - kind
        - expiredSize
      additionalProperties: false
      properties:
        kind:
          type: string
          const: expired
          description: IOC unfilled remainder was expired.
        expiredSize:
          $ref: "#/components/schemas/Size"
          description: |
            Expired remainder as a decimal string. "0" when IOC left nothing to expire. Required even when zero — do not omit the object.
    IocRemainderNotApplicable:
      type: object
      required:
        - kind
      additionalProperties: false
      properties:
        kind:
          type: string
          const: notApplicable
          description: GTC or FOK; IOC remainder expiry does not apply.
    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.
      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.
        position:
          $ref: "#/components/schemas/Position"
          description: The unit's position; its `size` is 0 until its opening order fills.
    JsonRpcError:
      type: object
      required:
        - code
        - message
      additionalProperties: false
      properties:
        code:
          $ref: "#/components/schemas/ErrorCode"
        message:
          type: string
        data:
          $ref: "#/components/schemas/JsonRpcErrorData"
    JsonRpcErrorData:
      type: object
      additionalProperties: false
      minProperties: 1
      description: |
        Optional detail beside the code. Absent when neither field applies; the code alone identifies the error.
      properties:
        clOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: |
            The order request's own client order id: `clientOrderId` of a `placeOrder`, `cancelOrder` or `replaceOrder`. Present only once the request's command decoded, so it is always well formed; a missing or malformed id is never echoed, and the JSON-RPC `id` remains the correlation key.
        retryAfterMs:
          type: integer
          minimum: 0
          description: |
            Milliseconds to wait before sending again, when the service knows it: on a rate-limit error, and on `-10007` (Ingress unavailable), which is returned only when the request was not submitted.
    KeyBinding:
      type: object
      required:
        - accountAddress
        - scope
        - builderFeeCap
        - nonceMode
      additionalProperties: false
      description: |
        The key's binding to one account of the wallet, as its last bind set it, and the nonce record of its key slot there.
      properties:
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        scope:
          $ref: "#/components/schemas/InstructionKeyScope"
        builderFeeCap:
          $ref: "#/components/schemas/BindingBuilderFeeCap"
        nonceMode:
          $ref: "#/components/schemas/NonceMode"
        lastGaplessNonce:
          $ref: "#/components/schemas/Uint64String"
          description: |
            Present only when `nonceMode` is `GAPLESS`: the last gapless nonce the slot accepted, "0" before any. The next request the key signs for this account carries it plus one.
    KeyInfo:
      type: object
      required:
        - instructionKey
        - bindings
      additionalProperties: false
      properties:
        instructionKey:
          $ref: "#/components/schemas/EvmAddress"
          description: The key's address.
        bindings:
          type: array
          description: |
            The key's bindings to the wallet's accounts. A key bound to none of them is not listed.
          items:
            $ref: "#/components/schemas/KeyBinding"
    KeyList:
      type: object
      required:
        - walletAddress
        - ownerAddress
        - ownerKeyNonce
        - keys
      additionalProperties: false
      properties:
        walletAddress:
          $ref: "#/components/schemas/AccountAddress"
        ownerAddress:
          oneOf:
            - $ref: "#/components/schemas/EvmAddress"
            - type: "null"
          description: |
            The address the wallet's current owner signs as: its owner key's address, or the identity of the signer policy that owns it, which `atlas.getSignerPolicy` reads as a policy record. Null when the wallet has no owner, such as after a rotation that left it unset.
        ownerKeyNonce:
          $ref: "#/components/schemas/Uint64String"
          description: |
            The last gapless nonce the wallet's owner key signed that was accepted, "0" before any owner command and again after a rotation. The next owner command carries it plus one.
        keys:
          type: array
          items:
            $ref: "#/components/schemas/KeyInfo"
    LedgerEntry:
      type: object
      required:
        - transactionId
        - legIndex
        - timestamp
        - type
        - causeId
        - asset
        - assetId
        - amountDelta
        - reason
      additionalProperties: false
      properties:
        transactionId:
          type: string
          pattern: ^core:(0|[1-9][0-9]*):(0|[1-9][0-9]*)$
          description: |
            Opaque booked Transaction identity, `core:<revision>:<ordinal>`. The ordinal orders bookings within that revision, not a raw event ordinal. All accounts and legs of one Transaction share this id. Scoped to the served ATLAS history; a reset starts a new history.
        legIndex:
          type: integer
          minimum: 0
          description: The leg's index within its Transaction; with `transactionId`, the entry's identity.
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When the Transaction was booked, in venue time.
        type:
          type: string
          enum:
            - fill
            - deposit
            - withdrawal
            - transfer
            - funding
            - interest
            - liquidation
            - adl
            - force_close
        kind:
          type: string
          enum:
            - internal
            - isolated_add
            - isolated_remove
            - vault_assignment
            - purse_credit
            - stake
            - unstake
            - unstake_release
          description: |
            Set on `transfer` and `liquidation` rows only. With `type`, it says which id `causeId` holds; `atlas.getLedger` has the table.
        causeId:
          type: string
          description: |
            The id of what booked the row. Which id depends on `type`, and on `kind` for a transfer; `atlas.getLedger` has the table.
        asset:
          type: string
          minLength: 1
          description: Asset symbol (e.g. USDT), the same string as `AssetInfo.symbol`.
        assetId:
          type: integer
          minimum: 0
          maximum: 4294967295
        amountDelta:
          $ref: "#/components/schemas/DecimalString"
          description: Signed change to the account's balance in `assetId`.
        reason:
          type: string
          enum:
            - trade
            - fee
            - funding
            - interest
            - transfer
            - deposit
            - withdrawal
            - liquidation
            - adl
            - force_close
          description: Why this leg moved.
        symbol:
          $ref: "#/components/schemas/Symbol"
          description: The market of a trade, funding, liquidation, ADL or force-close leg.
        orderId:
          $ref: "#/components/schemas/OrderId"
          description: The order of a trade or fee leg.
        memo:
          type: string
          pattern: ^0x[0-9a-f]{128}$
          description: |
            Set on `transfer` rows whose `kind` is `internal`: the 64 signed memo bytes, unchanged, as `0x` and 128 lowercase hex characters. All zero means no memo.
    LedgerPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Most recent first.
          items:
            $ref: "#/components/schemas/LedgerEntry"
        nextCursor:
          description: |
            Opaque continuation token preserving the full source position and legIndex. Pass unchanged as `cursor` with the same filters. Null ends traversal; do not infer completion from page length.
          oneOf:
            - type: string
            - type: "null"
        coveredThrough:
          description: |
            Coverage watermark, Unix milliseconds: the history is complete through this time; pagination and filters still limit the rows in this response. Not the last row's timestamp and not a promise of a row at every instant. Newer events may still be arriving. Null when coverage is unknown; if the history cannot be read, the call returns -20003 instead of an empty success.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    LimitImmediateOutcome:
      type: string
      enum:
        - resting
        - filled
        - partial
      description: |
        Immediate match outcome of an accepted limit or market order.
        `resting` — size is on the book (filledSize may be "0").
        `filled` — signed size fully matched immediately.
        `partial` — some size matched immediately; GTC remainder rests,
        IOC remainder is reported on iocRemainder (including filledSize "0"
        when IOC expires the entire size). A killed FOK is also `partial`,
        with filledSize "0", leavesQty "0" and iocRemainder notApplicable.
    Liquidity:
      type: string
      enum:
        - maker
        - taker
      description: |
        Whether the fill added liquidity (maker, resting order) or removed it (taker, aggressive order).
    MarkPriceHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Mark price updates for the market, most recent first.
          items:
            $ref: "#/components/schemas/MarkPricePoint"
        nextCursor:
          description: |
            Opaque continuation token. Pass unchanged as `cursor` with the same filters. Null ends traversal; do not infer completion from page length. Preserves the timestamp and unique source-event tie-breaker, not just the last row's timestamp.
          oneOf:
            - type: string
            - type: "null"
        coveredThrough:
          description: |
            Coverage watermark, Unix milliseconds: the history is complete through this time; pagination and filters still limit the rows in this response. Not the last row's timestamp and not a promise of a row at every instant. Newer events may still be arriving. Null when coverage is unknown; if the history cannot be read, the call returns -20003 instead of an empty success.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    MarkPricePoint:
      type: object
      required:
        - marketId
        - symbol
        - markPrice
        - timestamp
      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"
        markPrice:
          $ref: "#/components/schemas/DecimalString"
          description: Mark price ATLAS applied.
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: Venue time the mark was applied, Unix milliseconds.
    Nonce:
      description: |
        The nonce of the signing key's slot on the command account, in the form of the slot's mode, each value a decimal string (it may exceed 2^53). The command account is the main account of the wallet for a command the owner key signs, and the account a bound key's command acts for. The owner key's slot is always gapless; an instruction key's slot takes the mode its bind named in `nonceMode`, kept until the key is unbound. A nonce of the other form is refused `NONCE_MALFORMED`. A rejected transaction does not consume its nonce. These refusals come back as a specific JSON-RPC error code, except for a command acknowledged on submission only (`createSubAccount`), whose refusal is not returned.
      oneOf:
        - $ref: "#/components/schemas/NonceGapless"
        - $ref: "#/components/schemas/NonceIncreasing"
    NonceGapless:
      type: object
      required:
        - gapless_nonce
        - expires_at
      additionalProperties: false
      description: |
        A gapless slot's nonce: exactly one above the last one the slot accepted, starting at 1 on a new slot (else `NONCE_NOT_NEXT`), with an expiry in Unix seconds that must be after the input time (else `NONCE_TOO_OLD`) and at most 14 days after it (else `NONCE_TOO_FAR_AHEAD`). A rotation to a new owner key, and a new bind, start the counter again, so sign with a short expiry when a key may be bound again or rotated back. `atlas.getKeys` reads the last accepted value.
      properties:
        gapless_nonce:
          $ref: "#/components/schemas/Uint64String"
        expires_at:
          $ref: "#/components/schemas/Uint64String"
    NonceIncreasing:
      type: object
      required:
        - time_stamp_nonce
      additionalProperties: false
      description: |
        An increasing slot's time_stamp_nonce, packed as `(unixMs << 18) | (seq << 8) | channel`: the signing time in Unix milliseconds (45 bits, so the top bit stays zero), a 10-bit count (0..1023) of the requests signed on that channel in that millisecond, 6 reserved bits that must be zero, and a 2-bit nonce channel (0..3). A nonce channel is an independent stream inside one slot: give each independent writer of a key its own channel, and send requests whose order matters on one channel; a channel carries no authority or priority. Sign `max((nowMs << 18) | channel, last + 256)`, where `last` is the last value signed on that channel; a burst past 1 024 per millisecond moves into the next millisecond. It must be non-zero with zero reserved bits (else `NONCE_MALFORMED`), its millisecond `nonce >> 18` must be later than the input time minus the venue's nonce lag (else `NONCE_TOO_OLD`) and earlier than the input time plus its nonce skew (else `NONCE_TOO_FAR_AHEAD`), fixed by the protocol at 60 000 ms and 10 000 ms, and it must be strictly greater than the highest nonce of that channel from an *applied* transaction (else `NONCE_STALE`). A slot's channels start at the time of its bind plus the nonce skew, so wait out the skew after binding a key before signing for it. The lag bound is the only expiry: a rejected transaction's signed bytes stay admissible until the same key applies a higher nonce on the same channel or the nonce falls past the lag bound, whichever comes first.
      properties:
        time_stamp_nonce:
          $ref: "#/components/schemas/Uint64String"
    NonceMode:
      type: string
      enum:
        - GAPLESS
        - INCREASING
      description: |
        How the bound key's requests on the account carry their nonce, fixed when its key slot is created: `GAPLESS` (`0` when signed), a counter that steps by one with an expiry on each request, for a person or a cold signer; `INCREASING` (`1` when signed), a time_stamp_nonce on four channels, for a program that signs often or from several writers.
    OmsDelegateKey:
      type: object
      required:
        - accountAddress
        - omsDelegateKey
        - status
      additionalProperties: false
      properties:
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        omsDelegateKey:
          $ref: "#/components/schemas/OmsPublicKey"
          description: The key ATLAS signs the account's TP/SL child orders with.
        status:
          type: string
          enum:
            - bindable
            - bound
          description: |
            `bindable`: not yet bound on ATLAS; bind it with `setInstructionKey` before binding an instruction key to it with `setAdvanceInstructionKey`. `bound`: the key's grant on ATLAS is live.
    OmsPublicKey:
      type: string
      pattern: ^0x04[0-9a-f]{128}$
      description: |
        One secp256k1 public key in SEC1 uncompressed form: `0x`, `04`, then X and Y as 32-byte big-endian values, in lowercase hex (65 bytes). It must be a point on the curve. Not a coordinate object, a compressed key, an address or a private key.
    OmsRejectReason:
      type: string
      enum:
        - notOwner
        - unknownTarget
        - notOpen
        - occupied
        - underWork
        - reduceOnly
        - account
        - malformed
        - instrument
        - plan
        - delegateKeyNotLive
        - keyNotBound
      description: |
        - `notOwner`: the target is another account's parent.
        - `unknownTarget`: no parent answers to the target, or the parent runs
          another strategy than the request's. Once a parent has
          ended and nothing in flight names it, ATLAS lets it go: it stays
          readable, and a request naming it is `unknownTarget`.
        - `notOpen`: the target's state does not allow the request: an update of
          an ended parent or of a side that has had a close order sent, a cancel
          of one side the parent lacks or that has ended, or a cancel of an
          ended parent ATLAS still holds. Not used for an update adding the side a parent lacks,
          nor for a `both` cancel of a parent with one side.
        - `occupied`: an open TP/SL parent already holds the create's
          `(accountAddress, marketId, marginMode)`, whichever sides either names;
          or, for a TWAP, a running TWAP already holds `(accountAddress, marketId)`.
        - `underWork`: the position the parent would close is being liquidated.
        - `reduceOnly`: account control forbids it.
        - `account`: the account cannot hold advanced orders.
        - `malformed`: a plan breaks a rule stated on `SlotPlan` or `EntryPlan`,
          neither `tp` nor `sl` is sent, there is no position and no `entry`, or
          the Builder Fee (`appBuilderId`, `builderFeeBps`) is invalid.
        - `instrument`: a market the strategy is not offered on.
        - `plan`: a TWAP whose total is not whole lots, is below its starting
          floor, needs a slice above the market's maximum order, or has no mark
          to plan with.
        - `delegateKeyNotLive`: a `setAdvanceInstructionKey` bind names an ATLAS
          delegate key that is not the account's current one.
        - `keyNotBound`: a `setAdvanceInstructionKey` remove names a key not
          bound to the account.
    OmsRequestResult:
      description: |
        `accepted`: ATLAS took in and stored the whole request. It says nothing of whether ATLAS accepted, filled or cancelled a child order. `rejected`: ATLAS refused the whole request and changed nothing; a decided refusal, not an unknown outcome.
      oneOf:
        - type: string
          const: accepted
        - type: object
          required:
            - rejected
          additionalProperties: false
          properties:
            rejected:
              $ref: "#/components/schemas/OmsRejectReason"
    OmsVersion:
      $ref: "#/components/schemas/Uint64String"
      description: |
        The stored advanced-order version that covers this result and its events. Pass it as `minVersion` to `atlas.getAdvancedOrder` or `atlas.getAdvancedOrders`. Not a parent's `parentVersion` and not an ATLAS revision.
    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>`.
        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.
        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.
        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.
          type: integer
          minimum: 0
        seq:
          type: integer
          minimum: 0
          description: |
            Order seq as a JSON number, the seq part of `orderId`. One counter
            allocates it across every market, so it alone identifies the order.
            Present on resting orders (resting order seq) and terminal
            pure-taker order rows (taker's own order seq); absent on a
            `rejected` order, as `orderId` is.
          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.
          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.
        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.
          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.
        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
            (`open` / `partially_filled`), this equals `size − filledSize − trimmedSize`.
            For every terminal status (`filled` / `cancelled` / `expired` / `rejected`),
            this is `"0"`. For cancelled or expired orders the unfilled terminal
            quantity is therefore `size − filledSize − trimmedSize`, not `remainingSize`.
        trimmedSize:
          $ref: "#/components/schemas/DecimalString"
          description: |
            Quantity reduce-only trims removed from this order's leaves in place,
            neither filled nor cancelled. Always present ("0" when never trimmed).
            A reduce-only trim that cancels the order adds nothing to it.
        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.
        createdAt:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When ATLAS accepted the order, or refused it for a `rejected` order.
        updatedAt:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            Last change to the order: a fill, an exchange trim, a cancel, an expiry or ATLAS's refusal.
        signerRole:
          type: string
          enum:
            - owner
            - agent
          description: |
            Who authorized this order: `owner` (the account's own key) or
            `agent` (a delegated agent key). Lets a client filter "orders my
            bot/agent placed" vs "orders I placed as owner" — the primary key
            stays `accountAddress` (the economic owner). Absent when no key signed
            the order, such as an order ATLAS places to liquidate. An order ATLAS placed for a TP/SL
            parent is signed by the ATLAS key bound to the account, so it is
            `agent`; use `origin` to tell it apart.
        agentPubkeyX:
          type: string
          description: |
            Delegated agent public-key x-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.
        agentPubkeyY:
          type: string
          description: |
            Delegated agent public-key y-coordinate as 0x-hex (32 bytes), present only when `signerRole = agent`.
        builderId:
          $ref: "#/components/schemas/BuilderId"
          description: |
            The `builderFee.builderId` the order was placed with. Absent when it charges no Builder Fee.
        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.
        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.
        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.
        origin:
          type: string
          enum:
            - entry
            - take_profit
            - stop_loss
    OrderBookLevel:
      type: object
      required:
        - price
        - size
      additionalProperties: false
      properties:
        price:
          $ref: "#/components/schemas/DecimalString"
        size:
          $ref: "#/components/schemas/DecimalString"
    OrderBookSnapshot:
      type: object
      required:
        - marketId
        - symbol
        - bids
        - asks
        - timestamp
      additionalProperties: false
      properties:
        marketId:
          type: integer
          minimum: 0
          description: Market ID returned by atlas.getSymbols.
        symbol:
          $ref: "#/components/schemas/Symbol"
        bids:
          type: array
          items:
            $ref: "#/components/schemas/OrderBookLevel"
        asks:
          type: array
          items:
            $ref: "#/components/schemas/OrderBookLevel"
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When the book reached this state.
    OrderHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
        - coveredThrough
      additionalProperties: false
      properties:
        rows:
          type: array
          description: |
            Latest terminal state of each allocated order and every recorded pre-allocation placement refusal. Most recent first by source timestamp and physical log identity. Authentication, decoding and other refusals without an execution report are outside this history.
          items:
            $ref: "#/components/schemas/Order"
        coveredThrough:
          description: How far the pinned history snapshot covers; null when unknown.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
        nextCursor:
          description: Pass back as `cursor` for the next page; null on the last page.
          oneOf:
            - type: string
            - type: "null"
    OrderId:
      type: string
      minLength: 1
    OrderLookupResult:
      description: |
        Result of `atlas.getOrder` and `atlas.getOrderByClOrdId`: the order, or null when no order matches the request (not a JSON-RPC error).
      oneOf:
        - $ref: "#/components/schemas/Order"
        - type: "null"
    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
                            prevention, the dead-man deadline, or a venue-initiated cancel).
        "rejected"        — not accepted by the matching engine (e.g., insufficient margin). "expired"         — timed out by the matching engine; the unfilled remainder of
                            an IOC order.
        Note: a market order that fills immediately will transition directly accepted → filled without resting in the "open" state.
    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;
                   ignored price field.
        Stop-loss, take-profit and TWAP are advanced orders (`createTpSlOrder`, `createTwapOrder`), not order types.
    PlaceOrderAccepted:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - clOrdId
        - marketId
        - side
        - orderType
        - size
        - filledSize
        - avgFillPrice
        - leavesQty
        - orderId
        - seq
        - immediateOutcome
        - iocRemainder
      additionalProperties: false
      allOf:
        - if:
            required:
              - orderType
            properties:
              orderType:
                const: limit
          then:
            required:
              - price
          else:
            not:
              required:
                - price
      description: |
        ATLAS accepted the order. Echoes the signed accountAddress, clOrdId A,
        marketId, side, orderType and size, and a limit's price. Includes the
        venue order id `orderId` (`{kind}:{id}:{seq}`), the same string reads and
        streams use. IOC remainder expiry is always explicit. A market order's
        outcome reads as a limit's does: a `gtc` leftover rests (`leavesQty`),
        an `ioc` leftover expires (`iocRemainder`), and a killed `fok` is
        `partial` with filledSize "0", leavesQty "0" and iocRemainder
        notApplicable.
      properties:
        type:
          type: string
          const: placeOrderAccepted
        txId:
          $ref: "#/components/schemas/TxId"
          description: The transaction identifier.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        clOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: Placement identity A from the signed command.
        marketId:
          type: integer
          minimum: 0
          maximum: 8589934591
          description: Signed market, the `marketId` in `orderId`.
        side:
          $ref: "#/components/schemas/Side"
        orderType:
          type: string
          enum:
            - limit
            - market
        price:
          $ref: "#/components/schemas/Price"
          description: The signed price of a limit order; a market order has none.
        size:
          $ref: "#/components/schemas/Size"
          description: Signed size, preserved.
        filledSize:
          $ref: "#/components/schemas/Size"
          description: Size matched immediately. "0" if none.
        avgFillPrice:
          $ref: "#/components/schemas/Price"
          description: |
            Volume-weighted average price of the immediate fills in `filledSize`, as `stream.orders` reports it. "0" if none.
        leavesQty:
          $ref: "#/components/schemas/Size"
          description: Quantity resting on the book after the immediate match, a market order's at its bound price. "0" if none, even when `immediateOutcome` is partial.
        orderId:
          $ref: "#/components/schemas/OrderId"
          description: Venue-assigned order id `{kind}:{id}:{seq}`.
        seq:
          $ref: "#/components/schemas/Uint64Number"
          description: The per-market order seq in `orderId`.
        immediateOutcome:
          $ref: "#/components/schemas/LimitImmediateOutcome"
        iocRemainder:
          $ref: "#/components/schemas/IocRemainder"
    PlaceOrderResult:
      description: |
        Closed result union for the `placeOrder` command of a
        signed transaction. Tagged on `type`. Refusals before submission
        are JSON-RPC errors, not members of this union.
      oneOf:
        - $ref: "#/components/schemas/PlaceOrderAccepted"
    PlatformStats:
      type: object
      required:
        - window
        - volumeQuote
        - tradeCount
        - openInterestValue
        - traders
        - activeBuilders
        - markets
        - asOf
      additionalProperties: false
      description: |
        Totals across every market for one window. Notional values are in the Margin Base (the asset every Asset Mark Price is quoted in, e.g. USDT).
      properties:
        window:
          $ref: "#/components/schemas/HistoryWindow"
        volumeQuote:
          type: object
          required:
            - perps
            - spot
            - total
          additionalProperties: false
          properties:
            perps:
              $ref: "#/components/schemas/DecimalString"
            spot:
              $ref: "#/components/schemas/DecimalString"
            total:
              $ref: "#/components/schemas/DecimalString"
        tradeCount:
          type: object
          required:
            - perps
            - spot
            - total
          additionalProperties: false
          description: Matched fills in the window, each fill counted once. Best effort.
          properties:
            perps:
              $ref: "#/components/schemas/Uint64Number"
            spot:
              $ref: "#/components/schemas/Uint64Number"
            total:
              $ref: "#/components/schemas/Uint64Number"
        openInterestValue:
          $ref: "#/components/schemas/DecimalString"
          description: Open interest across perpetual markets now, not over the window.
        traders:
          $ref: "#/components/schemas/Uint64Number"
          description: Wallets with at least one fill in the window.
        activeBuilders:
          $ref: "#/components/schemas/Uint64Number"
          description: Builder IDs attributed to at least one fill in the window.
        markets:
          $ref: "#/components/schemas/Uint64Number"
          description: Markets open for trading now.
        asOf:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When the background refresh computed these totals; the window ends at this time.
    Policy:
      type: object
      required:
        - identity
        - threshold
        - members
      additionalProperties: false
      description: |
        A signer policy record, as the outcome of its accepted `createSignerPolicy` reported it. A record never changes once created.
      properties:
        identity:
          $ref: "#/components/schemas/EvmAddress"
          description: The identity the venue assigned the policy.
        threshold:
          type: integer
          minimum: 1
          maximum: 10
          description: How many member signatures a proof of the policy needs.
        members:
          type: array
          minItems: 2
          maxItems: 10
          description: The members' addresses, in strictly increasing order.
          items:
            $ref: "#/components/schemas/EvmAddress"
    PortfolioHistory:
      type: object
      required:
        - accountAddress
        - windows
        - coveredThrough
      additionalProperties: false
      properties:
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        windows:
          type: array
          description: |
            Requested windows in day, week, month, all_time order; empty when no usable snapshot is in the complete history.
          items:
            $ref: "#/components/schemas/PortfolioWindow"
        coveredThrough:
          description: |
            Coverage watermark in Unix milliseconds: every window uses history complete through this time. It is not the last point timestamp or a guarantee of continuous valuations. Null before snapshots with available account values exist. Missing account values are skipped. A failed read or a missing volume counter at either endpoint returns the shared service-unavailable error instead of an empty or zero history.
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
    PortfolioPoint:
      type: object
      required:
        - timestamp
        - value
      additionalProperties: false
      properties:
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: Actual snapshot time; boundary values are never interpolated or backdated.
        value:
          $ref: "#/components/schemas/DecimalString"
    PortfolioWindow:
      type: object
      required:
        - window
        - accountValueHistory
        - pnlHistory
        - volume
      additionalProperties: false
      description: |
        Measures changes after the actual baseline observation through the actual end observation. Only snapshots with available account values are usable. The baseline is the last usable snapshot at or before the requested cutoff, or the first usable retained snapshot for partial history. The end is the latest usable snapshot at or before request time in the complete history. The baseline can precede or follow the cutoff. Both endpoints retain their real timestamps. A single observation has zero volume, and zero PnL when its capital counter is available.
      properties:
        window:
          $ref: "#/components/schemas/HistoryWindow"
        accountValueHistory:
          type: array
          description: |
            Economic account value in the Margin Base, including cross and isolated holdings once, without risk haircuts. Oldest first, with the baseline and end included. Interior points are closing usable samples in UTC-aligned display buckets, with actual observation times. Every usable capital-flow observation is also retained, including events with zero net capital change. Missing account values are skipped; no idle observations are filled. Bucket widths stay fixed with no point cap.
          items:
            $ref: "#/components/schemas/PortfolioPoint"
        pnlHistory:
          description: |
            At the same observations as accountValueHistory, account value change minus net non-trading capital inflow since the baseline. Trading fees, maker rebates affect PnL. Deposits, withdrawals, account transfers and non-trading payouts, including builder, referral, broker and reward credits, are capital. The baseline point is zero. Null when any selected observation lacks its cumulative capital counter; equity and volume remain available. An empty array means there are no snapshots.
          oneOf:
            - type: array
              items:
                $ref: "#/components/schemas/PortfolioPoint"
            - type: "null"
        volume:
          $ref: "#/components/schemas/DecimalString"
          description: |
            Actual, unweighted executed quote notional for the requested account, converted to the Margin Base at execution time, after the baseline through the end. Computed from their cumulative counters. all_time measures change since the first usable retained snapshot: counters of 100 then 150 give volume 50, not 150.
    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.
        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.
        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.
        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.
        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).
        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.
        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).
    PositiveDecimalString:
      type: string
      pattern: ^[0-9]+(\.[0-9]+)?$
    Price:
      type: string
      pattern: ^[0-9]+(\.[0-9]+)?$
    ProjectedVersion:
      $ref: "#/components/schemas/Uint64String"
      description: The advanced-order version this read was answered at; at least the `minVersion` asked for.
    ReplaceOrderApplied:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - requestClOrdId
        - marketId
        - orderId
        - seq
        - filledSize
        - avgFillPrice
        - leavesQty
        - immediateOutcome
        - iocRemainder
      additionalProperties: false
      description: |
        ATLAS removed the target order and admitted the replacement as a new order with its own `orderId`, behind every order resting at its price. The target echoes the form the request used: exactly one of `origClOrdId` and `origOrderId`.
      properties:
        type:
          type: string
          const: replaceOrderApplied
        txId:
          $ref: "#/components/schemas/TxId"
          description: The transaction identifier.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        requestClOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: The request's `requestClOrdId`, which the new order keeps as its `clOrdId`.
        origClOrdId:
          $ref: "#/components/schemas/ClientOrderId"
          description: The replaced order's identity A. Present when the request targeted by A.
        origOrderId:
          $ref: "#/components/schemas/OrderId"
          description: The replaced order's venue id as signed. Present when the request targeted by venue id.
        marketId:
          type: integer
          minimum: 0
          maximum: 8589934591
        orderId:
          $ref: "#/components/schemas/OrderId"
          description: Venue order id `{kind}:{id}:{seq}` of the new order.
        seq:
          $ref: "#/components/schemas/Uint64Number"
          description: The per-market order seq in `orderId`.
        filledSize:
          $ref: "#/components/schemas/Size"
          description: Size of the new order matched immediately. "0" if none.
        avgFillPrice:
          $ref: "#/components/schemas/Price"
          description: Volume-weighted average price of the immediate fills in `filledSize`. "0" if none.
        leavesQty:
          $ref: "#/components/schemas/Size"
          description: Quantity of the new order resting on the book after the immediate match. "0" if none.
        immediateOutcome:
          $ref: "#/components/schemas/LimitImmediateOutcome"
        iocRemainder:
          $ref: "#/components/schemas/IocRemainder"
    ReplaceOrderResult:
      oneOf:
        - $ref: "#/components/schemas/ReplaceOrderApplied"
    ReportFilterType:
      type: string
      enum:
        - order
        - fill
        - balance
        - position
        - payment
        - walletState
        - accountReport
        - reject
    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.
    RotateOwnerKeyResult:
      oneOf:
        - type: object
          required:
            - type
            - txId
            - wallet
          additionalProperties: false
          properties:
            type:
              const: rotateOwnerKeyApplied
            txId:
              $ref: "#/components/schemas/TxId"
            wallet:
              $ref: "#/components/schemas/AccountAddress"
    SendRawMessageResult:
      description: Result union of the signed messages `atlas.sendRawMessage` takes.
      oneOf:
        - $ref: "#/components/schemas/EnableTradingResult"
        - $ref: "#/components/schemas/EnableBuilderApplied"
    SendTransactionResult:
      description: Result union for every publicly admitted signed transaction command.
      oneOf:
        - $ref: "#/components/schemas/PlaceOrderResult"
        - $ref: "#/components/schemas/CancelOrderResult"
        - $ref: "#/components/schemas/ReplaceOrderResult"
        - $ref: "#/components/schemas/CancelAllOrdersResult"
        - $ref: "#/components/schemas/CancelAllOrdersAfterResult"
        - $ref: "#/components/schemas/SetInstructionKeyResult"
        - $ref: "#/components/schemas/SetInstructionKeyBindResult"
        - $ref: "#/components/schemas/SetWalletConfigBatchedResult"
        - $ref: "#/components/schemas/EnableTradingResult"
        - $ref: "#/components/schemas/SetStpLevelResult"
        - $ref: "#/components/schemas/CreateAdvancedOrderResult"
        - $ref: "#/components/schemas/UpdateAdvancedOrderResult"
        - $ref: "#/components/schemas/CancelAdvancedOrderResult"
        - $ref: "#/components/schemas/SetAdvanceInstructionKeyResult"
        - $ref: "#/components/schemas/RotateOwnerKeyResult"
        - $ref: "#/components/schemas/CreateSignerPolicyResult"
        - $ref: "#/components/schemas/EnableBuilderApplied"
        - $ref: "#/components/schemas/TransactionSubmitted"
    SetAdvanceInstructionKeyResult:
      type: object
      required:
        - type
        - accountAddress
        - instructionKey
        - change
        - result
        - version
      additionalProperties: false
      description: |
        `accepted`: the binding is stored, in force while `omsDelegateKey` is live on ATLAS, or removed. `{"rejected": "delegateKeyNotLive"}` or `{"rejected": "keyNotBound"}`: nothing changed. The request's fields are echoed whatever the result.
      properties:
        type:
          const: setAdvanceInstructionKeyResult
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        instructionKey:
          $ref: "#/components/schemas/EvmAddress"
        change:
          $ref: "#/components/schemas/AdvanceInstructionKeyChange"
        result:
          $ref: "#/components/schemas/OmsRequestResult"
        version:
          $ref: "#/components/schemas/OmsVersion"
    SetInstructionKeyApplied:
      type: object
      required:
        - type
        - txId
        - accountAddress
        - stampedAtMs
      additionalProperties: false
      description: |
        ATLAS applied a `setInstructionKey` bind. `stampedAtMs` is the time ATLAS stamped on the bind, in Unix milliseconds: the time a new slot's channels start from, plus the nonce skew (see `Nonce`).
      properties:
        type:
          type: string
          const: setInstructionKeyApplied
        txId:
          $ref: "#/components/schemas/TxId"
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        stampedAtMs:
          $ref: "#/components/schemas/TimestampMs"
    SetInstructionKeyBindApplied:
      type: object
      required:
        - type
        - wallet
        - committed
      additionalProperties: false
      description: |
        The durable history outcome of a wallet's owner-signed `setInstructionKey` bind, which has no gateway answer to wait on. `wallet` is the account the bind names.
      properties:
        type:
          type: string
          const: setInstructionKeyApplied
        wallet:
          $ref: "#/components/schemas/AccountAddress"
        committed:
          $ref: "#/components/schemas/CommittedRef"
    SetInstructionKeyBindResult:
      oneOf:
        - $ref: "#/components/schemas/SetInstructionKeyBindApplied"
    SetInstructionKeyResult:
      oneOf:
        - $ref: "#/components/schemas/SetInstructionKeyApplied"
    SetStpLevelResult:
      oneOf:
        - type: object
          required:
            - type
            - wallet
            - level
            - committed
          additionalProperties: false
          properties:
            type:
              const: setStpLevelApplied
            wallet:
              $ref: "#/components/schemas/AccountAddress"
            level:
              $ref: "#/components/schemas/StpLevel"
            committed:
              $ref: "#/components/schemas/CommittedRef"
    SetWalletConfigBatchedApplied:
      type: object
      required:
        - type
        - wallet
        - committed
      additionalProperties: false
      description: |
        The applied outcome of a `SetWalletConfigBatched` carrying exactly one row whose `walletState` is `1` (active), the wallet service's activation of one wallet. `wallet` is that row's main account. A pure activation also returns this result from `atlas.sendRawTransaction`.
      properties:
        type:
          type: string
          const: setWalletConfigBatchedApplied
        wallet:
          $ref: "#/components/schemas/AccountAddress"
        committed:
          $ref: "#/components/schemas/CommittedRef"
    SetWalletConfigBatchedResult:
      oneOf:
        - $ref: "#/components/schemas/SetWalletConfigBatchedApplied"
    Side:
      type: string
      enum:
        - buy
        - sell
      description: |
        Order or trade direction. "buy" = bid; "sell" = ask.
    SignedTransaction:
      type: object
      additionalProperties: false
      description: |
        A signed transaction and the credential that signed it, decoded from the signed envelope the Log recorded, with the command's signed bytes and the envelope itself. The SDKs decode `command` with their wire codecs.
      required:
        - txId
        - chainId
        - authority
        - signer
        - nonce
        - kind
        - command
        - sigSuite
        - domainChainId
        - proof
        - envelope
      properties:
        txId:
          $ref: "#/components/schemas/TxId"
        chainId:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: The Atlas zone id the transaction names.
        authority:
          $ref: "#/components/schemas/AccountAddress"
          description: The account whose authority the transaction exercises.
        signer:
          $ref: "#/components/schemas/EvmAddress"
          description: The key or signer policy the transaction names as its signer.
        nonce:
          $ref: "#/components/schemas/Nonce"
        kind:
          type: string
          minLength: 1
          description: |
            The command's kind, its name with a lowercase first letter, as `atlas.getTransactions` names a public kind (`transfer`).
        command:
          type: string
          pattern: ^0x([0-9a-f]{2})+$
          description: |
            The command's bytes exactly as signed: its 2-byte command selector, then its Bounded Canonical Encoding.
        sigSuite:
          type: string
          pattern: ^0x[0-9a-f]{2}$
          description: |
            The suite byte: the digest mode in its high nibble and the verification scheme in its low one (`0x11` Typed with one key, `0x12` Typed with a signer policy, `0x01` Opaque with one key).
        domainChainId:
          description: |
            The EIP-712 domain chain id a Typed credential was made at; null for an Opaque one, which carries none.
          oneOf:
            - $ref: "#/components/schemas/Uint64String"
            - type: "null"
        proof:
          type: string
          pattern: ^0x([0-9a-f]{2})+$
          description: |
            The proof bytes: a 65-byte signature `r||s||v` for one key, or each signing member's index byte and 65-byte signature for a signer policy.
        envelope:
          type: string
          pattern: ^0x([0-9a-f]{2})+$
          description: |
            The whole signed envelope as the Log recorded it, the bytes `atlas.sendRawTransaction` took: a reader can verify the credential over them itself.
    SignedTransactionResult:
      description: |
        Result of `atlas.getTransactionByHash`: the transaction of its first applied attempt, else of a recorded refusal whose signature verified, or null when no such attempt is recorded. Null does not prove the transaction was never sent.
      oneOf:
        - $ref: "#/components/schemas/SignedTransaction"
        - type: "null"
    SignerPolicyLookupResult:
      description: |
        Result of `atlas.getSignerPolicy`: the policy record, or null when ATLAS holds no record under that identity.
      oneOf:
        - $ref: "#/components/schemas/Policy"
        - type: "null"
    SigningInfo:
      type: object
      required:
        - chainId
        - transactionDomain
      additionalProperties: false
      properties:
        chainId:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: |
            The deployment's Atlas zone id: the `chainId` every transaction and signed message for this deployment carries as its first signed field. A verifier refuses one for another chain id.
        transactionDomain:
          $ref: "#/components/schemas/TransactionSigningDomain"
    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`.
      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.
        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.
    SlotState:
      description: |
        - `pending`: waiting for the entry's first fill.
        - `armed`: watching the trigger.
        - `{"faulted": "positionNotOnQtyGrid"}`: crossed, but the position is
          not on the order quantity grid, so no exact close exists; still watched.
        - `triggered`: ATLAS accepted its close order, which still works. Its
          fills, partial ones included, count for this side.
        - `complete`: the close order filled in full, or filled and the position
          is flat.
        - `{"cancelled": code}`: ended without a close order, ATLAS refused it, or
          the close order was cancelled; a fill before the cancel still counts.

        Once a side fires, its close order is an ordinary reduce-only order placed
        for the position at that moment. The ATLAS does not cancel it when the
        position later goes flat or flips; only cancelling the parent does. So if
        you close the position by other means, a resting close order can still
        fill and open a position the other way: cancel the parent or the close
        order if you do not want that.
      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"
    StakingState:
      type: object
      required:
        - walletAddress
        - stakingTier
        - stakedZro
        - nextTier
        - snapshotAt
      additionalProperties: false
      description: |
        The wallet's staking tier from the latest applied tier snapshot: the tier that the ZRO staked across its Main and every Sub reaches. The tier sets the staking discount on the wallet's fees. Each account's own staked balance and pending unstake are `place: staked` rows of `atlas.getBalances`.
      properties:
        walletAddress:
          $ref: "#/components/schemas/AccountAddress"
          description: The wallet's Main account.
        stakingTier:
          oneOf:
            - type: string
            - type: "null"
          description: Staking tier name, such as `S2`; null before `snapshotAt`.
        stakedZro:
          oneOf:
            - $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: ZRO staked across the wallet at `snapshotAt`; null when `snapshotAt` is null.
        nextTier:
          oneOf:
            - type: object
              required:
                - tier
                - stakedZro
              additionalProperties: false
              description: The next staking tier and the ZRO staked across the wallet that it needs.
              properties:
                tier:
                  type: string
                stakedZro:
                  $ref: "#/components/schemas/DecimalString"
            - type: "null"
          description: Null at the highest staking tier and when `snapshotAt` is null.
        snapshotAt:
          oneOf:
            - $ref: "#/components/schemas/TimestampMs"
            - type: "null"
          description: |
            The latest applied tier snapshot that includes this wallet; null before one does, such as before the first snapshot or for a wallet opened after the latest one.
    Statement:
      type: object
      required:
        - label
        - value
      additionalProperties: false
      description: One line the owner reads and accepts with a signature.
      properties:
        label:
          type: string
          description: At most 64 UTF-8 bytes.
        value:
          type: string
          description: At most 256 UTF-8 bytes.
    StpLevel:
      type: string
      enum:
        - account
        - wallet
      description: |-
        Which of a taker's own orders self-trade prevention cancels: `account`
        cancels a crossing maker of the same account; `wallet` cancels a crossing
        maker of any account in the same wallet.
    SubscribeInterval:
      type: string
      pattern: ^(1m|5m|15m|1h|4h|1d|0ms|[1-9][0-9]*ms)$
      examples:
        - 1m
        - 1h
        - 50ms
      description: |
        For candles, a candle Interval (`1m`, `5m`, `15m`, `1h`, `4h`, `1d`). For order_book, how often deltas arrive, such as `50ms`, or `0ms` for real time: a delta for each ATLAS revision as it commits. The service accepts the intervals its deployment publishes (currently `0ms` and `50ms`), each `0ms` or dividing or a multiple of the 100ms snapshot period, and refuses others with -32602.
    SubscribeParams:
      description: |
        The params `atlas.subscribe` requires, by stream. Params outside a stream's group are ignored, except a market stream refuses a symbol selector.
      oneOf:
        - title: Market stream
          type: object
          required:
            - stream
            - marketId
          not:
            required:
              - symbol
          properties:
            stream:
              type: string
              enum:
                - trades
                - ticker
                - mark_price
                - bbo
            marketId:
              type: integer
              minimum: 0
        - title: Order book
          type: object
          required:
            - stream
            - marketId
          not:
            required:
              - symbol
          properties:
            stream:
              type: string
              enum:
                - order_book
            marketId:
              type: integer
              minimum: 0
            interval:
              $ref: "#/components/schemas/SubscribeInterval"
        - title: Candles
          type: object
          required:
            - stream
            - marketId
            - interval
          not:
            required:
              - symbol
          properties:
            stream:
              type: string
              enum:
                - candles
            marketId:
              type: integer
              minimum: 0
            interval:
              $ref: "#/components/schemas/SubscribeInterval"
        - title: Account reports
          type: object
          required:
            - stream
            - accountAddress
          properties:
            stream:
              type: string
              enum:
                - orders
                - account
            accountAddress:
              $ref: "#/components/schemas/AccountAddress"
            types:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                $ref: "#/components/schemas/ReportFilterType"
            afterReportNo:
              $ref: "#/components/schemas/ReportNo"
        - title: Advanced orders
          type: object
          required:
            - stream
            - accountAddress
            - strategies
          properties:
            stream:
              type: string
              enum:
                - advanced_orders
            accountAddress:
              $ref: "#/components/schemas/AccountAddress"
            strategies:
              type: array
              minItems: 1
              uniqueItems: true
              items:
                $ref: "#/components/schemas/AdvancedOrderStrategyType"
    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
    SymbolInfo:
      type: object
      required:
        - symbol
        - baseAsset
        - quoteAsset
        - tickSize
        - lotSize
        - minOrderSize
        - maxOrderSize
        - minOrderNotional
        - maxOrderNotional
        - passiveCollarBps
        - aggressiveCollarBps
        - baseDecimals
        - quoteDecimals
        - priceScale
        - qtyScale
        - multiplier
        - status
        - mode
      additionalProperties: false
      properties:
        symbol:
          type: string
          minLength: 1
          description: Catalogue label shared by markets with the same published symbol.
        marketId:
          description: |
            Market kind tag above the 32-bit identifier (spot 0, perpetual 1). Convert to the tagged market reference when signing order transactions; absent only briefly while a new market is being listed. The reserved market slot 0 is never listed.
          type: integer
          minimum: 0
        baseAsset:
          type: string
          minLength: 1
        baseAssetId:
          description: |
            Numeric asset id of the base asset. Use it to map balances onto this market's base leg; `baseAsset` is the display symbol only. Omitted only before the id is resolved (bootstrap).
          type: integer
          minimum: 0
        quoteAsset:
          type: string
          minLength: 1
        quoteAssetId:
          description: |
            Numeric asset id of the quote/settlement asset. Omitted until resolved.
          type: integer
          minimum: 0
        kind:
          type: string
          enum:
            - perp
            - spot
        tickSize:
          $ref: "#/components/schemas/Price"
        lotSize:
          $ref: "#/components/schemas/Size"
        minOrderSize:
          $ref: "#/components/schemas/Size"
        maxOrderSize:
          $ref: "#/components/schemas/Size"
        minOrderNotional:
          description: Minimum order notional, formatted with quote-asset decimals.
          $ref: "#/components/schemas/PositiveDecimalString"
        maxOrderNotional:
          description: Maximum order notional, formatted with quote-asset decimals.
          $ref: "#/components/schemas/PositiveDecimalString"
        passiveCollarBps:
          description: |
            Limit collar passive width in basis points: how far from mark a limit may rest, below it for a buy and above it for a sell.
          type: integer
          minimum: 0
          maximum: 9999
        aggressiveCollarBps:
          description: |
            Limit collar aggressive width in basis points: how far through mark a limit may reach, above it for a buy and below it for a sell. A market order binds at this edge.
          type: integer
          minimum: 0
          maximum: 9999
        baseDecimals:
          description: Precision (decimal places) of the base asset.
          type: integer
          minimum: 0
          maximum: 18
        quoteDecimals:
          description: Precision (decimal places) of the quote/settlement asset.
          type: integer
          minimum: 0
          maximum: 18
        priceScale:
          description: |
            Listing price scale: the decimal places of `tickSize`. Listing and display only; a signed price is always 10 decimal places.
          type: integer
          minimum: 0
          maximum: 10
        qtyScale:
          description: |
            Listing quantity scale: the decimal places of `lotSize`. Listing and display only; a signed quantity is always 8 decimal places.
          type: integer
          minimum: 0
          maximum: 8
        multiplier:
          description: |
            Listing multiplier M (up to 8 decimal places): an order's notional is `size × price × multiplier`. `1` when the market has none.
          $ref: "#/components/schemas/PositiveDecimalString"
        status:
          type: string
          enum:
            - ACTIVE
            - INACTIVE
          description: |
            Market status: "ACTIVE" while trading is enabled on the market, "INACTIVE" otherwise. (Uppercase wire form.)
        mode:
          type: string
          enum:
            - NORMAL
            - REDUCE_ONLY
            - CLOSE_ONLY
          description: |
            Market trading mode. Always present; `NORMAL` when no other mode applies.
        imrBps:
          description: Initial Margin Requirement in bps. Max leverage = 10000 / imrBps.
          type: integer
          minimum: 1
        mmrBps:
          description: Maintenance Margin Requirement in bps. Liquidation triggers when equity drops below mmrBps × notional.
          type: integer
          minimum: 0
        liquidationPenaltyBps:
          description: |
            Liquidation fee on liquidated notional, in bps. It is an exchange fee and is not paid into the insurance fund.
          type: integer
          minimum: 0
        maxPositionNotionalUsd:
          description: Upper bound on absolute open position notional, in USD.
          $ref: "#/components/schemas/PositiveDecimalString"
        marginTiers:
          description: |
            Progressive margin tiers. Empty array means flat `imrBps` / `mmrBps`
            apply at every size. Tier field names are snake_case (protocol
            convention) rather than the camelCase used elsewhere in this API.
          type: array
          items:
            type: object
            required:
              - notional_cap_usd
              - imr_bps
              - mmr_bps
            additionalProperties: false
            properties:
              notional_cap_usd:
                description: Upper bound on position notional (in whole USD) this tier applies to.
                type: integer
                minimum: 1
              imr_bps:
                description: Initial margin requirement at this tier, in bps.
                type: integer
                minimum: 1
              mmr_bps:
                description: Maintenance margin requirement at this tier, in bps.
                type: integer
                minimum: 0
    Terms:
      type: object
      required:
        - terms
        - effectiveAt
        - documentUrl
      additionalProperties: false
      description: |
        One published version of the Atlas Terms of Use, the one terms document every user and every builder accepts, with `enableTrading` or `enableBuilder`. `terms` is exactly what a signer commits to when accepting it.
      properties:
        terms:
          $ref: "#/components/schemas/TermsVersion"
        effectiveAt:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            When this version comes into force.
        documentUrl:
          type: string
          format: uri
          description: |
            The full terms text: CommonMark Markdown in UTF-8, served unchanged as `text/markdown; charset=utf-8`. keccak256 of the response body equals `terms.contentHash`; the URL is named by that hash and its content never changes. Clients render the Markdown for display and hash the raw bytes.
    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`.
      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.
    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`.
        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).
        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).
        mode:
          type: string
          enum:
            - normal
            - reduce_only
            - close_only
          description: |
            Market trading mode. Always present.
        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.
        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".
        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.
        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.
        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.
        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.
        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.
        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.
    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.
    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.
        timestamp:
          $ref: "#/components/schemas/TimestampMs"
          description: |
            Match time of the trade.
        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.
    TradeHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Trades for the market, most recent first.
          items:
            $ref: "#/components/schemas/Trade"
        nextCursor:
          description: |
            Opaque continuation token. Pass it unchanged as `cursor` with the same `marketId`. Null ends traversal; do not infer completion from page length.
          oneOf:
            - type: string
            - type: "null"
    TradeId:
      type: string
      minLength: 1
    TransactionHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Unique by txId, ordered by createdAt descending, then txId ascending.
          items:
            $ref: "#/components/schemas/TransactionRecord"
        nextCursor:
          description: |
            Opaque continuation preserving createdAt and txId. Pass unchanged with the same account and filters. Null ends traversal; page length does not. Pagination does not freeze pending records' later outcomes.
          oneOf:
            - type: string
            - type: "null"
    TransactionReceipt:
      type: object
      additionalProperties: false
      description: |
        A signed transaction's receipt. `committed`: ATLAS applied it in the Log, which never unwinds. It carries no result and no facts.
      required:
        - txId
        - status
      properties:
        txId:
          $ref: "#/components/schemas/TxId"
        status:
          type: string
          enum:
            - committed
    TransactionReceiptResult:
      description: |
        Result of `atlas.getTransactionReceipt`: the receipt, or null when no applied entry carries the transaction identifier. Null alone does not prove the transaction will not apply.
      oneOf:
        - $ref: "#/components/schemas/TransactionReceipt"
        - type: "null"
    TransactionRecord:
      type: object
      required:
        - txId
        - accountAddress
        - kind
        - createdAt
        - status
        - result
        - error
      additionalProperties: false
      description: |
        One durably recorded signed transaction and its outcome. A transaction identifier names one signed
        transaction: resending the same signed request is the same record, never
        a second one. The outcome is `result` when the write applied and
        `error` when ATLAS recorded a refusal, counted across its recorded attempts:

        - Once an attempt has applied, `result` is that applied outcome and
          never changes, and `error` is null. At most one attempt of a transaction identifier
          can apply, because applying consumes its nonce.
        - Until then, `error` is the latest refusal. A later attempt that
          applies replaces it with `result`: a refusal does not consume the
          nonce, so the same signed bytes can still apply (see `Nonce`).

        Schema, signature and transport errors before durable recording have no
        history record. Nor, normally, does a refusal of a write an owner or
        trading key signed: ATLAS records an input only when it changes state or
        a trusted service signed it, and a refused write changes nothing, so its
        reply is its only answer. -10010 reports on an attempt, not the write's
        outcome. Advanced-order requests have no record here.

        The record is the submission's outcome, not the current state of what it
        created or changed; read orders, positions and balances for that.
      properties:
        txId:
          $ref: "#/components/schemas/TxId"
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
          description: |
            The account the command acts for, which lists the record: the payload's `accountAddress`, a transfer's `account`, or, for a command that names a `wallet`, the wallet's Main.
        kind:
          $ref: "#/components/schemas/CommandKind"
        createdAt:
          $ref: "#/components/schemas/TimestampMs"
          description: Immutable ATLAS time of the first recorded attempt; from/to filter this time.
        status:
          type: string
          enum:
            - pending
            - completed
          description: |
            pending: an attempt is durably recorded without an applied outcome or refusal; it does not mean it is still being processed. completed: `result` or `error` holds the outcome.
        result:
          description: |
            The exact canonical write result DTO, present only after a recorded `APPLIED` status establishes application. For `internalTransfer`, `transfer`, `createSubAccount`, `stake`, `unstake`, `moveIsolatedMargin` and `withdraw`, this reuses the `TransactionSubmitted` DTO; the recorded status, not the DTO, establishes application. An applied `createSignerPolicy` reports the record it created, in the `CreateSignerPolicyApplied` shape. When present, its `txId` equals the record's `txId`, and its variant is one of `kind`'s. Null while `pending` and when the write was refused.
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/SendTransactionResult"
        error:
          description: |
            The refusal as the write's JSON-RPC error returned it. Null while pending and once the write applied; the record's `txId` identifies the submission.
          oneOf:
            - type: "null"
            - $ref: "#/components/schemas/JsonRpcError"
      oneOf:
        - properties:
            status:
              const: pending
            result:
              type: "null"
            error:
              type: "null"
        - properties:
            status:
              const: completed
            result:
              type: object
            error:
              type: "null"
        - properties:
            status:
              const: completed
            result:
              type: "null"
            error:
              type: object
    TransactionSigningDomain:
      type: object
      description: |
        The EIP-712 transaction domain of the protocol, without its `chainId`, which is the chain the signing wallet signs at: Typed transactions submitted through atlas.sendRawTransaction sign under it, and an Opaque signature commits to its `salt`. This is not the WebSocket handshake or authentication domain.
      required:
        - name
        - version
        - salt
      additionalProperties: false
      properties:
        name:
          type: string
          minLength: 1
          description: EIP-712 domain name, used exactly as returned.
        version:
          type: string
          minLength: 1
          description: Signing protocol version; independent of the service release version.
        salt:
          type: string
          pattern: ^0x[0-9a-f]{64}$
          description: |
            The domain's `bytes32` salt, `keccak256("atlas")` as 0x-prefixed lowercase hex, the same in every deployment.
    TransactionSubmitted:
      description: "For `internalTransfer` and `transfer`, the transfer was booked. For `createSubAccount`, `withdraw`, `stake` and `unstake`, the request was submitted without waiting for the outcome: `ok` means submitted, not applied, and a refusal is not reported back. Confirm the result with the account reads."
      type: object
      required:
        - status
      additionalProperties: false
      properties:
        status:
          const: ok
        transferId:
          type: string
          pattern: ^0x[0-9a-f]{64}$
          description: |
            Present for `internalTransfer`, `transfer` and `withdraw` only: the request's transaction identifier, the id `atlas.getTransfers` reports once the transfer is booked.
    TransferCursor:
      type: string
      pattern: ^[0-9]+:[0-9]+$
      description: Booking block height and the fact's ordinal in it, as `height:ordinal`.
    TransferHistoryPage:
      type: object
      required:
        - rows
        - nextCursor
      additionalProperties: false
      properties:
        rows:
          type: array
          description: Transfers, most recent first.
          items:
            $ref: "#/components/schemas/TransferRecord"
        nextCursor:
          description: |
            Pass back as `cursor` for the next page; null when fewer than `limit` rows were returned.
          oneOf:
            - $ref: "#/components/schemas/TransferCursor"
            - type: "null"
    TransferRecord:
      type: object
      required:
        - transferId
        - accountAddress
        - direction
        - assetId
        - amount
        - memo
        - status
        - timestampMs
      additionalProperties: false
      properties:
        transferId:
          type: string
          pattern: ^0x[0-9a-f]{64}$
          description: |
            The EIP-712 hash of the signed transfer, the same `transferId` the `atlas.sendRawTransaction` answer carries. Both sides share it.
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        direction:
          type: string
          enum:
            - in
            - out
          description: "`in` credits `accountAddress`; `out` debits it."
        assetId:
          type: integer
          minimum: 0
          maximum: 4294967295
          description: u32 asset identifier.
        amount:
          $ref: "#/components/schemas/PositiveDecimalString"
        memo:
          type: string
          pattern: ^0x[0-9a-f]{128}$
          description: The 64 signed memo bytes, unchanged. All zero means no memo.
        status:
          type: string
          enum:
            - transferComplete
          description: The destination holds the funds and the transfer is final.
        timestampMs:
          $ref: "#/components/schemas/TimestampMs"
          description: Venue time of the block that booked the transfer.
    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.
    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.
    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".
    UpdateAdvancedOrderResult:
      allOf:
        - $ref: "#/components/schemas/AdvancedOrderResult"
        - properties:
            type:
              const: updateAdvancedOrderResult
    VersionInfo:
      type: object
      required:
        - version
        - gitSha
        - commitTime
        - buildTime
        - signing
      additionalProperties: false
      properties:
        version:
          type: string
          minLength: 1
          description: |
            Release semver of the responding service, e.g. `0.1.0`.
        gitSha:
          type: string
          pattern: ^([0-9a-fA-F]{40}|unknown)$
          description: |
            Full 40-char git SHA of the deployed commit, or `unknown` when it could not be resolved at build time.
        commitTime:
          type: string
          pattern: ^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})|unknown)$
          description: |
            Committer timestamp of the deployed commit (git `%cI`, RFC3339 with offset), or `unknown`. Reproducible: a rebuild of the same SHA yields the same value.
        buildTime:
          type: string
          pattern: ^([0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})|unknown)$
          description: |
            Wall-clock instant this binary was compiled (RFC3339, UTC), or `unknown`. Intentionally NOT reproducible across rebuilds of the same SHA — it records when the image was compiled, complementing the reproducible `commitTime`.
        signing:
          $ref: "#/components/schemas/SigningInfo"
          description: The venue's transaction signing metadata.
    WalletAccount:
      type: object
      required:
        - accountAddress
        - kind
      additionalProperties: false
      properties:
        accountAddress:
          $ref: "#/components/schemas/AccountAddress"
        kind:
          type: string
          enum:
            - main
            - sub
    WalletAccounts:
      type: object
      required:
        - walletAddress
        - accounts
        - subAccountsUsed
      additionalProperties: false
      properties:
        walletAddress:
          $ref: "#/components/schemas/AccountAddress"
        accounts:
          type: array
          description: The Main first, then the Subs in the order they were opened.
          items:
            $ref: "#/components/schemas/WalletAccount"
        subAccountsUsed:
          type: integer
          minimum: 0
          description: Subs opened so far. A slot is never returned.
    WalletState:
      type: string
      enum:
        - pending
        - active
        - exit_only
      description: |-
        The state of the account's wallet. It is one setting of the wallet, so
        every account of the wallet reads the same value.
        `pending`: the default, until the wallet completes `enableTrading`. The
        wallet cannot add risk or transfer to another wallet.
        `active`: the wallet may trade.
        `exit_only`: set by the Atlas operator. The whole wallet can reduce,
        exit, withdraw and transfer between its own accounts, and cannot add
        risk or transfer to another wallet. Its resting orders stay.
