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

# Get Order Quote

> Get a fill estimate for a prediction market order, showing expected average price and size across order book levels.

<Warning>**Alpha** — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.</Warning>

### Request Body

<ParamField body="tokenId" type="string" required>
  The outcome token ID to get a quote for.
</ParamField>

<ParamField body="side" type="string" required>
  Order side: `BUY` or `SELL`.
</ParamField>

<ParamField body="size" type="number" required>
  Number of tokens to buy or sell. Must be positive.
</ParamField>

### Response

<ResponseField name="data" type="object">
  Fill estimation result.

  <Expandable title="Fill Result">
    <ResponseField name="avgPriceUSD" type="number">Volume-weighted average fill price.</ResponseField>
    <ResponseField name="bestPriceUSD" type="number">Best available price in the order book.</ResponseField>
    <ResponseField name="totalCostUSD" type="number">Total cost in USDC.</ResponseField>
    <ResponseField name="filledToken" type="number">Total tokens that would be filled.</ResponseField>
    <ResponseField name="unfilledToken" type="number">Tokens that could not be filled (insufficient liquidity).</ResponseField>
    <ResponseField name="side" type="string">Order side (`BUY` or `SELL`).</ResponseField>
    <ResponseField name="outcomeId" type="string">Outcome token ID.</ResponseField>
    <ResponseField name="amountInUSD" type="number">Input amount in USD.</ResponseField>
    <ResponseField name="amountOutUSD" type="number">Output amount in USD.</ResponseField>
    <ResponseField name="marketImpactPercentage" type="number">Price impact as a percentage.</ResponseField>
    <ResponseField name="requestId" type="string">Unique request ID for tracking and support.</ResponseField>

    <ResponseField name="fee" type="object">
      Fee details.

      <Expandable title="Fee">
        <ResponseField name="amountUSD" type="string">Fee amount in USD.</ResponseField>
        <ResponseField name="platformFeesPercentage" type="number">Fee as a percentage.</ResponseField>
        <ResponseField name="wallet" type="string | null">Address receiving the fee.</ResponseField>
        <ResponseField name="deductedFrom" type="string">Which side the fee is deducted from (`input` or `output`).</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="outcome" type="object">
      Outcome metadata.

      <Expandable title="Outcome">
        <ResponseField name="outcomeId" type="string">Outcome token ID.</ResponseField>
        <ResponseField name="label" type="string | null">Outcome label (e.g. "Yes", "No").</ResponseField>
        <ResponseField name="marketId" type="string | null">Market condition ID.</ResponseField>
        <ResponseField name="question" type="string | null">Market question text.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="details" type="object">
      Detailed breakdown.

      <Expandable title="Details">
        <ResponseField name="levels" type="array">
          Breakdown by order book level.

          <Expandable title="Fill Level">
            <ResponseField name="priceUSD" type="number">Price at this level.</ResponseField>
            <ResponseField name="sizeToken" type="number">Available size at this level.</ResponseField>
            <ResponseField name="filledToken" type="number">Amount filled at this level.</ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hostname" type="string">Server node identifier.</ResponseField>
<ResponseField name="took" type="number">Request processing time in milliseconds.</ResponseField>

### Usage Example

```bash theme={null}
curl -X POST "https://api.mobula.io/api/2/pm/order/quote" \
  -H "Content-Type: application/json" \
  -d '{
    "tokenId": "71321045533314185944161150504789982525459828614995786377552078351132518100924",
    "side": "BUY",
    "size": 1000
  }'
```

### Example Response

```json theme={null}
{
  "data": {
    "avgPriceUSD": 0.352,
    "bestPriceUSD": 0.35,
    "totalCostUSD": 352,
    "filledToken": 1000,
    "unfilledToken": 0,
    "side": "BUY",
    "outcomeId": "71321...",
    "amountInUSD": 352,
    "amountOutUSD": 352,
    "marketImpactPercentage": 0.57,
    "requestId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "fee": {
      "amountUSD": "0.000000",
      "platformFeesPercentage": 0,
      "wallet": null,
      "deductedFrom": "input"
    },
    "outcome": {
      "outcomeId": "71321...",
      "label": null,
      "marketId": null,
      "question": null
    },
    "details": {
      "levels": [
        { "priceUSD": 0.35, "sizeToken": 5000, "filledToken": 800 },
        { "priceUSD": 0.36, "sizeToken": 3000, "filledToken": 200 }
      ]
    }
  },
  "hostname": "node-xyz",
  "took": 42
}
```


## OpenAPI

````yaml POST /2/pm/order/quote
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula API
  description: >-
    Documentation of the Mobula API


    **Demo API**: The default server (demo-api.mobula.io) is a demo API with
    rate limits.

    For production use, please use api.mobula.io with an API key from
    https://admin.mobula.io
servers:
  - url: https://demo-api.mobula.io/api/
    description: Demo API (rate limited, for testing only)
  - url: https://api.mobula.io/api/
    description: Production API (requires API key)
security: []
tags:
  - name: V2 - Token
    description: Token details, price, security, ATH, and holder data
  - name: V2 - Market Data
    description: Market details, OHLCV history, and lighthouse metrics
  - name: V2 - Trades
    description: Token trades, enriched trades, and trade filters
  - name: V2 - Wallet
    description: Wallet positions, activity, trades, analysis, and labels
  - name: V2 - Assets
    description: Cross-chain asset details and price history
  - name: V2 - Swap
    description: Swap quoting and execution
  - name: V2 - Perps
    description: Perpetual futures quoting, execution, and positions
  - name: V2 - Bridge
    description: Cross-chain bridge quoting and intent status (Alpha Preview)
  - name: V2 - DeFi
    description: Bonding pools and pulse data
  - name: V2 - Search
    description: Universal fast search
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V1 - Market Data
    description: Market prices, history, sparklines, pairs, and multi-data
  - name: V1 - Wallet
    description: Wallet portfolio, transactions, history, and NFTs
  - name: V1 - Token
    description: First buyers
  - name: V1 - Trades
    description: Market trades by pair
  - name: V1 - Metadata
    description: Token metadata, categories, trendings, and news
  - name: V1 - Assets
    description: List all assets
  - name: V1 - Search
    description: Search for assets, tokens, and pairs
  - name: V1 - DeFi
    description: Bonding pool pulse data
  - name: V1 - Blockchains
    description: Blockchain listings, pairs, and stats
  - name: V1 - Webhooks
    description: Webhook management
  - name: V1 - Feed
    description: Custom feed creation
paths:
  /2/pm/order/quote:
    post:
      tags:
        - V2 - Prediction Markets
      summary: Quote an order against the live book (price impact / expected fill)
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tokenId:
                  type: string
                  minLength: 1
                  pattern: ^[0-9]+$
                side:
                  type: string
                size:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                  maximum: 100000000
              required:
                - tokenId
                - side
                - size
      responses:
        '201':
          description: Prediction Markets response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                    description: >-
                      See the per-endpoint reference for the exact response
                      shape.
                  hostname:
                    type: string
                  took:
                    type: number
                required:
                  - hostname
                  - took

````