> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rekt.money/llms.txt
> Use this file to discover all available pages before exploring further.

# Volume by market

> Settlements, stake and notional of each market. All time. Poll no more than once every 10 seconds.



## OpenAPI

````yaml /openapi/data-api.json get /v0/markets
openapi: 3.1.0
info:
  title: Rekt data API
  version: '0'
  summary: Read-only HTTP API for settled trades and ended positions.
  description: >-
    `https://data.rekt.trading` serves settled trades and ended positions. It is
    read-only and it needs no account. It sets no cookies and accepts no
    credentials. Responses carry `Access-Control-Allow-Origin: *`. Start at `GET
    /v0/health`.


    The program is the ground of truth. This API is a lagging mirror of it. Read
    live state from the chain through the SDK.


    Rules:


    - Every route answers `GET`, `HEAD` and `OPTIONS`. Any other method gets
    `405`.

    - A request URL is at most 2,048 characters. A longer one gets `414`.

    - Requests are rate-limited for each client address. `GET /v0/health` states
    the limit under `access`. A request over it gets `429` and a `Retry-After`
    header. Wait that long, then retry.

    - This API ignores a parameter that it does not know. A filter that this API
    refuses gets `400`.

    - Money amounts are decimal strings of base units of USDC (6 decimals).
    Addresses are 64 hex characters unless a field says base58. Transaction
    signatures are base58.

    - A response can hold fields that this description does not list. Ignore a
    field that you do not know.
servers:
  - url: https://data.rekt.trading
    description: The data API.
security: []
tags:
  - name: Health
    description: Freshness and limits.
  - name: Aggregates
    description: All-time totals and day series.
  - name: Trades
    description: Settled trades of the last 48 hours.
  - name: Positions
    description: Ended positions of the last 48 hours.
  - name: Minute
    description: Minute rounds of the last 48 hours.
paths:
  /v0/markets:
    get:
      tags:
        - Aggregates
      summary: Volume by market
      description: >-
        Settlements, stake and notional of each market. All time. Poll no more
        than once every 10 seconds.
      operationId: getMarkets
      responses:
        '200':
          description: Volume by market.
          headers:
            Cache-Control:
              description: '`public, max-age=10, stale-while-revalidate=30`.'
              schema:
                type: string
            Warning:
              description: >-
                Present only when `asOf.stale` is true. It states that the
                archive is stale.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MarketsResponse'
        '414':
          $ref: '#/components/responses/UriTooLong'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    MarketsResponse:
      type: object
      description: Volume by market, for all time.
      properties:
        asOf:
          $ref: '#/components/schemas/AsOf'
        question:
          type: string
          description: What this response answers, in words.
        volumeNote:
          type: string
          description: How to read `stake` and `notional`, in words.
        window:
          type: object
          description: The settlements that this response counts.
          properties:
            trades:
              type: integer
              description: 'The number of settlements. Unit: settlements.'
            fromSlot:
              type:
                - integer
                - 'null'
              description: 'The slot of the oldest settlement. Unit: slots.'
            toSlot:
              type:
                - integer
                - 'null'
              description: 'The slot of the newest settlement. Unit: slots.'
            fromAt:
              type:
                - string
                - 'null'
              description: The time of the oldest settlement, in UTC (ISO 8601).
              format: date-time
            toAt:
              type:
                - string
                - 'null'
              description: The time of the newest settlement, in UTC (ISO 8601).
              format: date-time
        totals:
          $ref: '#/components/schemas/VolumeCell'
        markets:
          type: array
          description: The volume of each market.
          items:
            type: object
            description: The volume of one market.
            properties:
              market:
                type: string
                description: The market account address, as 64 hex characters.
                pattern: ^[0-9a-f]{64}$
              address:
                type: string
                description: The market account address, in base58.
              symbol:
                type:
                  - string
                  - 'null'
                description: >-
                  The symbol of the market. Null when this server cannot name
                  it: read the symbol from the chain.
              priceKind:
                type:
                  - string
                  - 'null'
                description: The name of the price source of the market.
              trades:
                type: integer
                description: 'The number of settlements. Unit: settlements.'
              stake:
                type: string
                pattern: ^[0-9]+$
                description: >-
                  The sum of the stakes. Unit: base units of USDC (6 decimals),
                  as a decimal string.
              notional:
                type: string
                pattern: ^[0-9]+$
                description: >-
                  The sum of `stake × tier`. Unit: base units of USDC (6
                  decimals), as a decimal string.
              notionalUnknown:
                type: integer
                description: >-
                  The number of settlements whose tier is not known. `notional`
                  does not include them. Unit: settlements.
        priceKinds:
          type: object
          description: >-
            The name of the price source of each market. The key is the market
            account address as 64 hex characters.
          additionalProperties:
            type: string
        commitMode:
          type: object
          description: Order counts by market, for all time.
          properties:
            byMarket:
              type: object
              description: >-
                The order counts of each market. The key is the market account
                address as 64 hex characters.
              additionalProperties:
                type: object
                description: The order counts of one market.
                properties:
                  ordersFilled:
                    type: integer
                    description: 'The number of orders that the venue filled. Unit: orders.'
                  opensVoided:
                    type: integer
                    description: >-
                      The number of orders that the venue returned. Unit:
                      orders.
                  addsReversed:
                    type: integer
                    description: 'The number of adds that the venue returned. Unit: adds.'
      required:
        - asOf
        - window
        - totals
        - markets
    AsOf:
      type: object
      description: How fresh the archive is at the time of this response.
      properties:
        generatedAt:
          type: string
          description: The time the server made this response, in UTC (ISO 8601).
          format: date-time
        archiveTailSlot:
          type:
            - integer
            - 'null'
          description: >-
            The slot of the newest transaction in the archive. Unit: slots. Null
            when the archive is empty.
        archiveTailAt:
          type:
            - string
            - 'null'
          description: >-
            The block time of the newest transaction in the archive, in UTC (ISO
            8601). Null when the archive is empty.
          format: date-time
        stale:
          type: boolean
          description: >-
            True when the archive has not moved for longer than its freshness
            limit. The server still sends a stale response, with a `Warning`
            header.
        staleReason:
          type:
            - string
            - 'null'
          description: Why the archive is stale, in words. Null when `stale` is false.
        entryFeeBasis:
          type: string
          description: >-
            How the entry fees in the rows were found. `observed` means each fee
            is the fee that the trade paid. Only the routes whose rows carry an
            entry fee send this field.
          enum:
            - observed
      required:
        - generatedAt
        - archiveTailSlot
        - archiveTailAt
        - stale
        - staleReason
    VolumeCell:
      type: object
      description: Volume for one period.
      properties:
        trades:
          type: integer
          description: 'The number of settlements. Unit: settlements.'
        stake:
          type: string
          pattern: ^[0-9]+$
          description: >-
            The sum of the stakes. Unit: base units of USDC (6 decimals), as a
            decimal string.
        notional:
          type: string
          pattern: ^[0-9]+$
          description: >-
            The sum of `stake × tier`. Unit: base units of USDC (6 decimals), as
            a decimal string.
        notionalUnknown:
          type: integer
          description: >-
            The number of settlements whose tier is not known. `notional` does
            not include them. Unit: settlements.
      required:
        - trades
        - stake
        - notional
        - notionalUnknown
    Error:
      type: object
      description: A refused request.
      properties:
        error:
          type: string
          description: What is wrong, in words.
        retryAfterSeconds:
          type: integer
          description: 'On `429` only: wait this long, then retry. Unit: seconds.'
        routes:
          type: array
          items:
            type: string
          description: 'On `404` for an unknown route only: the routes that this API serves.'
      required:
        - error
  responses:
    UriTooLong:
      description: The request URL is longer than 2,048 characters. Shorten it.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: >-
        Too many requests. Wait `Retry-After` seconds, then retry. `GET
        /v0/health` states the limit under `access`.
      headers:
        Retry-After:
          description: 'Wait this long before you retry. Unit: seconds.'
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ServerError:
      description: The server could not answer. Retry later.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.