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

# fetch_orderbook_impact

> Average fill price and slippage (bps) for a market order of `size` contracts on each side.

Average fill price and slippage (bps) for a market order of `size` contracts on each side.


## OpenAPI

````yaml openpx.openapi.yaml GET /v1/orderbook/fetch_orderbook_impact
openapi: 3.1.0
info:
  title: OpenPX Unified API
  description: >-
    Unified API surface across prediction-market exchanges. One `Exchange`
    trait, one set of models, one shape — implemented in Rust with
    auto-generated Python and TypeScript SDKs.


    This OpenAPI spec is **auto-generated** from
    `engine/core/src/exchange/traits.rs` and `schema/openpx.schema.json`. Edit
    the trait or the schema, then regenerate via `just openapi`. The spec models
    trait methods as REST operations for documentation rendering only — OpenPX
    is an in-process Rust library, not a REST service.
  version: 0.3.1
  license:
    name: MIT
servers:
  - url: https://github.com/openpx-trade/openpx
    description: >-
      Documentation surface only. OpenPX is an in-process Rust library; there is
      no hosted REST endpoint.
security: []
tags:
  - name: Markets
  - name: Orders
  - name: Positions
  - name: Balance
  - name: Orderbook
  - name: Trades
  - name: Fills
  - name: Server
paths:
  /v1/orderbook/fetch_orderbook_impact:
    get:
      tags:
        - Orderbook
      summary: Fetch orderbook impact
      description: >-
        Average fill price and slippage (bps) for a market order of `size`
        contracts on each side.
      operationId: fetch_orderbook_impact
      parameters:
        - name: asset_id
          in: query
          required: true
          schema:
            type: string
        - name: size
          in: query
          required: true
          schema:
            format: double
            type: number
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderbookImpact'
        default:
          description: Unified error response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OpenPxError'
components:
  schemas:
    OrderbookImpact:
      description: Slippage curve at one requested size.
      properties:
        asset_id:
          description: Orderable asset id (e.g. `"KXBTCD-25APR1517"`).
          type: string
        buy_avg_price:
          description: Average fill price hitting asks (e.g. `0.625`).
          format: double
          type:
            - number
            - 'null'
        buy_fill_pct:
          description: Buy-side fill percentage in `[0, 100]` (e.g. `100.0`).
          format: double
          type: number
        buy_slippage_bps:
          description: Buy-side slippage vs mid in basis points (e.g. `80.0`).
          format: double
          type:
            - number
            - 'null'
        exchange_ts:
          description: Upstream snapshot time in UTC; `null` when not provided.
          format: date-time
          type:
            - string
            - 'null'
        mid:
          description: Mid price as YES probability (e.g. `0.62`).
          format: double
          type:
            - number
            - 'null'
        openpx_ts:
          description: Wall-clock time OpenPX served the response (UTC).
          format: date-time
          type: string
        sell_avg_price:
          description: Average fill price hitting bids (e.g. `0.615`).
          format: double
          type:
            - number
            - 'null'
        sell_fill_pct:
          description: Sell-side fill percentage in `[0, 100]` (e.g. `100.0`).
          format: double
          type: number
        sell_slippage_bps:
          description: Sell-side slippage vs mid in basis points (e.g. `80.0`).
          format: double
          type:
            - number
            - 'null'
        size:
          description: Requested order size in contracts (e.g. `100.0`).
          format: double
          type: number
      required:
        - asset_id
        - buy_fill_pct
        - openpx_ts
        - sell_fill_pct
        - size
      title: OrderbookImpact
      type: object
    OpenPxError:
      type: object
      description: >-
        Unified error type returned when an exchange call fails. The `kind`
        field is the canonical category; `message` carries the upstream
        explanation. Per-exchange variants are mapped into this shape before
        they cross the trait boundary.
      required:
        - kind
        - message
      properties:
        kind:
          type: string
          enum:
            - Authentication
            - InsufficientFunds
            - MarketNotFound
            - OrderNotFound
            - RateLimited
            - NetworkError
            - Api
            - Config
            - NotSupported
        message:
          type: string

````