Skip to main content
All trading on Convallax flows through a request-for-quote (RFQ) system. Traders submit signed quote requests, market makers compete to offer the best price, and the winning quote is settled atomically on-chain.

Status Flow

indicative → signed RFQ → quotes collected → winner selected → execute → fill() on-chain

                                              no valid quotes → rejected

Step-by-Step Flow

1

Indicative quote (optional)

The frontend requests a model-based indicative price to display bid/ask spreads before the user commits to a trade.
POST /quote/indicative
{
  "conditionId": "0xa4ddc188...",
  "yesClobTokenId": "51508280778...",
  "strikeBps": 50,
  "optionType": 0,
  "expiryUnix": 1735689600,
  "side": "buy",
  "size": 10
}
Returns fair value, bid, ask, and spread — no signature required.
2

User signs EIP-712 RFQ

When the user submits a trade, the frontend constructs an EIP-712 typed data envelope and asks the user’s wallet to sign it. This signature proves intent but does not move any funds.
{
  "primaryType": "ConvallaxRFQV1",
  "domain": {
    "name": "Convallax RFQ",
    "version": "1",
    "chainId": 80002,
    "verifyingContract": "0x0000000000000000000000000000000000000000"
  },
  "message": {
    "version": 2,
    "rfqId": "abc-123",
    "wallet": "0xTrader...",
    "conditionId": "0xa4ddc188...",
    "optionType": 0,
    "strikeBps": 50,
    "expiryUnix": 1735689600,
    "tradeSide": 0,
    "tradeSizeMicro": 10000000
  }
}
The signed RFQ is submitted to the relay:
POST /rfq
{
  "payload": { ... },
  "signature": "0x...",
  "signatureEncoding": "eip712"
}
The relay verifies the signature matches the declared wallet.
3

Market makers quote

The relay broadcasts the RFQ to all connected market makers via WebSocket and to the internal pricing engine simultaneously.Market makers have a configurable window (default 800ms) to submit quotes. Each quote includes a price, size, and side:
{
  "type": "quote",
  "broadcastId": "broadcast-456",
  "makerId": "mm-1",
  "quote": {
    "rfq_id": "abc-123",
    "side": "sell",
    "price": 0.12,
    "size": 10
  }
}
4

Winner selection

The relay selects the best valid quote:
Taker actionWinner
Buying optionsLowest price wins
Selling optionsHighest price wins
Validation rules:
  • rfq_id must match the original request
  • Side must be opposite to the taker’s side (taker buys → maker sells)
  • Size must be ≥ 50% of the requested size
  • Price must be in (0, 1) and within no-arbitrage bounds
5

Execute — MM signs on-chain order

The taker accepts the winning quote by calling the execute endpoint:
POST /execute
{
  "rfq": { ... },
  "quote": { ... }
}
The relay:
  1. Resolves the seriesId for the option
  2. Ensures the market maker has sufficient option token inventory (auto-minting via ConvallaxCore.mint() if needed)
  3. Ensures ERC-1155 and USDC approvals are set for ConvallaxRFQSettlement
  4. Signs an EIP-712 Order struct with the market maker’s private key
The response contains everything the taker needs to settle on-chain:
{
  "onchain": {
    "order": {
      "maker": "0xMM...",
      "seriesId": "123...",
      "optionAmount": "10000000",
      "premiumAmount": "1200000",
      "makerSelling": true,
      "taker": "0x0000...0000",
      "validUntil": 1717189320,
      "nonce": 42
    },
    "makerSignature": "0x...",
    "settlementAddress": "0xC6Eb814Cc01189e20B2DB2D2a22Ed2DcAC404992",
    "domain": { ... }
  }
}
6

Taker calls fill() on-chain

The taker submits the signed order to ConvallaxRFQSettlement.fill():
  • Taker buying: USDC transfers from taker to maker, option tokens transfer from maker to taker
  • Taker selling: Option tokens transfer from taker to maker, USDC transfers from maker to taker
The swap is atomic — both sides execute in a single transaction or the entire trade reverts. The nonce is consumed to prevent replay.

On-Chain Order (EIP-712)

The Order struct signed by the market maker for on-chain settlement:
struct Order {
    address maker;       // Market maker wallet
    uint256 seriesId;    // Option series (= ERC-1155 token ID)
    uint256 optionAmount;// Option tokens (6 decimals)
    uint256 premiumAmount;// USDC total premium (6 decimals)
    bool    makerSelling;// true = MM sells options to taker
    address taker;       // 0x0 = open to anyone, else restricted
    uint256 validUntil;  // Quote expiry (Unix timestamp)
    uint256 nonce;       // Replay protection
}
EIP-712 domain:
FieldValue
nameConvallaxRFQSettlement
version1
chainId80002 (Polygon Amoy)
verifyingContract0xC6Eb814Cc01189e20B2DB2D2a22Ed2DcAC404992

Three Signature Domains

Convallax uses three distinct EIP-712 domains for different purposes:
DomainPurposeWho signs
Convallax RFQOff-chain trade intentTaker wallet
ConvallaxRFQSettlementOn-chain fill orderMarket maker
ConvallaxCoreSettlement attestationResolution signer

Premium Calculation

premiumAmount = price × size × 1,000,000   (USDC raw, 6 decimals)
optionAmount  = size × 1,000,000           (option raw, 6 decimals)
For example, buying 10 options at price $0.12:
  • premiumAmount = 0.12 × 10 × 1,000,000 = 1,200,000 raw (1.20 USDC)
  • optionAmount = 10 × 1,000,000 = 10,000,000 raw