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

# Get last trade price

> Last trade price and side. **Defaults to `"0.5"` (NOT `"0.000"`)
and side `""` when no trade has printed** — matching the
canonical CLOB sentinel. Compare with `/book`'s
`last_trade_price: "0.000"` empty default.




## OpenAPI

````yaml /api-reference/openapi.yaml get /last-trade-price
openapi: 3.0.3
info:
  title: XO Orderbook API
  description: |
    Public REST surface of the XO CLOB API.

    XO mainnet chain id is `3223`. The EIP-712 order domain is
    `XO Market CLOB` with `verifyingContract` set to the
    [CTF Exchange](/) address. See
    [Smart accounts](../guides/smart-accounts) for the smart-account
    identity model and ERC-1271 order signing.

    Wire conventions:
      * Prices are trimmed decimal strings (e.g. `"0.5"`, `"0.555"`).
      * Sizes are decimal-string integers in human shares.
      * Timestamps in trade and book responses are stringified Unix
        seconds / milliseconds (the SDK uses `TimestampSeconds<String>`
        / `TimestampMilliSeconds<String>`).
      * Token IDs are decimal U256 strings; condition IDs are
        `0x`-prefixed 32-byte hex.
  version: 1.0.0
  contact:
    name: XO Market
    url: https://beta.xo.market
servers:
  - url: https://orderbooks.xo.market
    description: Mainnet (XO chain id 3223)
security: []
tags:
  - name: Authentication
    description: >-
      Create and manage API keys. The L1 ClobAuth EIP-712 flow mints HMAC
      credentials that authenticate every other private request.
  - name: Market Data
    description: >-
      Public reads for books, prices, midpoints, spreads, last trades, and price
      history. Also includes server time and per-token configuration.
  - name: Markets
    description: >-
      Discovery for tradable markets, including pagination and SDK-compatible
      simplified shapes.
  - name: Trade
    description: Place, cancel, and inspect orders and trades for the authenticated maker.
  - name: Account
    description: Maker balance, allowance, positions, and claimable settled positions.
paths:
  /last-trade-price:
    get:
      tags:
        - Market Data
      summary: Get last trade price
      description: |
        Last trade price and side. **Defaults to `"0.5"` (NOT `"0.000"`)
        and side `""` when no trade has printed** — matching the
        canonical CLOB sentinel. Compare with `/book`'s
        `last_trade_price: "0.000"` empty default.
      parameters:
        - in: query
          name: token_id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                  - price
                  - side
                properties:
                  price:
                    type: string
                  side:
                    type: string
                    enum:
                      - BUY
                      - SELL
                      - ''
              examples:
                populated:
                  summary: most recent print (illustrative)
                  value:
                    price: '0.553'
                    side: BUY
                no_trades_yet:
                  summary: >-
                    token has never traded (real dev response — defaults to 0.5
                    + empty side)
                  value:
                    price: '0.5'
                    side: ''
        '404':
          $ref: '#/components/responses/Error404'
      x-codeSamples:
        - lang: Rust
          label: xo-orderbook-client-rs
          source: >
            use xo_orderbook_client::orderbook::{Client, Config};

            use
            xo_orderbook_client::orderbook::types::request::LastTradePriceRequest;

            use xo_orderbook_client::types::U256;


            let client = Client::new("https://orderbooks.xo.market",
            Config::default())?;

            let token_id = U256::from_str_radix(
                "26516164265702901957933644848127860370782874751279270726689263951695181556943",
                10,
            )?;

            let resp = client
                .last_trade_price(&LastTradePriceRequest { token_id })
                .await?;
            // Defaults to price="0.5", side="" when the token has never traded.
components:
  responses:
    Error404:
      description: |
        Resource not found. The message embeds the requested identifier
        verbatim (`market not found: 0x…`, `trade not found: 0x…`,
        `no API key found for address 0x…`). Read endpoints that fail
        token lookup return the canonical CLOB string
        `"No orderbook exists for the requested token id"`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            market_not_found:
              summary: unknown condition_id
              value:
                error: >-
                  market not found:
                  0x0000000000000000000000000000000000000000000000000000000000000000
            no_orderbook:
              summary: unknown token_id on a read endpoint
              value:
                error: No orderbook exists for the requested token id
            trade_not_found:
              summary: unknown trade id
              value:
                error: >-
                  trade not found:
                  0x0000000000000000000000000000000000000000000000000000000000000000
            api_key_not_found:
              summary: derive-api-key called for an address with no key
              value:
                error: >-
                  no API key found for address
                  0xCAFE000000000000000000000000000000000A11
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string

````