# Written by scripts/build-openapi.mjs from packages/docs/public/openapi.yaml. Do not edit: edit that file.
openapi: 3.1.0
info:
  title: Blockhash Data API
  version: "1"
  description: |-
    Robinhood Chain's indexed data (chain id 4663): tokens, prices, candles, swaps, holders, traders, pools, wallets and transactions.
    Every route is open without a key. An API key, sent as `Authorization: Bearer <key>` from a server, raises the rate limits: see [Get a key](/get-a-key).
    Raw token amounts are decimal strings in the token's smallest unit.
    Every answer that is not a success is one envelope, `{ error, code, retryable, retryAfterSeconds?, detail? }`: see [Errors](/data-api/errors).
servers:
  - url: https://api.blockhash.xyz
tags:
  - name: Tokens
    description: The token index, a token's detail, stats, candles, swaps, holders and traders, and its pools' candles and depth.
  - name: Wallets
    description: A wallet's balances, positions, trades, profit and loss, and value over time.
  - name: Market data
    description: Token prices, the market event stream, US market hours, display-currency rates and the venue each pool factory belongs to.
  - name: Live
    description: The chain's latest swaps across every token, its last minute, and the token map.
  - name: Transactions
    description: One transaction's token flow.
  - name: System
    description: The caller's region and the caller's own limits.
security:
  - bearer: []
paths:
  /v1/tokens:
    get:
      tags:
        - Tokens
      summary: Search tokens
      operationId: searchTokens
      security: []
      description: "The ranked token index: without `q`, the default list of 200; with `q`, up to 50 matches by symbol, name or address, verified tokens first and impersonators last."
      parameters:
        - name: q
          in: query
          description: Symbol, name, or address. Up to 64 characters.
          schema:
            type: string
            maxLength: 64
      responses:
        "200":
          description: Matching tokens.
          content:
            application/json:
              schema:
                type: object
                required:
                  - count
                  - source
                  - tokens
                properties:
                  count:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer
                  tokens:
                    type: array
                    items:
                      $ref: "#/components/schemas/Token"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/discover:
    get:
      tags:
        - Tokens
      summary: Browse tokens
      operationId: discoverTokens
      security: []
      description: A page of the whole token index, sorted and filtered. `filter=books` lists Book tokens, and `minDepthUsd` keeps tokens with at least that much executable depth.
      parameters:
        - name: sort
          in: query
          schema:
            type: string
            enum:
              - top
              - liquidity
              - depth
              - new
              - symbol
              - tier
              - change
              - volume
            default: tier
        - name: filter
          in: query
          description: "`books` lists the Book tokens."
          schema:
            type: string
            enum:
              - all
              - verified
              - stocks
              - books
            default: all
        - name: dir
          in: query
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
        - name: minDepthUsd
          in: query
          description: Only tokens with at least this much measured executable depth.
          schema:
            type: number
            minimum: 0
            default: 0
        - name: q
          in: query
          schema:
            type: string
            maxLength: 64
      responses:
        "200":
          description: A page of the index.
          content:
            application/json:
              schema:
                type: object
                required:
                  - total
                  - source
                  - tokens
                properties:
                  total:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer
                  tokens:
                    type: array
                    items:
                      $ref: "#/components/schemas/Token"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/resolve:
    post:
      tags:
        - Tokens
      summary: Resolve addresses to tokens
      operationId: resolveTokens
      security: []
      description: The token rows for up to 600 addresses at once, such as a wallet's holdings. An address that is no known token is left out.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - addresses
              properties:
                addresses:
                  type: array
                  maxItems: 600
                  items:
                    $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: Known tokens among the addresses.
          content:
            application/json:
              schema:
                type: object
                required:
                  - count
                  - source
                  - tokens
                properties:
                  count:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer
                  tokens:
                    type: array
                    items:
                      $ref: "#/components/schemas/Token"
        "400":
          description: "`bad-request` or `bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/{address}:
    get:
      tags:
        - Tokens
      summary: Get a token
      operationId: getToken
      security: []
      description: "One token: its price and market figures, its trust marks and verification, how fresh its figures are, and a preview of its top pools."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The token.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenDetail"
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-token`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/{address}/summary:
    get:
      tags:
        - Tokens
      summary: Get a token summary
      operationId: getTokenSummary
      security: []
      description: The figures a link preview shows for a token, a subset of its detail. A failed read answers 503, never 404, so a crawler never learns that a real token does not exist.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The summary.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - name
                  - symbol
                  - priceUsd
                  - change24h
                  - marketCapUsd
                  - liquidityUsd
                  - volume24hUsd
                  - isStock
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  name:
                    type:
                      - string
                      - "null"
                  symbol:
                    type:
                      - string
                      - "null"
                  priceUsd:
                    type:
                      - number
                      - "null"
                  change24h:
                    type:
                      - number
                      - "null"
                    description: Percent.
                  marketCapUsd:
                    type:
                      - number
                      - "null"
                  liquidityUsd:
                    type:
                      - number
                      - "null"
                  volume24hUsd:
                    type:
                      - number
                      - "null"
                  isStock:
                    type: boolean
                  book:
                    $ref: "#/components/schemas/BookFlag"
                    description: "A Book token: its Book. Absent on every other token."
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-token`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/{address}/holders:
    get:
      tags:
        - Tokens
      summary: List a token's top holders
      operationId: getTokenHolders
      security: []
      description: The largest ERC-20 holders of a token, and how many wallets hold a positive balance of it.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
      responses:
        "200":
          description: Holders.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - holders
                  - top
                properties:
                  token:
                    $ref: "#/components/schemas/Address"
                  holders:
                    type: integer
                  top:
                    type: array
                    items:
                      type: object
                      required:
                        - holder
                        - balance
                      properties:
                        holder:
                          $ref: "#/components/schemas/Address"
                        balance:
                          type: string
                        bookRole:
                          $ref: "#/components/schemas/BookHolderRole"
                          description: "A Book's token: the holder is one of the Book's own contracts. Absent on every other holder."
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/swaps:
    get:
      tags:
        - Tokens
      summary: List a token's swaps
      operationId: getTokenSwaps
      security: []
      description: The newest priced swaps of one token, newest first, optionally filtered by `side` and size. Pass a page's `nextBefore` as `before` for the swaps before it, until `nextBefore` is null. A filtered page searches back up to a week from its cursor (`searchedTo`).
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: before
          in: query
          description: A page's `nextBefore`, as this route wrote it for the same filters or none. The page holds the swaps older than that page, with none missed or repeated. Omit it for the newest page.
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{1,256}$
        - name: side
          in: query
          description: Only the swaps that bought the token (`buy`) or sold it (`sell`).
          schema:
            type: string
            enum:
              - buy
              - sell
        - name: minUsd
          in: query
          description: Only swaps of at least this many dollars, a plain decimal. 0 is no bound.
          schema:
            type: number
            minimum: 0
            maximum: 1000000000000
        - name: maxUsd
          in: query
          description: Only swaps of at most this many dollars, a plain decimal. 0 is no bound, and one under `minUsd` is `bad-filter`.
          schema:
            type: number
            minimum: 0
            maximum: 1000000000000
      responses:
        "200":
          description: Swaps.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - source
                  - swaps
                  - nextBefore
                properties:
                  token:
                    $ref: "#/components/schemas/Address"
                  source:
                    type: string
                    enum:
                      - indexer
                  swaps:
                    type: array
                    items:
                      $ref: "#/components/schemas/TokenSwap"
                  nextBefore:
                    type: string
                    nullable: true
                    description: The cursor of the next older page, opaque. Null once the page reaches the token's first priced swap.
                  users:
                    type:
                      - object
                      - "null"
                    description: The short identity of each listed trader who shows a name, a picture, a mark or an X handle, by lowercase address. Null where the names did not arrive in time.
                    additionalProperties:
                      $ref: "#/components/schemas/BooksShortIdentity"
                  filter:
                    type: object
                    description: "Present on a page asked with `side`, `minUsd` or `maxUsd`: the filter as read, a bound of 0 as null."
                    required:
                      - side
                      - minUsd
                      - maxUsd
                    properties:
                      side:
                        type:
                          - string
                          - "null"
                        enum:
                          - buy
                          - sell
                          - null
                      minUsd:
                        type:
                          - number
                          - "null"
                      maxUsd:
                        type:
                          - number
                          - "null"
                  searchedTo:
                    type:
                      - integer
                      - "null"
                    description: On a filtered page that ran out of its week of blocks before it was full, the unix second it searched back to; its `nextBefore` reads on from there. Null otherwise.
        "400":
          description: "`bad-address`, `bad-filter` or `bad-cursor`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable` or `store-busy`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/pools/{pool}/candles:
    get:
      tags:
        - Tokens
      summary: Get pool candles
      operationId: getPoolCandles
      security: []
      description: OHLCV buckets in USD of one pool's priced token. The pool is its address, or its 32-byte id for Uniswap V4, Infinity CL and Ekubo pools.
      parameters:
        - name: pool
          in: path
          required: true
          schema:
            type: string
            pattern: ^0x[0-9a-fA-F]{40}$|^0x[0-9a-fA-F]{64}$
        - name: tf
          in: query
          schema:
            type: integer
            enum:
              - 60
              - 300
              - 900
              - 3600
              - 14400
              - 86400
            default: 300
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 400
        - name: before
          in: query
          schema:
            type: integer
      responses:
        "200":
          description: A page of candles.
          content:
            application/json:
              schema:
                type: object
                required:
                  - pool
                  - tf
                  - source
                  - candles
                properties:
                  pool:
                    type: string
                  tf:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer-pool
                  candles:
                    type: array
                    items:
                      $ref: "#/components/schemas/Candle"
                  hasMore:
                    type: boolean
                  nextBefore:
                    type: integer
        "400":
          description: "`bad-pool` or `bad-timeframe`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/pools/{uid}/depth:
    get:
      tags:
        - Tokens
      summary: Get pool depth
      operationId: getPoolDepth
      security: []
      description: "One pool's measured depth: the cash it pays out for a 2% move, with its price and liquidity. The pool is its address, or its 32-byte id for V4-shaped pools."
      parameters:
        - name: uid
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: The pool's depth row.
          content:
            application/json:
              schema:
                type: object
                required:
                  - pool
                  - venue
                  - family
                  - token0
                  - token1
                  - depthUsd
                  - depthSource
                  - status
                  - priceUsd
                  - measuredAt
                  - source
                properties:
                  pool:
                    type: string
                  venue:
                    type: string
                  family:
                    type: string
                  token0:
                    $ref: "#/components/schemas/Address"
                  token1:
                    $ref: "#/components/schemas/Address"
                  depthUsd:
                    type: number
                    description: The cash the pool pays out for a two-percent move.
                  depthSource:
                    type: string
                    enum:
                      - state
                      - probe
                    description: "`state`: walked from the pool's own state. `probe`: a hooked pool, measured by quoting it."
                  status:
                    type: string
                    enum:
                      - ok
                      - stale
                  priceUsd:
                    type: number
                  liquidityUsd:
                    type:
                      - number
                      - "null"
                  amount0:
                    type:
                      - number
                      - "null"
                  amount1:
                    type:
                      - number
                      - "null"
                  measuredAt:
                    type: string
                  source:
                    type: string
                    enum:
                      - indexer
        "400":
          description: "`bad-pool`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-pool`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/{address}/stats:
    get:
      tags:
        - Tokens
      summary: Get token stats
      operationId: getTokenStats
      security: []
      description: One token's price, 24-hour change, volume, trades, pools, buys and sells, and holders.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The token's stats.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - source
                  - volume24h
                  - trades24h
                  - holders
                properties:
                  token:
                    $ref: "#/components/schemas/Address"
                  source:
                    type: string
                    enum:
                      - indexer-token
                  price:
                    type: number
                    nullable: true
                  change24h:
                    type: number
                    nullable: true
                    description: Percent.
                  volume24h:
                    type: number
                  trades24h:
                    type: integer
                  pools24h:
                    type: integer
                  buys24h:
                    type: integer
                  sells24h:
                    type: integer
                  holders:
                    type: integer
                  lastTrade:
                    type: integer
                    nullable: true
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/candles:
    get:
      tags:
        - Tokens
      summary: Get token candles
      operationId: getTokenCandles
      security: []
      description: OHLCV buckets in USD for one token, from the pool its chart is drawn from (the token's `chartPool`). Pass `nextBefore` as `before` for older buckets.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: tf
          in: query
          description: Bucket size in seconds.
          schema:
            type: integer
            enum:
              - 60
              - 300
              - 900
              - 3600
              - 14400
              - 86400
            default: 300
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 400
        - name: before
          in: query
          description: Unix seconds; only buckets before this time, for paging back.
          schema:
            type: integer
      responses:
        "200":
          description: A page of candles.
          content:
            application/json:
              schema:
                type: object
                required:
                  - token
                  - tf
                  - source
                  - candles
                properties:
                  token:
                    $ref: "#/components/schemas/Address"
                  tf:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer-token
                  candles:
                    type: array
                    items:
                      $ref: "#/components/schemas/Candle"
                  hasMore:
                    type: boolean
                  nextBefore:
                    type: integer
                    description: Pass as `before` for the previous page.
        "400":
          description: "`bad-address` or `bad-timeframe`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/tokens/{address}/image:
    get:
      tags:
        - Tokens
      summary: Get a token's logo
      operationId: getTokenImage
      security: []
      description: "The token's logo as an image. A token with no logo answers 404: draw a monogram instead."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The image.
          content:
            image/png: {}
        "404":
          description: "`not-found`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/traders/{wallet}:
    get:
      tags:
        - Tokens
      summary: Get a trader's position in a token
      operationId: getTokenTrader
      security: []
      description: "What one wallet holds of a token, what that is worth at the token's price, and what it made on the token at average cost: its trades, transfers, cost basis, realized and unrealized. `pnl` is null where `pnlWhy` says why."
      parameters:
        - name: address
          in: path
          required: true
          description: The token.
          schema:
            $ref: "#/components/schemas/Address"
        - name: wallet
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The wallet's position.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenTraderPosition"
        "400":
          description: "`bad-address` or `bad-wallet`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-token`: no token the index knows has this address. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable` or `store-busy`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/windows:
    get:
      tags:
        - Tokens
      summary: Get a token's trading windows
      operationId: getTokenWindows
      security: []
      description: "A token's trading over the last 5 minutes, hour, 6 hours and day, across every pool it trades in: its swaps by side, their dollar volumes, and the wallets behind them. They are read at most once in 30 seconds a token and may be up to two minutes old: `asOf` names the second they were read."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: The windows.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenWindowsResponse"
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-busy` or `store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/holders/pnl:
    get:
      tags:
        - Tokens
      summary: List a token's holders with their PnL
      operationId: getTokenHoldersPnl
      security: []
      description: A token's largest holders, each with its balance, its share of the supply, its worth and what it made on the token at average cost. Holders are read once in five minutes a token; worth and unrealized are priced as asked. A pool or contract carries a `label` and no `pnl`.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          description: How many holders, largest first. A value out of range reads as its nearest bound.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
      responses:
        "200":
          description: The holders.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenHoldersPnlResponse"
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-token`: no token the index knows has this address. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-busy` or `store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/tokens/{address}/traders:
    get:
      tags:
        - Tokens
      summary: List a token's top traders
      operationId: getTokenTraders
      security: []
      description: "Up to 100 wallets that traded a token over the last day or week, ranked by what their trades in the window made, or by what they bought or sold. A sale of tokens held from before the window makes no PnL and is told apart (`soldFromBefore`). Wrapped ether and dollar tokens answer `available: false`."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: window
          in: query
          description: "`1d` reads the last 24 hours, `7d` the last 7 days."
          schema:
            type: string
            enum:
              - 1d
              - 7d
            default: 1d
        - name: sort
          in: query
          description: "`pnl` ranks by `pnlUsd` (realized where it is null), `bought` and `sold` by the dollars bought or sold in the window."
          schema:
            type: string
            enum:
              - pnl
              - bought
              - sold
            default: pnl
      responses:
        "200":
          description: The traders, or why the token has none here.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TokenTradersResponse"
        "400":
          description: "`bad-address` or `bad-query`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`unknown-token`: no token the index knows has this address. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-busy` or `store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/wallets/{address}/balances:
    get:
      tags:
        - Wallets
      summary: List a wallet's balances
      operationId: getWalletBalances
      security: []
      description: "Every positive balance the wallet holds (ERC-20, ERC-721 and ERC-1155), read from every transfer on the chain, largest first. Balances are exact integers as strings: scale them by `decimals` where present."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 200
      responses:
        "200":
          description: Balances.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - count
                  - balances
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  count:
                    type: integer
                  balances:
                    type: array
                    items:
                      type: object
                      required:
                        - token
                        - tokenId
                        - balance
                        - lastBlock
                      properties:
                        token:
                          $ref: "#/components/schemas/Address"
                        tokenId:
                          type: string
                          description: 0 for ERC-20; the id for ERC-721 and ERC-1155.
                        balance:
                          type: string
                          description: Exact integer, unscaled.
                        balanceSource:
                          type: string
                          enum:
                            - ledger
                            - chain
                          description: "`ledger`: the sum of the token's transfers. `chain`: read from the contract, for a token whose transfers were found not to describe its balances."
                        verdict:
                          type: string
                          description: Whether the token's transfers describe its balances (`conforming`, `nonconforming` or `mixed`), where that was checked.
                        lastBlock:
                          type: integer
                        symbol:
                          type: string
                        name:
                          type: string
                        decimals:
                          type: integer
                        isStock:
                          type: boolean
                        book:
                          $ref: "#/components/schemas/BookFlag"
                          description: "A Book token: its Book. Absent on every other token."
                        bookNft:
                          $ref: "#/components/schemas/BookNftFlag"
                          description: "A Book NFT market's collection: its Book. Absent on every other collection."
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/wallets/{address}/positions:
    get:
      tags:
        - Wallets
      summary: List a wallet's liquidity positions
      operationId: getWalletPositions
      security: []
      description: "The concentrated-liquidity position NFTs the wallet owns with live liquidity, most recently changed first: each with its pool, range and liquidity, its exact amounts at the pool's price, whether the price is in range, and a USD value."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 100
      responses:
        "200":
          description: Positions.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - count
                  - positions
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  count:
                    type: integer
                  positions:
                    type: array
                    items:
                      type: object
                      required:
                        - manager
                        - tokenId
                        - pool
                        - family
                        - token0
                        - token1
                        - fee
                        - tickSpacing
                        - tickLower
                        - tickUpper
                        - liquidity
                        - currentTick
                        - inRange
                        - amount0
                        - amount1
                        - valueUsd
                        - lastBlock
                        - asOf
                      properties:
                        manager:
                          $ref: "#/components/schemas/Address"
                          description: The position manager that minted the NFT.
                        tokenId:
                          type: string
                        pool:
                          type: string
                          description: The pool's address, or its id for a pool-manager venue.
                        family:
                          type: string
                          example: v3
                        token0:
                          type: object
                          required:
                            - address
                          properties:
                            address:
                              $ref: "#/components/schemas/Address"
                            symbol:
                              type: string
                            decimals:
                              type: integer
                        token1:
                          type: object
                          required:
                            - address
                          properties:
                            address:
                              $ref: "#/components/schemas/Address"
                            symbol:
                              type: string
                            decimals:
                              type: integer
                        fee:
                          type: integer
                          description: Pips (1e-6).
                        tickSpacing:
                          type: integer
                        tickLower:
                          type: integer
                        tickUpper:
                          type: integer
                        liquidity:
                          type: string
                          description: Exact integer, unscaled.
                        currentTick:
                          type: integer
                          nullable: true
                          description: The pool's tick at `asOf`; null before the pool has a state.
                        inRange:
                          type: boolean
                          nullable: true
                        amount0:
                          type: string
                          nullable: true
                          description: Exact integer in token0, unscaled, at the pool's current price.
                        amount1:
                          type: string
                          nullable: true
                        valueUsd:
                          type: number
                          nullable: true
                          description: The amounts in USD, counting a side only where its token has $1,000 of 2% depth across its pools, each worth at most 100 times that depth. Null where neither side counts.
                        lastBlock:
                          type: integer
                        asOf:
                          type: integer
                          nullable: true
                          description: The block the pool state is exact at.
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/wallets/{address}/swaps:
    get:
      tags:
        - Wallets
      summary: List a wallet's trades
      operationId: getWalletSwaps
      security: []
      description: "The wallet's priced trades, newest first, a row a transaction, sent by it or not; `token` keeps one token's. A short or empty page may still name `nextBefore`: pass it as `before` until it is null. Each key, session or (with neither) client address has one page a second, a burst of 20."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: limit
          in: query
          description: The most trades the page carries. A value out of range reads as its nearest bound.
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 50
        - name: before
          in: query
          description: A page's `nextBefore`, as this route wrote it. The page holds the trades older than that page, and no transaction is split between two pages. Omit it for the newest page.
          schema:
            type: string
            pattern: ^[A-Za-z0-9_-]{1,256}$
        - name: token
          in: query
          description: The trades in which this token was either side, bought, sold or paid with. Native ether (the zero address) is `bad-token`.
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: A page of the wallet's trades.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - swaps
                  - source
                  - nextBefore
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  swaps:
                    type: array
                    items:
                      $ref: "#/components/schemas/WalletTrade"
                  source:
                    type: string
                    enum:
                      - indexer
                  nextBefore:
                    type:
                      - string
                      - "null"
                    description: The cursor of the next older page, opaque. Null once the wallet's history ends.
        "400":
          description: "`bad-address`, `bad-cursor` or `bad-token`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "429":
          description: "`rate-limited`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-busy` or `store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/wallets/{address}/pnl:
    get:
      tags:
        - Wallets
      summary: Get a wallet's profit and loss
      operationId: getWalletPnl
      security: []
      description: Per token, the wallet's cost basis at average cost and its realized and unrealized profit, each transfer priced at its day's close. Only tokens with $1,000 of 2% depth and known decimals count. Native ether is one row under the zero address, at wrapped ether's close, with no cost or profit.
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
      responses:
        "200":
          description: Profit and loss.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - source
                  - totals
                  - tokens
                  - truncated
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  source:
                    type: string
                    enum:
                      - indexer
                  truncated:
                    description: The wallet has more than 90,000 transfer rows; the figures cover the first 90,000.
                    type: boolean
                  nativeUnread:
                    description: "Present and true where the wallet's native ether did not read: no row of it, and `totals.valueUsd` is its tokens alone."
                    type: boolean
                  perps:
                    $ref: "#/components/schemas/WalletPerpsPart"
                  totals:
                    type: object
                    required:
                      - costBasisUsd
                      - valueUsd
                      - unrealizedUsd
                      - realizedUsd
                    properties:
                      costBasisUsd:
                        type: number
                      valueUsd:
                        type: number
                        description: The tokens' value, the native ether's, and the perps' equity on Lighter where `perps.state` is `read`. The cost and the profits are the tokens' alone.
                      unrealizedUsd:
                        type: number
                      realizedUsd:
                        type: number
                  tokens:
                    type: array
                    items:
                      type: object
                      required:
                        - token
                        - balance
                        - costBasisUsd
                        - valueUsd
                        - unrealizedUsd
                        - realizedUsd
                        - avgCostUsd
                        - estimated
                        - firstDay
                      properties:
                        token:
                          $ref: "#/components/schemas/Address"
                        symbol:
                          type: string
                        decimals:
                          type: integer
                        balance:
                          type: string
                          description: Exact integer held now, unscaled.
                        costBasisUsd:
                          type: number
                        valueUsd:
                          type: number
                          nullable: true
                        unrealizedUsd:
                          type: number
                          nullable: true
                        realizedUsd:
                          type: number
                        avgCostUsd:
                          type: number
                          nullable: true
                          description: Average cost of one whole token while the balance is positive.
                        estimated:
                          description: A transfer came before the token's first price and was priced at its first close.
                          type: boolean
                        firstDay:
                          type: string
                          description: The day of the token's first transfer, YYYY-MM-DD. Empty for native ether, whose transfers no log names.
                        native:
                          type: boolean
                          description: "Present and true on the native ether row (the zero address): its balance read from the chain now, `unrealizedUsd` and `avgCostUsd` null."
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/wallets/{address}/history:
    get:
      tags:
        - Wallets
      summary: Get a wallet's value over time
      operationId: getWalletHistory
      security: []
      description: "The wallet's ERC-20 holdings and native ether valued each UTC day over the last `days`, at that day's closes. A token counts with $1,000 of 2% depth and is worth at most 100 times it. A first view reads the ether's past days a few a second: while `native.partial` is true, ask again."
      parameters:
        - name: address
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Address"
        - name: days
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 365
            default: 30
      responses:
        "200":
          description: One point per day and the holdings at the end of the window.
          content:
            application/json:
              schema:
                type: object
                required:
                  - address
                  - days
                  - source
                  - points
                  - tokens
                properties:
                  address:
                    $ref: "#/components/schemas/Address"
                  days:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer
                  points:
                    type: array
                    items:
                      type: object
                      properties:
                        t:
                          type: integer
                          description: The day's start
                          Unix seconds.: null
                        valueUsd:
                          type: number
                          description: The tokens' value, and `nativeUsd` and `perpsUsd` where each is a number.
                        nativeUsd:
                          type: number
                          nullable: true
                          description: "The native ether at the day's last block (today's: now) at wrapped ether's close. Null where it is not read yet or did not read."
                        perpsUsd:
                          type: number
                          nullable: true
                          description: "The perps' equity on Lighter that day (today's: now). Null before `perps.since` and today where the read did not answer. Absent where the answer names no perps."
                  tokens:
                    type: array
                    items:
                      type: object
                      properties:
                        token:
                          $ref: "#/components/schemas/Address"
                        symbol:
                          type: string
                        decimals:
                          type: integer
                        balance:
                          type: string
                          description: Exact integer, unscaled.
                        valueUsd:
                          type: number
                          nullable: true
                        native:
                          type: boolean
                          description: Present and true on the native ether row, under the zero address.
                  native:
                    type: object
                    description: What the answer read of the wallet's native ether.
                    required:
                      - missing
                      - partial
                      - unread
                    properties:
                      missing:
                        type: integer
                        description: "Points whose `nativeUsd` is null: their value is the wallet's tokens alone."
                      partial:
                        type: boolean
                        description: Some of them are being read now. The same request a few seconds on answers more of them.
                      unread:
                        type: boolean
                        description: Some of them could not be read now (a read upstream failed). Asking again later may answer them.
                  perps:
                    description: "The wallet's perps on Lighter: their state now, and the first day the value counts them. Absent where the wallet has none."
                    allOf:
                      - $ref: "#/components/schemas/WalletPerpsPart"
                      - type: object
                        required:
                          - since
                        properties:
                          since:
                            type:
                              - string
                              - "null"
                            description: The first day the value counts perps on, YYYY-MM-DD. Mancer keeps a reading a day from the day it first reads the wallet's account.
        "400":
          description: "`bad-address`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: "`store-unavailable`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
  /v1/fx:
    get:
      tags:
        - Market data
      summary: Get display-currency rates
      operationId: getFx
      security: []
      description: USD multipliers for display currencies, from the rates the ECB publishes. Display only, never a quote.
      responses:
        "200":
          description: Rates against USD.
          content:
            application/json:
              schema:
                type: object
                required:
                  - base
                  - rates
                  - at
                  - date
                  - stale
                  - currencies
                properties:
                  base:
                    type: string
                    enum:
                      - USD
                  rates:
                    type: object
                    description: Code to USD multiplier. USD is always present and always 1.
                    additionalProperties:
                      type: number
                  at:
                    type: integer
                    description: When the set was fetched, in milliseconds.
                  date:
                    type:
                      - string
                      - "null"
                    description: The ECB publication date the rates belong to.
                  stale:
                    type: boolean
                    description: True when a persisted set could not be refreshed.
                  currencies:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                        name:
                          type: string
                        symbol:
                          type: string
                        locale:
                          type: string
  /v1/prices:
    get:
      tags:
        - Market data
      summary: Get token prices
      operationId: getPrices
      security: []
      description: USD prices of the 5,000 tokens with the most day volume, keyed by address, with the figures a token list shows beside each.
      responses:
        "200":
          description: The price rail.
          content:
            application/json:
              schema:
                type: object
                required:
                  - prices
                  - count
                  - source
                properties:
                  count:
                    type: integer
                  source:
                    type: string
                    enum:
                      - indexer
                  prices:
                    type: object
                    additionalProperties:
                      type: object
                      required:
                        - price
                        - symbol
                        - name
                        - decimals
                        - isStock
                      properties:
                        price:
                          type: number
                          description: USD.
                        priceConfidence:
                          type:
                            - string
                            - "null"
                        priceDepthUsd:
                          type:
                            - number
                            - "null"
                        change24h:
                          type:
                            - number
                            - "null"
                          description: Percent.
                        symbol:
                          type: string
                        name:
                          type: string
                        decimals:
                          type: integer
                        isStock:
                          type: boolean
                        depthUsd:
                          type:
                            - number
                            - "null"
                        volume24h:
                          type:
                            - number
                            - "null"
                        marketCapUsd:
                          type:
                            - number
                            - "null"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/market:
    get:
      tags:
        - Market data
      summary: Get US market hours
      operationId: getMarketStatus
      security: []
      description: Whether the US regular session is open now, for tokenized stocks.
      responses:
        "200":
          description: Session status.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MarketStatus"
  /v1/stream:
    get:
      tags:
        - Market data
      summary: Stream market events
      operationId: getStream
      security: []
      description: "Server-sent events of market changes: one `price` per pool that traded and one `candle` per token whose chart moved, at most one a subject a second. An event is the signal to read the JSON again, not a price. See [Streaming](/data-api/stream)."
      parameters:
        - name: kinds
          in: query
          description: Comma-separated event kinds. The stream emits `price` and `candle`; other names deliver nothing.
          schema:
            type: string
        - name: keys
          in: query
          description: Comma-separated subjects (token or pool ids).
          schema:
            type: string
        - name: since
          in: query
          description: Resume after this sequence number. `Last-Event-ID` does the same.
          schema:
            type: integer
      responses:
        "200":
          description: An event stream.
          content:
            text/event-stream:
              schema:
                type: string
        "429":
          description: "`too-many-streams`. See [Errors](/data-api/errors)."
          headers:
            Retry-After:
              $ref: "#/components/headers/RetryAfter"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/venues/factories:
    get:
      tags:
        - Market data
      summary: List the venues' pool factories
      operationId: getVenueFactories
      security: []
      description: Every pool factory Mancer knows, each with the venue id this API names its pools by. Answers are shared for ten minutes.
      responses:
        "200":
          description: The factories.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/VenueFactoriesResponse"
  /v1/swaps:
    get:
      tags:
        - Live
      summary: List the chain's latest swaps
      operationId: getSwaps
      security: []
      description: The latest priced swaps on the chain across every token and venue, newest first, each with both tokens' symbols, its venue and its own maker (`trader`). Answers are shared for two seconds, so polling faster gains nothing.
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 200
            default: 100
      responses:
        "200":
          description: The swaps.
          content:
            application/json:
              schema:
                type: object
                required:
                  - swaps
                  - source
                properties:
                  swaps:
                    type: array
                    items:
                      type: object
                      required:
                        - id
                        - txHash
                        - logIndex
                        - blockNumber
                        - timestamp
                        - token
                        - tokenSymbol
                        - cash
                        - cashSymbol
                        - pool
                        - venue
                        - side
                        - amountToken
                        - amountCash
                        - priceUsd
                        - volumeUsd
                        - trader
                      properties:
                        id:
                          type: string
                          description: txHash:logIndex, stable across polls.
                        txHash:
                          $ref: "#/components/schemas/Hash"
                        logIndex:
                          type: integer
                        blockNumber:
                          type: string
                        timestamp:
                          type: integer
                          description: Unix seconds.
                        token:
                          $ref: "#/components/schemas/Address"
                        tokenSymbol:
                          type:
                            - string
                            - "null"
                        cash:
                          $ref: "#/components/schemas/Address"
                          description: The pool's other side; native ETH is the zero address.
                        cashSymbol:
                          type:
                            - string
                            - "null"
                        pool:
                          type: string
                        venue:
                          type: string
                        side:
                          type: string
                          enum:
                            - buy
                            - sell
                        amountToken:
                          type:
                            - number
                            - "null"
                        amountCash:
                          type:
                            - number
                            - "null"
                        priceUsd:
                          type: number
                        volumeUsd:
                          type: number
                        trader:
                          oneOf:
                            - $ref: "#/components/schemas/Address"
                            - type: "null"
                          description: "Who made the swap: its payer, whose money paid for it, as `/v1/transactions/{hash}` names each swap's `maker`; where the transaction is not read yet, its sender. Null only on a token's fee (`fee`)."
                        sender:
                          $ref: "#/components/schemas/Address"
                          description: The transaction's sender. Absent on a token's fee.
                        fee:
                          type: boolean
                          enum:
                            - true
                          description: "Present where the swap is a token's own fee traded inside someone else's trade: nobody's swap, so `trader` is null. Its price and volume stay in the market's data."
                        deliveredTo:
                          $ref: "#/components/schemas/Address"
                          description: Where what the swap bought went, where that is a wallet other than its trader (a solver's customer, a recipient the buyer named).
                        solver:
                          type: boolean
                          enum:
                            - true
                          description: Present where the trader is a solver's float that filled another's purchase with its own money.
                        purpose:
                          type: string
                          enum:
                            - liquidity-add
                            - liquidity-remove
                            - liquidity-move
                          description: "Present where the swap was a step of no trade of its owner's: liquidity added (a zap swaps part of a deposit), removed, or moved. Absent for a trade."
                  source:
                    type: string
                    enum:
                      - indexer
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/swaps/pulse:
    get:
      tags:
        - Live
      summary: Get the chain's last minute
      operationId: getSwapPulse
      security: []
      description: "The last sixty seconds in three figures: swaps, transactions and their dollar volume."
      responses:
        "200":
          description: The pulse.
          content:
            application/json:
              schema:
                type: object
                required:
                  - swaps
                  - transactions
                  - volumeUsd
                  - asOf
                  - source
                properties:
                  swaps:
                    type: integer
                  transactions:
                    type: integer
                  volumeUsd:
                    type: number
                  asOf:
                    type: integer
                    description: Unix seconds.
                  source:
                    type: string
                    enum:
                      - indexer
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/map:
    get:
      tags:
        - Live
      summary: Get the token map
      operationId: getMap
      security: []
      description: "The tokens with the most liquidity (`nodes`) and the pools between them (`edges`): each pair's pools summed by depth and named by venue. `size` sets how many tokens."
      parameters:
        - name: size
          in: query
          required: false
          description: How many tokens, in order of liquidity.
          schema:
            type: integer
            minimum: 20
            maximum: 800
            default: 400
      responses:
        "200":
          description: The map.
          content:
            application/json:
              schema:
                type: object
                required:
                  - nodes
                  - edges
                  - asOf
                  - source
                properties:
                  nodes:
                    type: array
                    items:
                      type: object
                      required:
                        - address
                        - symbol
                        - decimals
                        - isStock
                        - liquidityUsd
                        - priceUsd
                        - holders
                      properties:
                        address:
                          $ref: "#/components/schemas/Address"
                        symbol:
                          type: string
                        decimals:
                          type:
                            - integer
                            - "null"
                        isStock:
                          type: boolean
                        liquidityUsd:
                          type: number
                        priceUsd:
                          type:
                            - number
                            - "null"
                        holders:
                          type: integer
                  edges:
                    type: array
                    items:
                      type: object
                      required:
                        - a
                        - b
                        - depthUsd
                        - pools
                        - venues
                      properties:
                        a:
                          $ref: "#/components/schemas/Address"
                          description: The lower of the two addresses.
                        b:
                          $ref: "#/components/schemas/Address"
                        depthUsd:
                          type: number
                        pools:
                          type: integer
                        venues:
                          type: array
                          items:
                            type: string
                  asOf:
                    type: integer
                    description: Unix seconds.
                  source:
                    type: string
                    enum:
                      - indexer
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/transactions/{hash}:
    get:
      tags:
        - Transactions
      summary: Get a transaction's token flow
      operationId: getTransaction
      security: []
      description: "How tokens moved in one transaction: every address it touches (`nodes`), every transfer in log order (`edges`), every swap on its pool with its maker, its owner and purpose, and the sender's net flows. A block not indexed yet answers `source: node` with the head and value alone: ask again shortly."
      parameters:
        - name: hash
          in: path
          required: true
          schema:
            $ref: "#/components/schemas/Hash"
        - name: native
          in: query
          required: false
          schema:
            type: string
            enum:
              - "1"
          description: "`1` adds the ETH the transaction's calls carried to `edges`, read from a trace of its block, and answers `nativeTrace`. ETH that one contract hands another is a call's value and emits no log, so without it the only ETH in a flow is the transaction's own value and what WETH wrapped or unwrapped."
      responses:
        "200":
          description: The flow.
          content:
            application/json:
              schema:
                type: object
                required:
                  - hash
                  - block
                  - timestamp
                  - status
                  - from
                  - to
                  - valueRaw
                  - gasUsed
                  - nodes
                  - edges
                  - swaps
                  - tokens
                  - origin
                  - truncated
                  - source
                  - explorerUrl
                properties:
                  hash:
                    $ref: "#/components/schemas/Hash"
                  block:
                    type: string
                    description: Decimal block number.
                  timestamp:
                    type:
                      - integer
                      - "null"
                    description: Unix seconds; null while the block is not indexed yet.
                  status:
                    type: string
                    enum:
                      - success
                      - reverted
                      - unknown
                  from:
                    $ref: "#/components/schemas/Address"
                  to:
                    oneOf:
                      - $ref: "#/components/schemas/Address"
                      - type: "null"
                  valueRaw:
                    $ref: "#/components/schemas/Uint"
                  gasUsed:
                    type:
                      - string
                      - "null"
                  nodes:
                    type: array
                    description: Every address the flow touches.
                    items:
                      type: object
                      required:
                        - address
                        - kind
                        - label
                        - venue
                        - pair
                        - layer
                      properties:
                        address:
                          $ref: "#/components/schemas/Address"
                        kind:
                          type: string
                          enum:
                            - origin
                            - address
                            - pool
                            - router
                            - zero
                            - weth
                          description: "`origin` is the sender, `router` a Mancer contract or the Uniswap V4 PoolManager, `zero` the mint and burn address, `weth` the WETH contract."
                        label:
                          type: string
                        venue:
                          type:
                            - string
                            - "null"
                        pair:
                          type:
                            - string
                            - "null"
                          description: The pool's pair, or the pool count on the V4 PoolManager.
                        layer:
                          type: integer
                          description: The step at which the flow first reaches the address from the sender; the sender is 0.
                  edges:
                    type: array
                    description: Every movement, in log order.
                    items:
                      type: object
                      required:
                        - id
                        - logIndex
                        - kind
                        - from
                        - to
                        - token
                        - amountRaw
                        - amount
                        - usd
                        - tokenId
                      properties:
                        id:
                          type: string
                        logIndex:
                          type: integer
                          description: -1 for the transaction's own value, which is not a log.
                        kind:
                          type: string
                          enum:
                            - native
                            - transfer
                            - mint
                            - burn
                            - wrap
                            - unwrap
                            - nft
                        from:
                          $ref: "#/components/schemas/Address"
                        to:
                          $ref: "#/components/schemas/Address"
                        token:
                          $ref: "#/components/schemas/Address"
                          description: Native ETH is the zero address.
                        amountRaw:
                          $ref: "#/components/schemas/Uint"
                        amount:
                          type:
                            - number
                            - "null"
                          description: Scaled by the token's decimals; null when they are unknown, or for an NFT.
                        usd:
                          type:
                            - number
                            - "null"
                          description: The movement's value at the token's current price; null where the token has no price.
                        tokenId:
                          type:
                            - string
                            - "null"
                        trace:
                          type: integer
                          description: "Only on an ETH movement read from the block's trace (`native=1`): the call's place among the transaction's calls. Its `logIndex` is the log the movement stands before."
                  swaps:
                    type: array
                    description: Every swap, on the pool that made it.
                    items:
                      type: object
                      required:
                        - logIndex
                        - venue
                        - family
                        - node
                        - pool
                        - poolId
                        - pair
                        - tokenIn
                        - tokenOut
                        - amountInRaw
                        - amountOutRaw
                        - amountIn
                        - amountOut
                        - usd
                        - sender
                        - recipient
                      properties:
                        logIndex:
                          type: integer
                        venue:
                          type: string
                        family:
                          type: string
                        node:
                          $ref: "#/components/schemas/Address"
                          description: The pool address, or the V4 PoolManager for a V4 hop.
                        pool:
                          $ref: "#/components/schemas/Address"
                        poolId:
                          type:
                            - string
                            - "null"
                        pair:
                          type:
                            - string
                            - "null"
                        tokenIn:
                          type: string
                          description: Empty where the pool is not known.
                        tokenOut:
                          type: string
                        amountInRaw:
                          type: string
                        amountOutRaw:
                          type: string
                        amountIn:
                          type:
                            - number
                            - "null"
                        amountOut:
                          type:
                            - number
                            - "null"
                        usd:
                          type:
                            - number
                            - "null"
                          description: "The swap's value: its input at the current price, or its output when the input has none."
                        sender:
                          $ref: "#/components/schemas/Address"
                        recipient:
                          oneOf:
                            - $ref: "#/components/schemas/Address"
                            - type: "null"
                        maker:
                          oneOf:
                            - $ref: "#/components/schemas/Address"
                            - type: "null"
                          description: "Who made the swap: its payer, whose money paid for it, as the tapes name it; where that is not read yet, the transaction's maker. Null on a token's own fee (`fee`)."
                        fee:
                          type: boolean
                          enum:
                            - true
                          description: "Present where the swap is a token's own fee traded inside someone else's trade: nobody's swap."
                        deliveredTo:
                          $ref: "#/components/schemas/Address"
                          description: Where what the swap bought went, where that is a wallet other than its maker.
                        solver:
                          type: boolean
                          enum:
                            - true
                          description: Present where the maker is a solver's float that filled another's purchase out of its own money.
                  makers:
                    type: array
                    description: Every address that made one of its swaps, the maker of the most swaps first. Present where the transaction swapped. A token's fee counts for none.
                    items:
                      $ref: "#/components/schemas/Address"
                  tokens:
                    type: object
                    description: Symbol, decimals and current price by address for every token in the flow.
                    additionalProperties:
                      type: object
                      required:
                        - address
                        - symbol
                        - decimals
                        - priceUsd
                      properties:
                        address:
                          $ref: "#/components/schemas/Address"
                        symbol:
                          type:
                            - string
                            - "null"
                        decimals:
                          type:
                            - integer
                            - "null"
                        priceUsd:
                          type:
                            - number
                            - "null"
                          description: The token's current price; null where it has none. ETH carries WETH's.
                  origin:
                    type: object
                    description: The sender's net flows.
                    required:
                      - sent
                      - received
                    properties:
                      sent:
                        $ref: "#/components/schemas/TxNetFlows"
                      received:
                        $ref: "#/components/schemas/TxNetFlows"
                  owner:
                    description: "Whose tokens the transaction moved, and `why`: the account a bundler sent it for, its sender, an order's maker, the one trader, or the one payer. Null where none is clear."
                    oneOf:
                      - type: object
                        required:
                          - address
                          - why
                        properties:
                          address:
                            $ref: "#/components/schemas/Address"
                          why:
                            type: string
                            enum:
                              - sender
                              - account
                              - order-maker
                              - trader
                              - payer
                      - type: "null"
                  liquidity:
                    type: array
                    description: Every change of a pool's liquidity, in log order. Amounts are given for pairs and V3 pools; a V4 change names its liquidity alone, and what moved is in the transfers.
                    items:
                      type: object
                      required:
                        - logIndex
                        - action
                        - venue
                        - family
                        - pool
                        - poolId
                        - pair
                        - sender
                        - owner
                        - token0
                        - token1
                        - amount0
                        - amount1
                        - liquidity
                        - tickLower
                        - tickUpper
                      properties:
                        logIndex:
                          type: integer
                        action:
                          type: string
                          enum:
                            - add
                            - remove
                        venue:
                          type: string
                        family:
                          type: string
                        pool:
                          $ref: "#/components/schemas/Address"
                        poolId:
                          type:
                            - string
                            - "null"
                        pair:
                          type:
                            - string
                            - "null"
                        sender:
                          $ref: "#/components/schemas/Address"
                        owner:
                          $ref: "#/components/schemas/Address"
                        token0:
                          type:
                            - string
                            - "null"
                        token1:
                          type:
                            - string
                            - "null"
                        amount0:
                          type:
                            - number
                            - "null"
                        amount1:
                          type:
                            - number
                            - "null"
                        liquidity:
                          type: string
                          description: The liquidity's own change, raw and signed.
                        tickLower:
                          type:
                            - integer
                            - "null"
                        tickUpper:
                          type:
                            - integer
                            - "null"
                  purpose:
                    oneOf:
                      - type: string
                        enum:
                          - liquidity-add
                          - liquidity-remove
                          - liquidity-move
                      - type: "null"
                    description: "What the transaction did for its owner where it was no trade: liquidity added (the owner holds more of a position after), removed, or both. Null for a trade."
                  truncated:
                    description: Past 600 movements, the first 600 are returned.
                    type: boolean
                  nativeTrace:
                    type: string
                    enum:
                      - traced
                      - pending
                      - none
                    description: "Only with `native=1`. `traced`: `edges` holds every ETH movement a call of the transaction made. `pending`: the block's trace is not read yet, so ask again in a few seconds. `none`: the block was never traced, and `edges` is the logs' alone."
                  source:
                    description: "`node`: the block is not indexed yet, so only the head and the value are filled."
                    type: string
                    enum:
                      - indexer
                      - node
                  explorerUrl:
                    type: string
                    description: The transaction on Etherscan.
        "400":
          description: "`bad-tx-hash`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "`transaction-not-found`. See [Errors](/data-api/errors)."
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          $ref: "#/components/responses/StoreUnavailable"
  /v1/geo:
    get:
      tags:
        - System
      summary: Get the caller's region
      operationId: getGeo
      security: []
      description: The country the request arrived from, and whether tokenized stocks may trade from it. Where `stocksRestricted` is true, a session's or an anonymous quote or order touching a stock answers 451. A request your API key authorizes is never refused for its region.
      responses:
        "200":
          description: Region details.
          content:
            application/json:
              schema:
                type: object
                required:
                  - country
                  - stocksRestricted
                properties:
                  country:
                    type:
                      - string
                      - "null"
                    description: ISO 3166-1 alpha-2 country code, or null when unknown.
                  stocksRestricted:
                    type: boolean
                    description: True when stock pairs are refused for this region (HTTP 451 on quotes and orders).
              example:
                country: DE
                stocksRestricted: false
  /v1/limits:
    get:
      tags:
        - System
      summary: Get rate limits
      operationId: getLimits
      security:
        - {}
        - bearer: []
      description: Who the API takes the request for, every rate bucket it may pay with the tokens left in each, and the account's write limits. A route's own allowance for each caller is not listed. Reading it charges only its own request.
      responses:
        "200":
          description: The caller's limits.
          headers:
            X-Request-Id:
              $ref: "#/components/headers/RequestId"
            RateLimit-Policy:
              $ref: "#/components/headers/RateLimitPolicy"
            RateLimit:
              $ref: "#/components/headers/RateLimit"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Limits"
              example:
                caller:
                  kind: session
                  wallet: "0xfe1a867b752c2f3033655d222a674bd1d8cb0f03"
                  account: "0xfe1a867b752c2f3033655d222a674bd1d8cb0f03"
                  issuedAt: 1793500000
                  expiresAt: 1794104800
                buckets:
                  - name: session
                    scope: session
                    rate: 30
                    burst: 120
                    remaining: 119
                    resetSeconds: 1
                    applies: every request the session makes, from any address
                  - name: ip-ceiling
                    scope: ip
                    rate: 60
                    burst: 240
                    remaining: 239
                    resetSeconds: 1
                    applies: every request from this address but those an API key authorizes, all callers there together
                  - name: account-write
                    scope: account
                    rate: 2
                    burst: 10
                    remaining: 10
                    resetSeconds: 0
                    applies: "an account's writes: POST, PUT, PATCH and DELETE under /v1/me, a report, the X link's steps, a Book's records"
                durable:
                  - name: follows-per-hour
                    limit: 100
                    windowSeconds: 3600
                    used: 3
                    applies: "PUT /v1/me/following/{id}: 429 follow-limit"
        "429":
          $ref: "#/components/responses/RateLimited"
components:
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      description: "A Blockhash API key, sent from your server. It is optional: every route answers without one, and a key raises the rate limits. A request with a key and an `Origin` header is refused `403 key-server-only`. See [Get a key](/get-a-key)."
  headers:
    RequestId:
      description: "The request's id: yours echoed where you sent an `X-Request-Id` of 1 to 128 of `[A-Za-z0-9._:-]`, else one made for it. Name it when you write to support."
      schema:
        type: string
    RetryAfter:
      description: Seconds to wait before sending the request again. Every 429 and every 503 carries it.
      schema:
        type: integer
        minimum: 0
    RateLimitPolicy:
      description: 'The rate bucket nearest its end, by the IETF httpapi draft: `"<bucket>";q=<burst>;w=<seconds to refill from empty>`.'
      schema:
        type: string
      example: '"session";q=120;w=4'
    RateLimit:
      description: 'That bucket now: `"<bucket>";r=<requests left at once>;t=<seconds until full>`.'
      schema:
        type: string
      example: '"session";r=118;t=1'
  responses:
    RateLimited:
      description: "`rate-limited`. See [Errors](/data-api/errors)."
      headers:
        Retry-After:
          $ref: "#/components/headers/RetryAfter"
        RateLimit-Policy:
          $ref: "#/components/headers/RateLimitPolicy"
        RateLimit:
          $ref: "#/components/headers/RateLimit"
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
          example:
            error: rate limited
            code: rate-limited
            retryable: true
            retryAfterSeconds: 1
            bucket: session
    StoreUnavailable:
      description: "`store-unavailable`. See [Errors](/data-api/errors)."
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  schemas:
    Address:
      type: string
      pattern: ^0x[0-9a-fA-F]{40}$
      description: A 20-byte hex address.
      example: "0x0bd7d308f8e1639fab988df18a8011f41eacad73"
    Hash:
      type: string
      pattern: ^0x[0-9a-fA-F]{64}$
      description: A 32-byte hex hash.
    Uint:
      type: string
      pattern: ^[0-9]+$
      description: An unsigned integer as a decimal string, in the token's smallest unit.
      example: "100000000000000000"
    WalletPerpsPart:
      type: object
      description: A wallet's perps on Lighter as a part of its value.
      required:
        - state
        - equityUsd
        - unrealizedUsd
        - accounts
        - positions
        - readAt
      properties:
        state:
          type: string
          enum:
            - read
            - none
            - unread
          description: "`read`: Lighter answered. `none`: the wallet has no account. `unread`: Lighter did not answer, so the value leaves the perps out."
        equityUsd:
          type:
            - number
            - "null"
          description: "Lighter's total asset value over every account: the collateral with each position's unrealized PnL at the mark. Null unless `read`."
        unrealizedUsd:
          type:
            - number
            - "null"
        accounts:
          type: integer
        positions:
          type: integer
        readAt:
          type:
            - integer
            - "null"
          description: When Lighter answered, Unix milliseconds.
        partial:
          type: boolean
          description: Present and true where Lighter named more accounts than it answered.
        retryAfterSec:
          type: integer
          description: "Where `unread`: how soon to ask again."
    TxNetFlows:
      type: array
      items:
        type: object
        required:
          - token
          - amountRaw
          - amount
          - usd
        properties:
          token:
            $ref: "#/components/schemas/Address"
          amountRaw:
            $ref: "#/components/schemas/Uint"
          amount:
            type:
              - number
              - "null"
          usd:
            type:
              - number
              - "null"
    Error:
      type: object
      description: Every answer that is not a success. A route's own fields stay beside these (a refused quote's `quote`, a refusal's `detail`).
      required:
        - error
        - code
        - retryable
      additionalProperties: true
      properties:
        error:
          type: string
          description: A sentence naming what was wrong. Show it; branch on `code`.
        code:
          $ref: "#/components/schemas/ErrorCode"
        retryable:
          type: boolean
          description: Whether the same request, sent again unchanged after `Retry-After`, may succeed. An unexpected error is retryable for a read, or for a write that carries an `Idempotency-Key`.
        retryAfterSeconds:
          type: integer
          minimum: 0
          description: "The `Retry-After` header's seconds, where the answer carries one: every 429 and every 503."
        bucket:
          type: string
          description: On a 429 `rate-limited`, the bucket that refused.
          enum:
            - key
            - key-account
            - session
            - ip
            - ip-ceiling
            - art
            - estimate
            - build
            - build-ceiling
            - auth
            - discover
            - discover-ceiling
            - account-write
            - follow-write
            - session-renew
            - user-search
            - user-lookup
            - user-follows
            - username-check
            - steps
        detail:
          type: object
          additionalProperties: true
          description: What the refusal names, by code.
    ErrorCode:
      type: string
      description: Every code an answer may carry. A code keeps its meaning for good; a new rule takes a new code.
      enum:
        - account-not-found
        - alerts-max
        - already-in
        - amount-exceeds-tracked
        - app-access-unavailable
        - auth-required
        - auth-unavailable
        - bad-action
        - bad-address
        - bad-addresses
        - bad-amount
        - bad-avatar-source
        - bad-bio
        - bad-body
        - bad-choice
        - bad-collection
        - bad-count
        - bad-cursor
        - bad-details
        - bad-display-name
        - bad-fields
        - bad-filter
        - bad-gateway
        - bad-id
        - bad-image-url
        - bad-json
        - bad-key-name
        - bad-label
        - bad-limit
        - bad-message
        - bad-mode
        - bad-name
        - bad-page
        - bad-platform
        - bad-pool
        - bad-public
        - bad-push-token
        - bad-query
        - bad-read
        - bad-reason
        - bad-recipient
        - bad-request
        - bad-scope
        - bad-scopes
        - bad-seq
        - bad-show-portfolio
        - bad-signature
        - bad-status
        - bad-symbol
        - bad-targets
        - bad-telegram
        - bad-then
        - bad-timeframe
        - bad-token
        - bad-token-id
        - bad-tokens-per-nft
        - bad-tx-hash
        - bad-username
        - bad-via
        - bad-wallet
        - bad-website
        - bad-x
        - batch-too-large
        - bio-length
        - bio-lines
        - block-self
        - blocking-max
        - book-cancelled
        - book-indexing
        - book-not-armed
        - book-settled
        - books-chain-stale
        - books-deployment-unverified
        - books-index-unavailable
        - books-rate-limited
        - books-sign-log-unavailable
        - books-signer-has-code
        - books-signer-not-current
        - books-signer-stopped
        - books-signer-unavailable
        - books-signing-off
        - books-state-unavailable
        - bucket-full
        - budget-exhausted
        - chain-unavailable
        - confirm-delete
        - conflict
        - contract-not-served
        - deadline-past-unlock
        - deletion-not-pending
        - deployment-unsupported
        - description-blank
        - description-length
        - description-lines
        - description-link
        - details-too-long
        - dev-not-a-wallet
        - display-name-address
        - display-name-blank
        - display-name-length
        - display-name-link
        - display-name-word
        - draft-deployed
        - draft-name
        - draft-not-found
        - draft-symbol
        - events-unavailable
        - factory-not-open
        - feed-stale
        - field-not-for-kind
        - fill-impact-too-high
        - follow-blocked
        - follow-limit
        - follow-self
        - following-max
        - follows-paused
        - forbidden
        - geo-restricted
        - idempotency-in-progress
        - idempotency-key-busy
        - idempotency-key-invalid
        - idempotency-key-reused
        - impact-too-high
        - insufficient-eth
        - insufficient-tokens
        - integrator-fee-above-ceiling
        - integrator-fee-needs-key
        - integrator-fee-not-allowed
        - integrator-fee-unavailable
        - internal-error
        - invalid-accepted-min-out
        - invalid-integrator-fee
        - inventory-empty
        - inventory-short
        - invite-invalid
        - invite-not-found
        - invite-own
        - invite-tries
        - invite-used
        - key-managed-by-mancer
        - key-name-ambiguous
        - key-name-taken
        - key-not-found
        - key-not-owner
        - key-not-signing
        - key-required
        - key-scope
        - key-server-only
        - key-session-only
        - keys-max
        - keys-unavailable
        - launch-state-unavailable
        - legacy-closed
        - limit-under-market
        - link-busy
        - link-choice
        - link-contract-wallet
        - link-expired
        - link-limit
        - link-signature
        - linked-wallet-key-only
        - live-grants-full
        - logo-dimensions
        - logo-empty
        - logo-forbidden
        - logo-not-found
        - logo-not-raster
        - logo-too-large
        - logo-type
        - logo-type-mismatch
        - logo-unavailable
        - lp-share
        - middle-not-swept
        - middle-refused
        - names-required
        - nft-market-exists
        - nft-market-indexing
        - nft-market-paused
        - nft-market-state-unavailable
        - nft-market-unverified
        - nft-markets-unavailable
        - nft-not-found
        - no-image
        - no-nft-market
        - no-picture
        - no-reference
        - no-route
        - no-username
        - nonce-invalid
        - not-a-book
        - not-a-collection
        - not-a-target
        - not-a-trader
        - not-activated
        - not-an-eoa
        - not-an-nft
        - not-an-nft-market
        - not-book-operator
        - not-eligible
        - not-eligible-yet
        - not-following
        - not-found
        - not-frozen
        - not-in-inventory
        - not-market-maker
        - not-offered
        - not-owner
        - not-raising
        - not-read-yet
        - not-the-creator
        - note-required
        - nothing-to-claim
        - nothing-to-do
        - nothing-to-report
        - order-fills-unavailable
        - order-kind-unavailable
        - order-not-open
        - order-out-of-scope
        - orders-exceed-holding
        - orders-maker-only
        - origin-refused
        - payload-too-large
        - pending-mismatch
        - perps-above-available
        - perps-account-index-bound
        - perps-account-index-mismatch
        - perps-adapter-unlisted
        - perps-adapter-unverified
        - perps-approvals-required
        - perps-bad-auth-part
        - perps-bad-commitment
        - perps-bad-key-context
        - perps-bad-key-copy
        - perps-bad-key-message
        - perps-bad-key-signature
        - perps-bad-targets
        - perps-below-minimum
        - perps-client-order-index-used
        - perps-commitment-reused
        - perps-deposit-closed
        - perps-environment
        - perps-expiry-past-wind-down
        - perps-key-closed
        - perps-key-context-used
        - perps-key-copy-none
        - perps-key-copy-rotated
        - perps-key-limit
        - perps-key-needed
        - perps-key-not-set
        - perps-key-unknown
        - perps-market-closed
        - perps-modify-trigger
        - perps-no-account
        - perps-no-slot
        - perps-nonce-live
        - perps-nonce-unavailable
        - perps-nonce-waiting
        - perps-not-the-asker
        - perps-order-side-unknown
        - perps-read-token-busy
        - perps-read-token-live
        - perps-read-token-none
        - perps-read-token-refused
        - perps-read-token-unavailable
        - perps-read-token-unknown
        - perps-reduce-off
        - perps-risk-off
        - perps-session-only
        - perps-sign-log-unavailable
        - perps-target-unknown
        - perps-too-far-from-mark
        - perps-tx-unknown
        - perps-unknown-market
        - perps-unread
        - perps-unsupported
        - perps-upstream-unavailable
        - perps-usdg-spot
        - perps-vault-refused
        - perps-vault-signer-stopped
        - perps-vault-signer-unavailable
        - perps-wind-down
        - perps-wind-down-first
        - picture-dimensions
        - picture-empty
        - picture-forbidden
        - picture-frames
        - picture-not-raster
        - picture-too-large
        - picture-type
        - picture-type-mismatch
        - picture-unavailable
        - pool-fee-trap
        - pool-take-too-high
        - price-moved
        - primary-wallet
        - primary-wallet-only
        - profile-field-held
        - profiles-unavailable
        - q-required
        - quote-assessment-stale
        - quote-expired
        - quote-invalid
        - quote-required
        - quote-timeout
        - quote-value-discrepancy
        - quotes-paused
        - rate-limited
        - reason-required
        - recipient-not-found
        - refresh-nothing
        - refresh-unavailable
        - refresh-wait
        - report-limit
        - report-not-found
        - report-self
        - reversal-cooldown
        - reverses-live-order
        - round-trip-trap
        - route-leaves-stock
        - route-mismatch
        - route-pool-refused
        - route-touches-book-token
        - router-unavailable
        - salt-required
        - search-busy
        - search-unavailable
        - sell-exceeds-balance
        - sell-exceeds-curve
        - sells-disabled
        - session-renew-limit
        - session-required
        - session-revoked
        - signature-mismatch
        - simulation-mismatch
        - simulation-reverted
        - slippage-exceeded
        - stake-unread
        - steps-unavailable
        - stock-not-receivable
        - stocks-ack-required
        - stop-band-out-of-range
        - stop-band-too-narrow
        - stop-needs-cash-side
        - stop-over-market
        - stop-too-deep
        - stop-would-fire
        - store-busy
        - store-unavailable
        - stream-tickets-unavailable
        - target-duplicate
        - target-own-token
        - target-unknown
        - target-unverified
        - targets-locked
        - targets-required
        - terms-refused
        - thesis-blank
        - thesis-held
        - thesis-length
        - thesis-lines
        - thesis-link
        - thesis-not-found
        - tier-not-upgrade
        - timeout
        - token-refused
        - token-router-refused
        - token-sell-blocked
        - token-sell-gated
        - too-many-streams
        - transaction-not-found
        - transfer-refused
        - tx-taken
        - unavailable
        - unknown-field
        - unknown-leg
        - unknown-order
        - unknown-pool
        - unknown-token
        - unknown-username
        - unprocessable
        - unsupported-media-type
        - upload-limit
        - user-not-found
        - username-cooldown
        - username-format
        - username-held
        - username-in-use
        - username-length
        - username-lookalike
        - username-needs-x-or-stake
        - username-not-in-use
        - username-opened-elsewhere
        - username-prefix
        - username-reserved
        - username-staff-word
        - username-symbol
        - username-taken
        - username-x-handle
        - vault-simulation-failed
        - vault-tracks-16
        - venue-policy-changed
        - venue-policy-unavailable
        - vote-needs-verified
        - votes-rate-limited
        - wallet-already-linked
        - wallet-linked-elsewhere
        - wallet-mismatch
        - wallet-not-linked
        - wallet-required
        - wallets-max
        - webhook-busy
        - webhook-event-before-hook
        - webhook-event-not-found
        - webhook-event-not-subscribed
        - webhook-event-pending
        - webhook-events-invalid
        - webhook-not-found
        - webhook-resume-session-only
        - webhook-url-invalid
        - webhook-url-not-public
        - webhook-url-unresolvable
        - webhooks-max
        - webhooks-off
        - webhooks-unavailable
        - website-social
        - weth-spot
        - window-closed
        - window-closing
        - wrong-phase
        - x-device-expired
        - x-device-unknown
        - x-device-used
        - x-link-busy
        - x-link-denied
        - x-link-failed
        - x-not-linked
        - x-refresh-wait
        - x-ticket-not-yours
        - x-ticket-unknown
        - x-unavailable
        - zero-count
        - zero-trade
    KeyScope:
      type: string
      enum:
        - read
        - trade
        - records
        - books
      description: "What a wallet key may ask beyond the public reads: the account's own reads, building trades and orders, the account's records on Mancer, or Books signing for its own wallet."
    Limits:
      type: object
      required:
        - caller
        - buckets
        - durable
      properties:
        caller:
          type: object
          description: "Who the API takes the request for: `anonymous` (by its address), `session` (its wallet, account, `issuedAt`, `signedInAt` and `expiresAt`) or `key` (its `name` and `rateClass`, and a wallet key's `actsAs`)."
          required:
            - kind
          properties:
            kind:
              type: string
              enum:
                - anonymous
                - session
                - key
            proven:
              type: boolean
              description: "Anonymous: false where the request's address could not be read, so it shares one tight bucket."
            sessionRevoked:
              type: boolean
              description: "Anonymous: the request carried a session its account ended."
            wallet:
              $ref: "#/components/schemas/Address"
            account:
              type:
                - string
                - "null"
            issuedAt:
              type:
                - integer
                - "null"
              description: "Session: when this token was issued (Unix seconds)."
            signedInAt:
              type:
                - integer
                - "null"
              description: "Session: when the sign-in it came from was (Unix seconds); a renewed session keeps its sign-in's."
            expiresAt:
              type: integer
            name:
              type: string
            rateClass:
              type: string
              enum:
                - standard
                - high
            selfServe:
              type: boolean
              description: "Key: true for a key its account minted."
            actsAs:
              type: object
              description: "Wallet key: the wallet it acts as, that wallet's account now, and its scopes."
              properties:
                wallet:
                  $ref: "#/components/schemas/Address"
                account:
                  type:
                    - string
                    - "null"
                scopes:
                  type: array
                  items:
                    $ref: "#/components/schemas/KeyScope"
        buckets:
          type: array
          description: Every rate bucket a request from this caller may pay, each refilled to now and charged nothing by this read.
          items:
            type: object
            required:
              - name
              - scope
              - rate
              - burst
              - remaining
              - resetSeconds
              - applies
            properties:
              name:
                type: string
                description: The bucket, as a 429's `bucket` and `RateLimit-Policy` name it.
              scope:
                type: string
                enum:
                  - key
                  - session
                  - account
                  - ip
                description: "Whose it is: the key's, the session's wallet's, the account's (its wallets and its wallet keys share it), or the address's."
              rate:
                type: number
                description: Tokens a second.
              burst:
                type: integer
                description: Tokens at the most.
              remaining:
                type: integer
                description: Requests that may follow at once.
              resetSeconds:
                type: integer
                description: Seconds until the bucket is full again.
              applies:
                type: string
        durable:
          type: array
          description: The limits on an account's writes, with how many the account has used. `used` is null for a key or an anonymous caller, which hold no account.
          items:
            type: object
            required:
              - name
              - limit
              - windowSeconds
              - used
              - applies
            properties:
              name:
                type: string
              limit:
                type: integer
              windowSeconds:
                type:
                  - integer
                  - "null"
              used:
                type:
                  - integer
                  - "null"
              applies:
                type: string
    Token:
      type: object
      required:
        - address
        - symbol
        - name
        - decimals
        - isStock
        - tier
      properties:
        address:
          $ref: "#/components/schemas/Address"
        symbol:
          type: string
        name:
          type: string
        decimals:
          type: integer
        isStock:
          type: boolean
          description: A Robinhood Chain tokenized stock.
        tier:
          type: integer
          description: 2 = verified by Mancer, 1 = issued stock, 0 = the unreviewed tail.
        impersonator:
          type: boolean
          description: A symbol lookalike of a verified token.
        price:
          type:
            - number
            - "null"
          description: USD.
        change24h:
          type:
            - number
            - "null"
          description: Percent.
        liquidityUsd:
          type:
            - number
            - "null"
        depthUsd:
          type:
            - number
            - "null"
          description: Measured executable depth.
        volume24h:
          type:
            - number
            - "null"
        trades24h:
          type: integer
        pools24h:
          type: integer
          description: Pools that traded in the last 24 hours.
        pools:
          type: integer
          description: Pools with a depth row (the ones with a cash side).
        priceConfidence:
          type:
            - string
            - "null"
          description: "`high` or `low` (a defended price, by the pools behind it), `day`, `last`, `pool` (its market pool's price, before any trade), or null without a price."
        priceDepthUsd:
          type:
            - number
            - "null"
          description: The measured depth behind the price; 0 means it rests on volume alone.
        firstBlock:
          type: integer
        firstSeen:
          type:
            - integer
            - "null"
          description: Unix seconds.
        marketCapUsd:
          type:
            - number
            - "null"
          description: The price times the circulating supply, which leaves out the dead address's balance, an NFT market token's escrow and a Mosh token's agent vaults.
        imageUrl:
          type:
            - string
            - "null"
        book:
          $ref: "#/components/schemas/BookFlag"
          description: "A Book token: its Book, and `name` is the display name where the deployment gives one. Absent on every other token."
    TokenDetail:
      allOf:
        - $ref: "#/components/schemas/Token"
        - type: object
          properties:
            freshness:
              type: object
              additionalProperties: true
              description: Which components of the row are current, partial, or missing.
            changes:
              type: object
              properties:
                m5:
                  type:
                    - number
                    - "null"
                h1:
                  type:
                    - number
                    - "null"
                h6:
                  type:
                    - number
                    - "null"
                h24:
                  type:
                    - number
                    - "null"
            poolsList:
              type: array
              description: A bounded preview of the token's top pools.
              items:
                type: object
                properties:
                  pool:
                    type: string
                  venue:
                    type: string
                  other:
                    $ref: "#/components/schemas/Address"
                  otherSymbol:
                    type:
                      - string
                      - "null"
                  cash:
                    type: string
                  liquidityUsd:
                    type:
                      - number
                      - "null"
                  depthUsd:
                    type:
                      - number
                      - "null"
            poolListTruncated:
              type: boolean
            poolListLimit:
              type: integer
            chartPool:
              type:
                - string
                - "null"
              description: The pool its chart is drawn from.
            candlePools:
              type: integer
            buyVolume24h:
              type:
                - number
                - "null"
            holders:
              type:
                - integer
                - "null"
            totalSupply:
              type:
                - string
                - "null"
              description: Raw units as an integer string.
            circulatingSupply:
              type:
                - number
                - "null"
              description: "Human units: the supply less the dead address's balance, less its escrow's for an NFT market's token, and less its agent vaults' for a Mosh token."
            escrow:
              type: object
              description: "An NFT market's token: the escrow its circulating supply and market cap leave out, which holds the token behind the collection's NFTs. Absent on every other token."
              required:
                - address
                - market
                - collection
                - balance
                - tokensPerNft
              properties:
                address:
                  $ref: "#/components/schemas/Address"
                market:
                  $ref: "#/components/schemas/Address"
                  description: The market's trading vault.
                collection:
                  $ref: "#/components/schemas/Address"
                balance:
                  type: string
                  description: The escrow's balance of the token, raw units as an integer string.
                tokensPerNft:
                  type: string
                  description: The tokens one NFT trades at, raw units as an integer string.
            dev:
              oneOf:
                - $ref: "#/components/schemas/TokenDev"
                - type: "null"
              description: "The wallet that answers for the token: Mancer's word, else a Book's dev, else the wallet its launch log names as the one that launched it, where that is a wallet. Null where none names one, absent where it could not be read."
            agentVaults:
              type: object
              description: "A token Mosh launched: its swarm's agent vaults, which its circulating supply and market cap leave out, as Mosh's own supply figure does. Absent on every other token."
              required:
                - swarm
                - balance
                - vaults
              properties:
                swarm:
                  $ref: "#/components/schemas/Address"
                  description: The Mosh swarm that lists the vaults.
                balance:
                  type: string
                  description: What the vaults hold of the token together, raw units as an integer string.
                vaults:
                  type: array
                  items:
                    type: object
                    required:
                      - address
                      - balance
                    properties:
                      address:
                        $ref: "#/components/schemas/Address"
                      balance:
                        type: string
                        description: The vault's balance of the token, raw units as an integer string.
            fdvUsd:
              type:
                - number
                - "null"
            source:
              type: string
              enum:
                - indexer
            servedAgeSec:
              type: integer
              description: How old the figures in this answer are, in seconds.
    TokenSwap:
      type: object
      properties:
        spotUsd:
          type: number
          description: The pool's own price after the swap, in USD; 0 where the venue reports none.
        id:
          type: string
        txHash:
          $ref: "#/components/schemas/Hash"
        logIndex:
          type: integer
        blockNumber:
          type: string
        timestamp:
          type: integer
        pool:
          type: string
        venue:
          type: string
        cash:
          $ref: "#/components/schemas/Address"
          description: The cash leg the price is measured against.
        priceUsd:
          type: number
        volumeUsd:
          type: number
        side:
          type:
            - string
            - "null"
          enum:
            - buy
            - sell
            - null
        amountToken:
          type:
            - number
            - "null"
        amountCash:
          type:
            - number
            - "null"
        cashSymbol:
          type:
            - string
            - "null"
        trader:
          type:
            - string
            - "null"
          description: "Who made the swap: its payer, as `/v1/transactions/{hash}` names each swap's `maker`, else its sender. Null on a token's fee (`fee`). A swap neither names yet is left out of the tape."
        sender:
          type: string
          description: The transaction's sender. Absent on a token's fee.
        fee:
          type: boolean
          enum:
            - true
          description: "Present where the swap is a token's own fee traded inside someone else's trade: nobody's swap, its `trader` null."
        deliveredTo:
          type: string
          description: Where what the swap bought went, where that is a wallet other than its trader.
        solver:
          type: boolean
          enum:
            - true
          description: Present where the trader is a solver's float that filled another's purchase out of its own money.
        purpose:
          type: string
          enum:
            - liquidity-add
            - liquidity-remove
            - liquidity-move
          description: Present where the print was a step of its owner's liquidity added, removed or moved (a zap's swap); absent for a trade.
    Candle:
      type: object
      required:
        - t
        - o
        - h
        - l
        - c
        - v
      properties:
        t:
          type: integer
          description: Bucket start, unix seconds.
        o:
          type: number
        h:
          type: number
        l:
          type: number
        c:
          type: number
        v:
          type: number
          description: Volume in USD.
    MarketStatus:
      type: object
      required:
        - open
        - phase
        - nextOpen
        - sessionOpen
        - nextClose
        - note
      properties:
        open:
          type: boolean
          description: Regular session in progress.
        phase:
          type: string
          enum:
            - open
            - pre
            - after
            - closed
        nextOpen:
          type: integer
          description: Unix seconds of the next regular-session open.
        sessionOpen:
          type:
            - integer
            - "null"
        nextClose:
          type:
            - integer
            - "null"
        note:
          type:
            - string
            - "null"
          description: A line clients can show verbatim.
    BookAbiSet:
      type: string
      enum:
        - books
      description: The ABIs Mancer reads the Books contracts with.
    BookFlag:
      type: object
      description: "On a token response, a Book token: its Book."
      required:
        - factory
        - abiSet
        - label
        - bookId
        - vault
        - phase
        - step
        - flags
        - quote
        - raise
        - unlockAt
        - settledAt
        - backingPerTokenWei
        - displayName
        - nftMarket
      properties:
        factory:
          $ref: "#/components/schemas/BooksAddress"
        abiSet:
          $ref: "#/components/schemas/BookAbiSet"
        label:
          type: string
        bookId:
          type: string
        vault:
          $ref: "#/components/schemas/BooksAddress"
        phase:
          $ref: "#/components/schemas/BookPhase"
        step:
          $ref: "#/components/schemas/BookStep"
        flags:
          type: object
          required:
            - pastWindow
            - graduatable
            - feedStale
          properties:
            pastWindow:
              type: boolean
            graduatable:
              type: boolean
            feedStale:
              type: boolean
        quote:
          $ref: "#/components/schemas/BooksAddress"
        raise:
          description: "While the Book waits, raises or has graduated: what it raised and the tax now."
          anyOf:
            - type: object
              properties:
                raisedQuote:
                  $ref: "#/components/schemas/BooksUnits"
                taxBpsNow:
                  type: number
              required:
                - raisedQuote
                - taxBpsNow
            - type: "null"
        unlockAt:
          type:
            - number
            - "null"
        settledAt:
          type:
            - number
            - "null"
        backingPerTokenWei:
          description: While it trades, the holders' pot over circulating; once settled, what a token redeems for.
          anyOf:
            - $ref: "#/components/schemas/BooksUnits"
            - type: "null"
        displayName:
          type: string
        nftMarket:
          anyOf:
            - type: object
              properties:
                nft:
                  $ref: "#/components/schemas/BooksAddress"
                tokensPerNft:
                  $ref: "#/components/schemas/BooksUnits"
              required:
                - nft
                - tokensPerNft
            - type: "null"
    BookHolderRole:
      type: string
      enum:
        - vault
        - nft-market
        - staking
        - settler
        - pad
        - pool
        - pool-manager
        - dead
      description: A holder of a Book token that is one of the Book's own contracts.
    BookNftFlag:
      type: object
      description: "On a wallet's rows, a Book's NFT market collection: its Book."
      required:
        - token
        - factory
        - bookId
        - tokensPerNft
        - displayName
        - symbol
      properties:
        token:
          $ref: "#/components/schemas/BooksAddress"
          description: The Book token.
        factory:
          $ref: "#/components/schemas/BooksAddress"
        bookId:
          type: string
        tokensPerNft:
          $ref: "#/components/schemas/BooksUnits"
        displayName:
          type: string
        symbol:
          type: string
    BookPhase:
      type: string
      enum:
        - waiting
        - raising
        - graduated
        - trading
        - frozen
        - settled
        - aborted
      description: A Book's phase at the head's second, never a device's clock. `aborted` is a cancelled Book.
    BookStep:
      type: string
      enum:
        - arm
        - buy
        - graduate
        - bond
        - trade
        - liquidate
        - redeem
        - none
      description: The Book's next step, for whoever the contracts allow.
    BooksAddress:
      type: string
      pattern: ^0x[0-9a-f]{40}$
      description: A lowercase 20-byte hex address.
      example: "0x0bd7d308f8e1639fab988df18a8011f41eacad73"
    BooksShortIdentity:
      type: object
      description: A wallet as a list shows it. Every field but the address is null where the wallet shows nothing of it.
      required:
        - address
        - username
        - displayName
        - avatar
        - verified
        - x
      properties:
        address:
          $ref: "#/components/schemas/BooksAddress"
        username:
          type:
            - string
            - "null"
        displayName:
          type:
            - string
            - "null"
        avatar:
          type:
            - string
            - "null"
          description: The picture's path on the API.
        verified:
          description: The verified mark, and what earned it.
          anyOf:
            - type: object
              properties:
                basis:
                  type: string
                  enum:
                    - x-followers
                    - mancer
              required:
                - basis
            - type: "null"
        x:
          anyOf:
            - type: object
              properties:
                username:
                  type: string
              required:
                - username
            - type: "null"
    BooksUnits:
      type: string
      pattern: ^[0-9]+$
      description: A non-negative integer of raw units, as a decimal string.
      example: "1000000000000000000"
    WalletTrade:
      type: object
      description: One transaction's trade, read from what left the wallet and what reached it; a route's middle steps never show.
      required:
        - id
        - txHash
        - logIndex
        - blockNumber
        - timestamp
        - token
        - tokenSymbol
        - cash
        - cashSymbol
        - pool
        - venue
        - side
        - amountToken
        - amountCash
        - priceUsd
        - volumeUsd
        - trader
      properties:
        id:
          $ref: "#/components/schemas/Hash"
          description: "The transaction's hash: a row a transaction."
        txHash:
          $ref: "#/components/schemas/Hash"
        logIndex:
          type: integer
          description: The log index of the trade's largest swap.
        blockNumber:
          type: string
        timestamp:
          type: integer
          description: Unix seconds.
        token:
          $ref: "#/components/schemas/Address"
          description: The token traded. For liquidity, the largest swap's token.
        tokenSymbol:
          type:
            - string
            - "null"
        cash:
          $ref: "#/components/schemas/Address"
          description: "The other side: the dollar over ether over any other token, and between two tokens the one given up. For liquidity, the largest swap's other side. Native ether is the zero address."
        cashSymbol:
          type:
            - string
            - "null"
        pool:
          type: string
          description: The pool of the trade's largest swap, or its id for a pool-manager venue.
        venue:
          type: string
          description: "`mancer` where the transaction called Mancer's router or its orders; else the venue of the largest swap."
        side:
          type: string
          enum:
            - buy
            - sell
            - add
            - remove
            - move
          description: "`buy` or `sell` of `token`; `add`, `remove` or `move` where the wallet put liquidity in, took it out or moved it."
        amountToken:
          type: number
          description: How much of `token` moved, in whole tokens.
        amountCash:
          type: number
          description: How much of `cash` moved, in whole tokens.
        priceUsd:
          type: number
          description: "`volumeUsd` over `amountToken`; 0 for liquidity."
        volumeUsd:
          type: number
          description: What the cash side was worth in dollars, else the token side; for liquidity, what moved in all.
        trader:
          $ref: "#/components/schemas/Address"
          description: The wallet.
        purpose:
          type: string
          enum:
            - liquidity-add
            - liquidity-remove
            - liquidity-move
          description: Present where the transaction added, removed or moved the wallet's liquidity and was no trade. Absent for a trade.
        moved:
          type: array
          description: "Present with `purpose`: what the wallet put in or took out, the most worth first."
          items:
            type: object
            required:
              - token
              - symbol
              - amount
              - usd
            properties:
              token:
                $ref: "#/components/schemas/Address"
              symbol:
                type:
                  - string
                  - "null"
              amount:
                type: number
                description: Whole tokens.
              usd:
                type: number
    TokenPositionPnl:
      type: object
      description: A wallet's trades and transfers of one token, each transaction netted for the wallet, at average cost.
      required:
        - bought
        - sold
        - received
        - sent
        - costBasisUsd
        - avgCostUsd
        - realizedUsd
        - unrealizedUsd
        - totalUsd
        - estimated
        - firstAt
        - lastAt
      properties:
        bought:
          type: object
          description: "What the wallet bought in transactions that swapped the token: whole tokens, dollars paid, transactions."
          required:
            - amount
            - usd
            - txs
          properties:
            amount:
              type: number
            usd:
              type: number
            txs:
              type: integer
        sold:
          type: object
          required:
            - amount
            - usd
            - txs
          properties:
            amount:
              type: number
            usd:
              type: number
            txs:
              type: integer
        received:
          type: object
          description: "What reached it in transactions that swapped none of the token: transfers, airdrops, allocations, liquidity taken out."
          required:
            - amount
            - txs
          properties:
            amount:
              type: number
            txs:
              type: integer
        sent:
          type: object
          required:
            - amount
            - txs
          properties:
            amount:
              type: number
            txs:
              type: integer
        costBasisUsd:
          type: number
          description: What the tokens it holds cost. A token that reached it with no trade costs that day's close.
        avgCostUsd:
          type:
            - number
            - "null"
          description: The average cost of one whole token held; null where it holds none.
        realizedUsd:
          type: number
          description: What its sales made over what the tokens sold had cost.
        unrealizedUsd:
          type:
            - number
            - "null"
          description: What it holds is worth at the token's price less its cost; null where the price values nothing.
        totalUsd:
          type:
            - number
            - "null"
          description: Realized and unrealized together; null where unrealized is.
        estimated:
          type: boolean
          description: A move before the token's first close was costed at that first close.
        firstAt:
          type:
            - integer
            - "null"
          description: Unix seconds of its first move of the token.
        lastAt:
          type:
            - integer
            - "null"
          description: Unix seconds of its last move of the token.
    TokenTraderPosition:
      type: object
      description: One wallet's position in one token.
      required:
        - token
        - wallet
        - balance
        - valueUsd
        - priceUsd
        - label
        - pnl
        - pnlWhy
        - readAt
        - source
      properties:
        token:
          $ref: "#/components/schemas/Address"
        wallet:
          $ref: "#/components/schemas/Address"
        balance:
          $ref: "#/components/schemas/Uint"
          description: What the wallet holds, unscaled.
        valueUsd:
          type:
            - number
            - "null"
          description: "`balance` at `priceUsd`; null where there is no price."
        priceUsd:
          type:
            - number
            - "null"
          description: The token's price; null where it has none, or one too thin to value a holding.
        label:
          description: What the wallet is where it holds others' tokens or none of its own; null for a trader's wallet.
          oneOf:
            - type: object
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - burn
                    - token
                    - pool
                    - custody
                    - contract
                name:
                  type: string
                  description: The name Mancer's transaction page gives it, where it gives one.
            - type: "null"
        pnl:
          oneOf:
            - $ref: "#/components/schemas/TokenPositionPnl"
            - type: "null"
        pnlWhy:
          type:
            - string
            - "null"
          enum:
            - contract
            - moves
            - dollar
            - null
          description: "Why `pnl` is null: a contract `label` names, more than 2,000 moves of the token, or a dollar token, which costs and is worth a dollar."
        readAt:
          type: integer
          description: Unix seconds the balance and moves were read; the figures that move with the price are priced as asked.
        source:
          type: string
          enum:
            - indexer
    TokenWindowsTrading:
      type: object
      description: One window's trading. Each swap of the token in one pool counts once, so a trade routed through two of its pools counts twice.
      required:
        - txns
        - buys
        - sells
        - volumeUsd
        - buyVolumeUsd
        - sellVolumeUsd
        - makers
        - buyers
        - sellers
      properties:
        txns:
          type: integer
          description: Buys and sells together.
        buys:
          type: integer
        sells:
          type: integer
        volumeUsd:
          type: number
        buyVolumeUsd:
          type: number
        sellVolumeUsd:
          type: number
        makers:
          type:
            - integer
            - "null"
          description: Distinct wallets whose balance of the token a swap moved; null where `wallets` is `none`.
        buyers:
          type:
            - integer
            - "null"
          description: Of those, the wallets that came out of a swap holding more of the token.
        sellers:
          type:
            - integer
            - "null"
          description: And the wallets that came out of a swap holding less. A wallet that did both counts in each.
    TokenWindowsResponse:
      type: object
      required:
        - token
        - asOf
        - windows
        - wallets
        - source
      properties:
        token:
          $ref: "#/components/schemas/Address"
        asOf:
          type: integer
          description: "Unix seconds of the read: every window ends there."
        windows:
          type: object
          required:
            - m5
            - h1
            - h6
            - h24
          properties:
            m5:
              $ref: "#/components/schemas/TokenWindowsTrading"
              description: The last 5 minutes.
            h1:
              $ref: "#/components/schemas/TokenWindowsTrading"
              description: The last hour.
            h6:
              $ref: "#/components/schemas/TokenWindowsTrading"
              description: The last 6 hours.
            h24:
              $ref: "#/components/schemas/TokenWindowsTrading"
              description: The last 24 hours.
        wallets:
          type: string
          enum:
            - ledger
            - none
          description: "`none` for wrapped ether, whose trades paid in native ether move no token balance, so its wallets are not counted."
        source:
          type: string
          enum:
            - indexer
    TokenHoldersPnlRow:
      type: object
      description: One holder of the token.
      required:
        - holder
        - balance
        - share
        - valueUsd
        - label
        - pnl
        - pnlWhy
      properties:
        holder:
          $ref: "#/components/schemas/Address"
        balance:
          $ref: "#/components/schemas/Uint"
          description: What it holds, unscaled.
        share:
          type:
            - number
            - "null"
          description: Its share of the total supply, from 0 to 1; null where the supply is unknown.
        valueUsd:
          type:
            - number
            - "null"
          description: "`balance` at `priceUsd`; null where there is no price."
        label:
          description: What the holder is where it holds others' tokens or none of its own; null for a trader's wallet.
          oneOf:
            - type: object
              required:
                - kind
              properties:
                kind:
                  type: string
                  enum:
                    - burn
                    - token
                    - book
                    - market
                    - pool
                    - custody
                    - contract
                  description: "`book` is one of a Book's own contracts, `market` one of an NFT market's."
                name:
                  type: string
                  description: The Book's or the market's role for its contract, or the name Mancer's transaction page gives a custody contract or router, where it gives one.
            - type: "null"
        pnl:
          oneOf:
            - $ref: "#/components/schemas/TokenPositionPnl"
            - type: "null"
        pnlWhy:
          type:
            - string
            - "null"
          enum:
            - contract
            - moves
            - budget
            - dollar
            - null
          description: "Why `pnl` is null: a holder `label` names, more than 2,000 moves of the token, past the answer's 6,000 priced moves (read it alone at the trader route), or a dollar token."
    TokenHoldersPnlResponse:
      type: object
      required:
        - token
        - holders
        - priceUsd
        - priceConfidence
        - totalSupply
        - decimals
        - top10Share
        - top
        - readAt
        - source
        - users
      properties:
        token:
          $ref: "#/components/schemas/Address"
        holders:
          type: integer
          description: How many addresses hold the token.
        priceUsd:
          type:
            - number
            - "null"
          description: The price every figure is valued at; null where the token has none, or one too thin to value a holding.
        priceConfidence:
          type:
            - string
            - "null"
          description: The kind of the token's price, as the token's detail names it.
        totalSupply:
          type:
            - string
            - "null"
          description: The total supply, unscaled; null where it is unknown.
        decimals:
          type: integer
        top10Share:
          type:
            - number
            - "null"
          description: The ten largest holders' share of the total supply, pools and contracts among them; null where the supply is unknown.
        top:
          type: array
          description: The largest holders, largest first.
          items:
            $ref: "#/components/schemas/TokenHoldersPnlRow"
        readAt:
          type: integer
          description: Unix seconds the holders and their moves were read; the figures that move with the price are priced as asked.
        source:
          type: string
          enum:
            - indexer
        users:
          type:
            - object
            - "null"
          description: The short identity of each listed wallet with no `label` that shows a name, a picture, a mark or an X handle, by lowercase address. Null where the names did not arrive in time.
          additionalProperties:
            $ref: "#/components/schemas/BooksShortIdentity"
    TokenTradersRow:
      type: object
      description: One wallet's trades of the token in the window. Amounts are whole tokens and dollars, each trade at its transaction's own price.
      required:
        - wallet
        - bought
        - sold
        - realizedUsd
        - unrealizedUsd
        - pnlUsd
        - heldFromWindow
        - movedOut
        - soldFromBefore
        - balance
        - valueUsd
        - firstAt
        - lastAt
      properties:
        wallet:
          $ref: "#/components/schemas/Address"
        bought:
          type: object
          required:
            - amount
            - usd
            - txs
          properties:
            amount:
              type: number
            usd:
              type: number
            txs:
              type: integer
        sold:
          type: object
          required:
            - amount
            - usd
            - txs
          properties:
            amount:
              type: number
            usd:
              type: number
            txs:
              type: integer
        realizedUsd:
          type: number
          description: Its sales of tokens it bought in the window, over what those cost at its average purchase price there.
        unrealizedUsd:
          type:
            - number
            - "null"
          description: What it still holds of the window's purchases at `priceUsd`, over what that cost; null where there is no price.
        pnlUsd:
          type:
            - number
            - "null"
          description: Realized and unrealized together; null where unrealized is.
        heldFromWindow:
          type: number
          description: The tokens it bought in the window and did not sell there.
        movedOut:
          type:
            - number
            - "null"
          description: "Of those, what it no longer holds: moved out by a transfer, not sold. Null where its balance was not read."
        soldFromBefore:
          description: "What it sold in the window beyond what it bought there: tokens held from before, at their sale price. They make no PnL here; null where it sold no more than it bought."
          anyOf:
            - type: object
              required:
                - amount
                - usd
              properties:
                amount:
                  type: number
                usd:
                  type: number
            - type: "null"
        balance:
          type:
            - string
            - "null"
          description: What it holds of the token now, unscaled; null where the balances were not read.
        valueUsd:
          type:
            - number
            - "null"
          description: "`balance` at `priceUsd`; null where either is null."
        firstAt:
          type: integer
          description: Unix seconds of its first trade in the window.
        lastAt:
          type: integer
          description: Unix seconds of its last trade in the window.
    TokenTradersResponse:
      description: "The ranking, or `available: false` with `why` for a token whose traders this route does not rank."
      oneOf:
        - type: object
          required:
            - token
            - available
            - window
            - sort
            - priceUsd
            - priceConfidence
            - decimals
            - traders
            - readAt
            - source
            - users
          properties:
            token:
              $ref: "#/components/schemas/Address"
            available:
              type: boolean
              enum:
                - true
            window:
              type: string
              enum:
                - 1d
                - 7d
            sort:
              type: string
              enum:
                - pnl
                - bought
                - sold
            priceUsd:
              type:
                - number
                - "null"
              description: The price unrealized PnL is reckoned at; null where the token has none, or one too thin to value a holding.
            priceConfidence:
              type:
                - string
                - "null"
              description: The kind of the token's price, as the token's detail names it.
            decimals:
              type: integer
            traders:
              type: array
              description: Up to 100 wallets, in the order `sort` names.
              items:
                $ref: "#/components/schemas/TokenTradersRow"
            readAt:
              type: integer
              description: Unix seconds the window was read; the window ends there.
            source:
              type: string
              enum:
                - indexer
            users:
              type:
                - object
                - "null"
              description: The short identity of each listed wallet that shows a name, a picture, a mark or an X handle, by lowercase address. Null where the names did not arrive in time.
              additionalProperties:
                $ref: "#/components/schemas/BooksShortIdentity"
        - type: object
          required:
            - token
            - available
            - why
            - source
            - users
          properties:
            token:
              $ref: "#/components/schemas/Address"
            available:
              type: boolean
              enum:
                - false
            why:
              type: string
              enum:
                - wrapped-ether
                - dollar
              description: Wrapped ether is traded in native ether too, which moves no token balance; a dollar token costs and is worth a dollar.
            source:
              type: string
              enum:
                - indexer
            users:
              type: "null"
    VenueFactoriesResponse:
      type: object
      required:
        - factories
        - count
      properties:
        factories:
          type: object
          description: Each pool factory's venue id, by the factory's lowercase address.
          additionalProperties:
            type: string
        count:
          type: integer
          description: How many factories `factories` holds.
    TokenDev:
      type: object
      description: A token's dev. A Book's dev is the Book's `creator`.
      required:
        - address
        - source
        - since
      properties:
        address:
          $ref: "#/components/schemas/Address"
        source:
          type: string
          enum:
            - assigned
            - book
            - launchpad
          description: "`assigned`: Mancer named the wallet, which beats every other source. `book`: a Book's own token, the wallet that opened it. `launchpad`: the wallet the token's launch log names, never a contract."
        since:
          type:
            - integer
            - "null"
          description: "Unix seconds: the assignment, the Book's open or the token's launch; null where unknown."
