> ## 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.

# Place limit order

> Places a venue-specific limit order. Managed orders reserve funds or shares. Self-custody buys can fund across supported chains using the existing client-signature flow; poll quoteId until the order is open or terminal. Fills are reconciled asynchronously.



## OpenAPI

````yaml /openapi/openapi.json post /execution/limit-orders
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/limit-orders:
    post:
      tags:
        - Trading
      summary: Place limit order
      description: >-
        Places a venue-specific limit order. Managed orders reserve funds or
        shares. Self-custody buys can fund across supported chains using the
        existing client-signature flow; poll quoteId until the order is open or
        terminal. Fills are reconciled asynchronously.
      operationId: placeLimitOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              additionalProperties: false
              type: object
              required:
                - venue
                - venueMarketOutcomeId
                - side
                - limitPriceRaw
                - sizeRaw
                - timeInForce
              properties:
                venue:
                  allOf:
                    - $ref: '#/components/schemas/Venue'
                  description: Venue to place the limit order on.
                venueMarketOutcomeId:
                  description: Outcome to trade, on that venue.
                  type: string
                side:
                  description: '`buy` or `sell`.'
                  type: string
                  enum:
                    - buy
                    - sell
                limitPriceRaw:
                  pattern: ^[1-9][0-9]*$
                  description: >-
                    Limit price. Price per share scaled by 1e6, as an integer
                    string (530000 = 0.53).
                  type: string
                sizeRaw:
                  pattern: ^[1-9][0-9]*$
                  description: >-
                    Order size. Shares in 6-decimal atomic units, as an integer
                    string (1000000 = 1 share).
                  type: string
                timeInForce:
                  description: >-
                    `GTC` good till cancelled; `GTD` good till `expiresAt`;
                    `FOK` fill in full now or cancel; `FAK` / `IOC` fill what
                    you can now, cancel the rest; `ALO` add liquidity only
                    (Hyperliquid's post-only). Venues support different subsets.
                  type: string
                  enum:
                    - GTC
                    - GTD
                    - FOK
                    - FAK
                    - IOC
                    - ALO
                postOnly:
                  description: Only rest on the book; reject instead of taking liquidity.
                  type: boolean
                expiresAt:
                  format: date-time
                  description: Expiry time, for `GTD` orders.
                  type: string
                clientOrderId:
                  minLength: 1
                  maxLength: 128
                  description: >-
                    Your own id for the order, returned on GET
                    /execution/orders.
                  type: string
                approveMode:
                  description: >-
                    Self-custody, cross-chain fills only: how the token approval
                    a bridge needs is made. `sponsored` (default): the wallet
                    does not send the approve itself; it signs a one-time
                    EIP-7702 authorization per chain, over a raw digest (not
                    EIP-191 or EIP-712), which many wallets cannot produce.
                    `user_broadcast`: the user sends the approve transaction
                    from their wallet and pays its gas, on every bridge. Pick
                    based on what the wallet software supports. Neither mode
                    makes bridging free: quote with `deepEstimate` and read
                    `feeBreakdown.bridgeFees` and `feeBreakdown.setupCosts`.
                  type: string
                  enum:
                    - sponsored
                    - user_broadcast
                fundingAddresses:
                  description: >-
                    Self-custody: other linked wallets this fill may spend from
                    (`signingAddress` is always included). Order does not
                    matter: per token, the wallet with the largest balance is
                    used first. Omit to fund from the signing wallet only.
                  type: array
                  items:
                    minLength: 42
                    maxLength: 42
                    type: string
                signingAddress:
                  minLength: 42
                  maxLength: 42
                  description: >-
                    Linked account EOA for self-custody; omit for managed
                    custody. Polymarket supports GTC/GTD buys and sells, at or
                    above the market's minimum size, and requires a previously
                    set-up deposit wallet, which makes every order; a legacy
                    Polymarket Safe can top up a buy's pUSD or a sell's shares
                    by moving them into that deposit wallet first (one extra
                    Safe signature), and legacy proxy wallets are not supported.
                    Hyperliquid supports GTC/ALO buys and sells, whole contracts
                    and a 0.00001 price tick, without expiresAt. Hyperliquid
                    order actions are signed by the EOA or its approved
                    client-held agg agent; AGG never holds an agent key.
                    Placement returns quoteId: poll execution status and answer
                    pendingSignatures using each request's signerAddress.
                    Placement is pending until signatures and venue submission
                    finish. Self-custody buys do not reserve managed balances.
                    Funding uses supported balances across chains and the pinned
                    deposit wallet. On a buy, fundingAddresses may add other
                    wallets linked to the same account; their balances fund the
                    order only by bridging in, never on the venue's own chain.
                    Polymarket CLOB credentials are derived in memory per order
                    or signed cancel and never stored; cancelling requires a
                    fresh cancelSignature. Hyperliquid cancellation requires a
                    fresh signed cancel action. An account referenced by an
                    order cannot be disconnected, including after that order
                    becomes terminal.
                  type: string
            example:
              venue: polymarket
              venueMarketOutcomeId: cmf3q8z2m00a4mw0lr5t1k7yc
              side: buy
              limitPriceRaw: '450000'
              sizeRaw: '20000000'
              timeInForce: GTC
              clientOrderId: limit-7f3a2c
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                required:
                  - orderId
                  - status
                  - venue
                  - limitPriceRaw
                  - limitSizeRaw
                  - filledSizeRaw
                  - remainingSizeRaw
                properties:
                  orderId:
                    description: Order id.
                    type: string
                  quoteId:
                    description: >-
                      Execution quote ID for polling GET /execution/status and
                      submitting the user's signatures to POST
                      /execution/fill/:quoteId/signatures. Present for funded
                      buy orders.
                    type: string
                  status:
                    $ref: '#/components/schemas/OrderStatus'
                  venue:
                    allOf:
                      - $ref: '#/components/schemas/Venue'
                    description: Venue the order was placed on.
                  venueOrderId:
                    description: The venue's own order id, once known.
                    type: string
                    nullable: true
                  reservedCostRaw:
                    description: >-
                      Cash held for a managed buy. `null` for sells and
                      self-custody. USD in 6-decimal atomic units, as an integer
                      string (1000000 = $1.00).
                    type: string
                    nullable: true
                  limitPriceRaw:
                    description: >-
                      Limit price. Price per share scaled by 1e6, as an integer
                      string (530000 = 0.53).
                    type: string
                  limitSizeRaw:
                    description: >-
                      Order size. Shares in 6-decimal atomic units, as an
                      integer string (1000000 = 1 share).
                    type: string
                  filledSizeRaw:
                    description: >-
                      Shares filled so far. Shares in 6-decimal atomic units, as
                      an integer string (1000000 = 1 share).
                    type: string
                  remainingSizeRaw:
                    description: >-
                      Shares not yet filled. Shares in 6-decimal atomic units,
                      as an integer string (1000000 = 1 share).
                    type: string
              example:
                orderId: cmf3r1a2b00c4mw0lq8y7e3uj
                status: pending
                venue: polymarket
                venueOrderId: null
                reservedCostRaw: '9000000'
                limitPriceRaw: '450000'
                limitSizeRaw: '20000000'
                filledSizeRaw: '0'
                remainingSizeRaw: '20000000'
        '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'
        '409':
          description: '409'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
      security:
        - appId: []
          bearerAuth: []
components:
  schemas:
    Venue:
      type: string
      enum:
        - kalshi
        - polymarket
        - limitless
        - opinion
        - predict
        - pred
        - tiprun
        - probable
        - myriad
        - hyperliquid
        - novig
        - prophetx
        - betdex
    OrderStatus:
      description: >-
        Order lifecycle status. In flight: `pending` (accepted, funds being
        checked), `signing`, `pending_bridge` (funds moving to the venue's
        chain), `submitting`, `submitted` (sent to the venue, awaiting
        confirmation). Resting limit orders: `open`, `partially_filled_open`,
        `cancel_pending` (cancel requested, awaiting the venue). Terminal:
        `filled`, `partial_fill` (the unfilled rest will not fill; see
        `partialFillReason`), `failed`, `expired`, `cancelled`.
      type: string
      enum:
        - pending
        - signing
        - pending_bridge
        - submitting
        - submitted
        - open
        - partially_filled_open
        - cancel_pending
        - filled
        - partial_fill
        - failed
        - expired
        - cancelled
    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.

````