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

> ## Agent Instructions
> To integrate AGG, start with Quickstart: REST (https://docs.agg.market/quickstart/rest), then Order lifecycle & statuses (https://docs.agg.market/concepts/order-lifecycle).
> Track every trade until it reaches a terminal status. Before retrying a failed or timed-out call, read Errors, retries & idempotency (https://docs.agg.market/concepts/errors).
> The API reference is generated from https://docs.agg.market/openapi/openapi.json.

# Preview a withdrawal

> Returns real fee + receive estimates for a withdrawal without creating one. Optional — /execution/withdraw does not require a prior preview.



## OpenAPI

````yaml /openapi/openapi.json post /execution/withdraw/preview
openapi: 3.0.2
info:
  title: AGG API
  version: 1.0.0
  description: >-
    Prediction market aggregator REST API — authentication, users, venue events,
    venue markets, orderbooks, charts, and execution workflows.
servers:
  - url: https://api.agg.market
    description: Production
security: []
tags:
  - name: Authentication
    description: Sign users in and manage their session tokens.
  - name: Markets
    description: Find events, markets and outcomes to trade.
  - name: Market Data
    description: Live orderbooks, prices, charts and scores for those markets.
  - name: Trading
    description: Quote, place, sign, track and cancel orders.
  - name: Portfolio
    description: A user's orders, positions, balances and activity.
  - name: Funding
    description: Deposit addresses, withdrawals, balance refills and fiat on-ramp.
  - name: Users
    description: The signed-in user's profile, linked accounts, KYC and venue keys.
  - name: Hosted Venue Accounts
    description: Provision, fund and withdraw from venue accounts hosted for the user.
  - name: Webhooks
    description: Configure and operate webhook delivery to your server.
  - name: Partner Admin
    description: Server-side reads across your app's users, orders and analytics.
  - name: Paper Trading
    description: Simulated accounts and orders for testing without real funds.
  - name: News
    description: News feeds linked to markets.
  - name: Correlated Markets
    description: Markets related to a given market and the effect of its resolution.
paths:
  /execution/withdraw/preview:
    post:
      tags:
        - Funding
      summary: Preview a withdrawal
      description: >-
        Returns real fee + receive estimates for a withdrawal without creating
        one. Optional — /execution/withdraw does not require a prior preview.
      operationId: withdrawPreview
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amountRaw
                - tokenSymbol
                - destinationAddress
                - destinationChainId
              properties:
                requestId:
                  format: uuid
                  description: >-
                    Optional idempotency key for an exact-amount transfer. Reuse
                    with the identical body to recover a lost response. Not
                    combined with max.
                  type: string
                amountRaw:
                  pattern: ^[1-9][0-9]*$
                  description: >-
                    Amount to withdraw, as a positive integer string in the
                    destination token's atomic units (6 decimals, so 1000000 = 1
                    USDC; 18 decimals on BNB Chain). Minimum is one whole token.
                    Fees are deducted from this amount.
                  type: string
                tokenSymbol:
                  description: Stable-coin symbol the withdrawal is denominated in.
                  type: string
                  enum:
                    - USDC
                    - USDC.e
                    - USDT
                destinationAddress:
                  pattern: ^(0x[a-fA-F0-9]{40}|[1-9A-HJ-NP-Za-km-z]{32,44})$
                  description: >-
                    Recipient address. EVM destinations: 0x-prefixed 20-byte
                    hex. Solana: base58 (32–44 chars).
                  type: string
                destinationChainId:
                  minimum: 1
                  description: Chain ID where the recipient address should receive funds.
                  type: integer
                max:
                  description: Cap to the deliverable maximum (withdraw-max intent).
                  type: boolean
            example:
              amountRaw: '50000000'
              tokenSymbol: USDC
              destinationAddress: '0x2f9a4c7e1b3d6f8a0c5e9b2d4f7a1c3e6b8d0f52'
              destinationChainId: 8453
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - receiveAmountRaw
                  - feeRaw
                  - relayFeeRaw
                  - networkFeeRaw
                  - pricingStatus
                  - quoteExpiresAt
                  - unviableReason
                  - maxDeliverableRaw
                properties:
                  receiveAmountRaw:
                    description: >-
                      Estimated amount delivered. `null` when unviable. Integer
                      string in the destination token's atomic units (6
                      decimals, so 1000000 = 1 USDC; 18 decimals on BNB Chain).
                    type: string
                    nullable: true
                  feeRaw:
                    description: >-
                      Estimated fee, deducted from the withdrawn amount (amount
                      in minus amount delivered). Integer string in the
                      destination token's atomic units (6 decimals, so 1000000 =
                      1 USDC; 18 decimals on BNB Chain).
                    type: string
                    nullable: true
                  relayFeeRaw:
                    description: >-
                      Bridge provider part of `feeRaw`; currently equal to it.
                      Integer string in the destination token's atomic units (6
                      decimals, so 1000000 = 1 USDC; 18 decimals on BNB Chain).
                    type: string
                    nullable: true
                  networkFeeRaw:
                    description: >-
                      Reserved for a separate network fee; currently always
                      `null`.
                    type: string
                    nullable: true
                  pricingStatus:
                    description: >-
                      `quoted`: the withdrawal can be routed. `unviable`: it
                      cannot; see `unviableReason`.
                    type: string
                    enum:
                      - quoted
                      - unviable
                  quoteExpiresAt:
                    description: >-
                      ISO-8601 time the quote expires (60 seconds after
                      quoting).
                    type: string
                    nullable: true
                  unviableReason:
                    description: >-
                      Readable reason when unviable: insufficient balance, too
                      small to cover fees, no liquidity, or no safe route.
                    type: string
                    nullable: true
                  maxDeliverableRaw:
                    description: >-
                      Set only when the request exceeds the balance: the most
                      that can be delivered. Integer string in the destination
                      token's atomic units (6 decimals, so 1000000 = 1 USDC; 18
                      decimals on BNB Chain).
                    type: string
                    nullable: true
              example:
                receiveAmountRaw: '49930000'
                feeRaw: '70000'
                relayFeeRaw: '50000'
                networkFeeRaw: '20000'
                pricingStatus: quoted
                quoteExpiresAt: '2026-09-29T15:21:00.000Z'
                unviableReason: null
                maxDeliverableRaw: '124880000'
        '400':
          description: '400'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: '401'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '403':
          description: '403'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - appId: []
          bearerAuth: []
components:
  schemas:
    ErrorMessage:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    appId:
      type: apiKey
      in: header
      name: x-app-id
      description: Your application ID. Required for all app-tier and user-tier routes.
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT access token returned by POST /auth/verify. Required for user-tier
        routes.

````