Skip to main content
Execute an option trade in a single atomic transaction on the ConvallaxRFQSettlement contract. The taker calls this function with the signed Order and makerSignature received from POST /quote-requests/:id/commit. fill() is atomic mint-on-fill: it calls ConvallaxCore.mintFor(...) to pull collateral from the writer, mint fresh option tokens to the holder, and move the premium — all or nothing. Option tokens are minted on demand; there is no pre-minted inventory and no token transfer between parties. Contract: ConvallaxRFQSettlement0x3E583BC44157c91F8c534372A3e91c371841107A

Function Signature

Parameters

Order
required
The EIP-712 Order struct signed by the market maker.
bytes
required
EIP-712 signature from the maker over the Order struct.

Behavior

Internally, fill() calls ConvallaxCore.mintFor(seriesId, optionAmount, writer, holder), which pulls collateral from the writer, mints fresh option tokens to the holder, and records the writer for writer claims at settlement. The settlement contract moves the premium separately. The fill is atomic — collateral, premium, and minting all execute in a single transaction or the entire call reverts. Collateral is locked only when the trade executes. The nonce is consumed to prevent replay.

Prerequisites

Settlement requires two USDC approvals — there are no ERC-1155 / setApprovalForAll approvals. Each party approves only the contract relevant to its role:
  1. Collateral approval — The party posting collateral (the writer) must usdc.approve(coreAddress, collateral) so ConvallaxCore can pull it.
  2. Premium approval — The party paying premium must usdc.approve(settlementAddress, premium) so ConvallaxRFQSettlement can pull it.
  3. Sufficient balances — Both parties must hold enough USDC for their respective obligations.
For a standard long fill (makerSelling = true): the maker approves Core (collateral) and the taker approves Settlement (premium). For a short fill (makerSelling = false): the taker approves Core (collateral) and the maker approves Settlement (premium).
A market maker that quotes both directions should approve both Core (collateral) and Settlement (premium) for USDC.
The collateral amount equals the writer’s maximum loss:
(6-decimal raw USDC units, integer division.)

Example

Nonce Cancellation

Makers can pre-emptively cancel a nonce to prevent a pending order from being filled:
This marks the nonce as used, so any order signed with that nonce will revert with NonceAlreadyUsed if someone tries to fill it.

Reverts