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

# All spot mids

> Live mid + last trade price for every spot market (global topic). Display numbers only: spot has no oracle, and perp prices stay on all_market_prices.



## AsyncAPI

````yaml api-reference/asyncapi.json allSpotMids
id: allSpotMids
title: All spot mids
description: >-
  Live mid + last trade price for every spot market (global topic). Display
  numbers only: spot has no oracle, and perp prices stay on all_market_prices.
servers:
  - id: testnet
    protocol: wss
    host: api.testnet.aptoslabs.com/decibel/ws
    bindings: []
    variables: []
address: all_spot_mids
parameters: []
bindings: []
operations:
  - &ref_2
    id: receiveallSpotMids
    title: Receiveall spot mids
    description: >-
      Receive updates for live mid + last trade price for every spot market
      (global topic). display numbers only: spot has no oracle, and perp prices
      stay on all_market_prices.
    type: receive
    messages:
      - &ref_3
        id: AllSpotMidsMessage
        payload:
          - name: AllSpotMidsMessage
            description: >-
              Live mid + last trade price for every spot market (global topic).
              Display numbers only: spot has no oracle, and perp prices stay on
              all_market_prices.
            type: object
            properties:
              - name: mids
                type: array
                required: true
                properties:
                  - name: asset_type
                    type: string
                    description: >-
                      Discriminator carried on every dual-use DTO (orders, bulk
                      orders, bulk

                      order fills) so a single response can mix perp and spot
                      rows. Also accepted

                      as a query parameter on those endpoints to filter to one
                      product.


                      Wire format is lowercase (`"perp"` / `"spot"`) and
                      accepted

                      case-insensitively on the request side via
                      [`impl_case_insensitive_deserialize`].
                    enumValues:
                      - perp
                      - spot
                    required: true
                  - name: last_trade_price
                    type: &ref_0
                      - number
                      - 'null'
                    description: >-
                      Close of the current 1m candle = most recent fill price.
                      Null if the

                      market never traded since candle state exists (candles
                      restore empty

                      on a full ClickHouse fallback until the next fill —
                      DCBL-730).
                    required: false
                  - name: market_addr
                    type: string
                    required: true
                  - name: mid
                    type: &ref_1
                      - number
                      - 'null'
                    description: >-
                      (best_bid + best_ask) / 2 from the live L1 book (resting
                      bulk ladders

                      included); null unless both sides have liquidity.
                    required: false
                  - name: transaction_unix_ms
                    type: integer
                    required: true
              - name: topic
                type: string
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - topic
            - mids
          properties:
            mids:
              type: array
              items:
                type: object
                description: >-
                  Lightweight per-market price row for the `all_spot_mids`
                  topic: the

                  lowest-common-denominator "current price" (book mid + last
                  trade), never

                  oracle/mark/funding. These are DISPLAY numbers — perp margin
                  math stays on

                  `/prices` mark/oracle, which this surface deliberately does
                  not carry.

                  `asset_type` keeps the shape product-generic, but only spot
                  rows are

                  published today (perp already has `all_market_prices`).
                required:
                  - market_addr
                  - asset_type
                  - transaction_unix_ms
                properties:
                  asset_type:
                    type: string
                    description: >-
                      Discriminator carried on every dual-use DTO (orders, bulk
                      orders, bulk

                      order fills) so a single response can mix perp and spot
                      rows. Also accepted

                      as a query parameter on those endpoints to filter to one
                      product.


                      Wire format is lowercase (`"perp"` / `"spot"`) and
                      accepted

                      case-insensitively on the request side via
                      [`impl_case_insensitive_deserialize`].
                    enum:
                      - perp
                      - spot
                    x-parser-schema-id: AssetType
                  last_trade_price:
                    type: *ref_0
                    format: double
                    description: >-
                      Close of the current 1m candle = most recent fill price.
                      Null if the

                      market never traded since candle state exists (candles
                      restore empty

                      on a full ClickHouse fallback until the next fill —
                      DCBL-730).
                    x-parser-schema-id: <anonymous-schema-232>
                  market_addr:
                    type: string
                    example: 0xmarket123...
                    x-parser-schema-id: <anonymous-schema-233>
                  mid:
                    type: *ref_1
                    format: double
                    description: >-
                      (best_bid + best_ask) / 2 from the live L1 book (resting
                      bulk ladders

                      included); null unless both sides have liquidity.
                    x-parser-schema-id: <anonymous-schema-234>
                  transaction_unix_ms:
                    type: integer
                    format: int64
                    x-parser-schema-id: <anonymous-schema-235>
                x-parser-schema-id: MidDto
              x-parser-schema-id: <anonymous-schema-231>
            topic:
              type: string
              x-parser-schema-id: <anonymous-schema-236>
          x-parser-schema-id: AllSpotMidsResponse
        title: All spot mids message
        description: >-
          Live mid + last trade price for every spot market (global topic).
          Display numbers only: spot has no oracle, and perp prices stay on
          all_market_prices.
        example: |-
          {
            "topic": "all_spot_mids",
            "mids": [
              {
                "market_addr": "0x26f1ddaa436a7b134d5c872c032eaa66653b673bca2bb1539642094d6b113c50",
                "asset_type": "spot",
                "mid": 4.5,
                "last_trade_price": 4.51,
                "transaction_unix_ms": 1699564800000
              }
            ]
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: AllSpotMidsMessage
          - id: x-parser-message-name
            value: AllSpotMidsMessage
    bindings: []
    extensions:
      - id: x-parser-unique-object-id
        value: allSpotMids
sendOperations:
  - *ref_2
receiveOperations: []
sendMessages:
  - *ref_3
receiveMessages: []
extensions:
  - id: x-parser-unique-object-id
    value: allSpotMids
securitySchemes: []

````