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

# Orderbook Snapshot

> Orderbook Snapshot

 Get the complete orderbook snapshot for a trading pair showing all bids
 and asks with their price levels. This is a public endpoint that does
 not require authentication.



## OpenAPI

````yaml /proto-openapi/api/openapi.yaml get /api/v1/orderbook/{tradingPairId}
openapi: 3.0.3
info:
  title: Monaco Protocol API
  description: REST API for the Monaco Protocol hybrid CLOB exchange.
  version: 1.0.0
servers:
  - url: https://staging.apimonaco.xyz
    description: Staging server (Testnet)
security: []
tags:
  - name: AccountsService
  - name: ApplicationsService
  - name: AuthService
  - name: BuildercodeRewardsService
  - name: CopyTradingService
  - name: DelegatedAgentsService
  - name: FaucetService
  - name: FeesService
  - name: HealthService
  - name: ManagedMarketsService
    description: |-
      Wallet-authenticated maker assignments. The signed session must match both
       configured maker user and application. Owner IDs are process fences, never auth.
       Only wallet sessions are supported; delegated-agent sessions receive 403.
  - name: MarginAccountsService
    description: |-
      Current public isolated-margin semantics:
       - a user has one parent margin account per application scope
       - opening orders create or reuse isolated position buckets under that parent
       - parent account creation is handled internally by margin workflows
  - name: MarketService
  - name: OrderbookService
  - name: OrdersService
  - name: PositionsService
    description: |-
      Current public isolated-margin semantics:
       - positions link to a parent margin account and, when applicable, a bucket id
       - opening orders create or reuse isolated position buckets under the parent
       - users can open another isolated position by reusing the parent account with a different market bucket
  - name: PulseService
  - name: SweeperService
  - name: TraderCodeService
  - name: TradesService
  - name: WhitelistService
  - name: WithdrawalsService
paths:
  /api/v1/orderbook/{tradingPairId}:
    get:
      tags:
        - OrderbookService
        - Orderbook
      summary: Orderbook Snapshot
      description: |-
        Orderbook Snapshot

         Get the complete orderbook snapshot for a trading pair showing all bids
         and asks with their price levels. This is a public endpoint that does
         not require authentication.
      operationId: get_orderbook_snapshot
      parameters:
        - name: tradingPairId
          in: path
          required: true
          schema:
            type: string
            default: 893d2add-2f36-4ee7-b660-893d2add2f36
          example: 893d2add-2f36-4ee7-b660-893d2add2f36
        - name: levels
          in: query
          schema:
            type: integer
            format: uint32
            minimum: 1
            maximum: 100
            default: 20
          description: Number of price levels (max 100)
        - name: tradingMode
          in: query
          schema:
            type: string
            enum:
              - SPOT
              - MARGIN
            minLength: 1
          description: Trading mode
        - name: magnitude
          in: query
          schema:
            type: string
            enum:
              - '0.0001'
              - '0.001'
              - '0.01'
              - '0.1'
              - '1'
              - '10'
              - '100'
              - '1000'
              - '10000'
            minLength: 1
          description: Price grouping magnitude
        - name: denomination
          in: query
          schema:
            type: string
            enum:
              - base
              - quote
            minLength: 1
          description: Price denomination
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetOrderbookResponse'
        '400':
          description: Invalid magnitude or denomination value
        '404':
          description: Trading pair not found
        '500':
          description: Matching engine not initialized or internal error
components:
  schemas:
    GetOrderbookResponse:
      type: object
      properties:
        baseDecimals:
          example: 8
          type: integer
          description: Base token decimal places
          format: int32
          nullable: true
        baseToken:
          example: BTC
          type: string
          description: Base token symbol
          nullable: true
        data:
          $ref: '#/components/schemas/OrderbookData'
        eventType:
          example: orderbook_snapshot
          type: string
          description: Event type identifier
          nullable: true
        symbol:
          example: BTC/USDC
          type: string
          description: Trading pair symbol
          nullable: true
        tradingPairId:
          example: 123e4567-e89b-12d3-a456-426614174000
          type: string
          description: Trading pair UUID
          format: uuid
          nullable: true
        quoteDecimals:
          example: 6
          type: integer
          description: Quote token decimal places
          format: int32
          nullable: true
        quoteToken:
          example: USDC
          type: string
          description: Quote token symbol
          nullable: true
        sequenceNumber:
          example: 12345
          type: integer
          description: Orderbook sequence number
          format: uint32
          nullable: true
        timestamp:
          example: '2023-11-13T10:30:00Z'
          type: string
          description: Snapshot timestamp
          nullable: true
        tradingMode:
          example: Spot
          type: string
          description: Trading mode
          nullable: true
      description: Orderbook snapshot with token metadata and sequence number.
    OrderbookData:
      type: object
      properties:
        bids:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevel'
          nullable: true
        asks:
          type: array
          items:
            $ref: '#/components/schemas/PriceLevel'
          nullable: true
        bestBid:
          example: '34900.00'
          type: string
          description: Highest bid price
          nullable: true
        bestAsk:
          example: '35100.00'
          type: string
          description: Lowest ask price
          nullable: true
        bidVolume:
          example: '15.5'
          type: string
          description: Total bid-side volume
          nullable: true
        askVolume:
          example: '12.3'
          type: string
          description: Total ask-side volume
          nullable: true
        priceChange:
          $ref: '#/components/schemas/PriceChange'
    PriceLevel:
      type: object
      properties:
        price:
          example: '35000.00'
          type: string
          description: Price at this level
          nullable: true
        quantity:
          example: '1.5'
          type: string
          description: Total quantity at this price level
          nullable: true
        orderCount:
          example: 3
          type: integer
          description: Number of orders at this price level
          format: uint32
          nullable: true
    PriceChange:
      type: object
      properties:
        price24hAgo:
          example: '34500.00'
          type: string
          description: Price 24 hours ago
          nullable: true
        priceChange24h:
          example: '500.00'
          type: string
          description: Absolute price change in last 24 hours
          nullable: true
        priceChangePercent24h:
          example: '1.45'
          type: string
          description: Percentage price change in last 24 hours
          nullable: true

````

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