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

# Commit to Quote

> Commit to the best quote on an open quote request. The relay selects the winner, signs an EIP-712 Order, and returns everything needed for on-chain fill().

Commit to the best available quote on an open quote request. The relay selects the best valid quote, resolves the option `seriesId`, builds the exact EIP-712 `Order`, and emits a [`quote:accepted`](/api-reference/market-maker/websocket) message to the **winning market maker** over the post-trade WebSocket, starting a confirmation deadline (`MAKER_CONFIRMATION_MS`, default 10s).

Market makers are **independent** — the backend does not post collateral, set approvals, or sign on their behalf. The winning maker signs the order with its own wallet key and submits the signature over REST ([`POST /v1/mm/quotes/{quoteId}/confirm`](/api-reference/market-maker/confirm-quote)), which the backend verifies recovers to `order.maker`.

The successful response contains everything the taker needs to call [`fill()`](/api-reference/contracts/fill) on `ConvallaxRFQSettlement` for atomic mint-on-fill settlement, including the single USDC approval the taker must make first (`onchain.takerApproval`).

<Info>
  **Confirmation handshake.** This request blocks until a maker confirms. If the winning maker misses its deadline, the backend falls back to the next-best maker's quote. If no maker confirms in time, the request stays open and the call returns HTTP `503` so the taker can retry.
</Info>

<Warning>
  If the on-chain environment is not configured, the relay returns a simulated execution response (`mode: "simulated"`) with no `onchain` block.
</Warning>

<Note>
  **Before calling `fill()`**, the taker makes exactly one USDC approval as described by `onchain.takerApproval`: approve `takerApproval.spender` for `takerApproval.amount`. For a long fill this is the **settlement** contract (premium); for a short fill it is the **core** contract (collateral). The maker has already pre-approved its own side.
</Note>


## OpenAPI

````yaml api-reference/openapi.json POST /quote-requests/{id}/commit
openapi: 3.1.0
info:
  title: Convallax RFQ API
  version: 3.0.0
  description: >-
    REST surface for the Convallax options protocol — a non-custodial
    request-for-quote marketplace for European calls and puts on Polymarket YES
    outcomes, settled on Polygon.


    **Wire format**: JSON. Successful responses include `"success": true`;
    failures return `{ "success": false, "error": "..." }`.


    **Authentication**: Takers (traders) need no API key — authorization happens
    on-chain at `fill()`. Market makers authenticate with a per-MM API key sent
    as `X-API-Key` (or `?apiKey=`).


    **Streaming**: Quote-request and live-pricing streams use Server-Sent Events
    and the post-trade channel uses WebSocket; those are documented in the
    guides and are not part of this request/response reference.
servers:
  - url: https://api.convallax.com
    description: Production
security: []
tags:
  - name: Series
    description: Browse registered option series available for trading.
  - name: Trading
    description: Open quote requests, read live quotes, and commit to the best price.
  - name: Market Maker
    description: >-
      Submit quotes and confirmation signatures. Authenticated with a per-MM API
      key.
  - name: Settlement
    description: Compute TWAP resolution prices and sign settlement attestations.
  - name: Testnet
    description: Polygon Amoy testnet USDC faucet.
  - name: User
    description: >-
      Account profile and self-serve API keys. Authenticated with a Privy access
      token.
paths:
  /quote-requests/{id}/commit:
    post:
      tags:
        - Trading
      summary: Commit to Quote
      description: >-
        Commit to the best valid quote. The relay selects the winner, builds the
        EIP-712 `Order`, asks the winning maker to sign it (over the post-trade
        WebSocket, confirmed via REST), and returns the signed order plus the
        single USDC approval the taker must make before calling `fill()`. Blocks
        until a maker confirms; falls back to the next-best maker on a missed
        deadline. Returns a simulated execution when the on-chain environment is
        not configured.
      operationId: commitQuote
      parameters:
        - $ref: '#/components/parameters/RequestId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommitInput'
      responses:
        '200':
          description: Order signed by the winning maker (or simulated execution)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommitResponse'
        '400':
          $ref: '#/components/responses/Error'
        '404':
          $ref: '#/components/responses/Error'
        '409':
          $ref: '#/components/responses/Error'
        '502':
          $ref: '#/components/responses/Error'
        '503':
          description: No market maker confirmed in time — the request stays open; retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    RequestId:
      name: id
      in: path
      required: true
      description: The `requestId` returned by Create Quote Request.
      schema:
        type: string
        example: req-789
  schemas:
    CommitInput:
      type: object
      required:
        - wallet
      properties:
        wallet:
          type: string
          description: >-
            Taker wallet (checksummed). Set as `taker` in the order — only this
            wallet can call `fill()`.
          example: 0xTrader0000000000000000000000000000000000
    CommitResponse:
      type: object
      properties:
        success:
          type: boolean
          const: true
        message:
          type: string
          example: Order signed by maker — call fill() on-chain
        mode:
          type: string
          enum:
            - onchain
            - simulated
          example: onchain
        quote:
          $ref: '#/components/schemas/Quote'
        execution:
          $ref: '#/components/schemas/Execution'
        onchain:
          $ref: '#/components/schemas/OnchainBlock'
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          type: string
          description: Human-readable error message.
          example: Quote request not found or expired
    Quote:
      type: object
      description: A market maker quote as exposed to takers.
      properties:
        maker_id:
          type: string
          description: Identifier of the market maker.
          example: mm-alpha
        quote_id:
          type: string
          description: Server-generated quote ID.
          example: 8f3c2b1a-1d2e-4c3b-9a8f-6e5d4c3b2a1f
        maker:
          type: string
          description: Maker wallet address (becomes `Order.maker`).
          example: '0x1234000000000000000000000000000000abcd'
        side:
          type: string
          enum:
            - buy
            - sell
          example: buy
        price:
          type: number
          description: Price per option in (0, 1).
          example: 0.12
        size:
          type: number
          example: 10
        expires_in_ms:
          type: number
          example: 5000
    Execution:
      type: object
      properties:
        execution_id:
          type: string
          example: e1f2a3b4-5c6d-7e8f-9a0b-1c2d3e4f5a6b
        request_id:
          type: string
          example: req-789
        quote_id:
          type: string
          nullable: true
          example: 8f3c2b1a-1d2e-4c3b-9a8f-6e5d4c3b2a1f
        maker_id:
          type: string
          nullable: true
          example: mm-alpha
        executed_at:
          type: string
          format: date-time
          example: '2026-06-15T12:00:01.234Z'
    OnchainBlock:
      type: object
      description: >-
        Everything needed for on-chain fill(). Present only when mode is
        "onchain".
      properties:
        settlementAddress:
          type: string
          example: '0x3E583BC44157c91F8c534372A3e91c371841107A'
        coreAddress:
          type: string
          example: '0x76c41a03e0993F0261bB3B1949320cA693f76faE'
        order:
          $ref: '#/components/schemas/Order'
        makerSignature:
          type: string
          description: EIP-712 signature by the maker (recovers to order.maker).
          example: 0xabcdef...
        domain:
          $ref: '#/components/schemas/Eip712Domain'
        chainId:
          type: integer
          example: 80002
        takerApproval:
          $ref: '#/components/schemas/TakerApproval'
    Order:
      type: object
      description: EIP-712 Order struct.
      properties:
        maker:
          type: string
          example: '0x1234000000000000000000000000000000abcd'
        seriesId:
          type: string
          description: Option series ID (= ERC-1155 token ID), decimal string.
          example: '98765432109876543210'
        optionAmount:
          type: string
          description: Option tokens, raw units (6 decimals), decimal string.
          example: '10000000'
        premiumAmount:
          type: string
          description: USDC premium, raw units (6 decimals), decimal string.
          example: '1200000'
        makerSelling:
          type: boolean
          description: True = maker sells options to taker; false = maker buys.
          example: true
        taker:
          type: string
          example: 0xTrader0000000000000000000000000000000000
        validUntil:
          type: integer
          description: Order expiry (Unix seconds).
          example: 1717189320
        nonce:
          type: integer
          description: Single-use replay-protection nonce.
          example: 1717189200042
    Eip712Domain:
      type: object
      properties:
        name:
          type: string
          example: ConvallaxRFQSettlement
        version:
          type: string
          example: '1'
        chainId:
          type: integer
          example: 80002
        verifyingContract:
          type: string
          example: '0x3E583BC44157c91F8c534372A3e91c371841107A'
    TakerApproval:
      type: object
      description: The single USDC approval the taker must make before calling fill().
      properties:
        spender:
          type: string
          description: >-
            Settlement address (premium, long) or Core address (collateral,
            short).
          example: '0x3E583BC44157c91F8c534372A3e91c371841107A'
        amount:
          type: string
          description: USDC amount to approve, raw units (6 decimals).
          example: '1200000'
        reason:
          type: string
          enum:
            - premium
            - collateral
          example: premium
  responses:
    Error:
      description: Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'

````