ethers). It’s the same flow the website runs when you click Trade — just driven by you directly.
The mental model: trading is two phases.
- Price discovery (off-chain, HTTP). You ask our backend for a price, market makers compete, and you accept the best quote. No wallet signing, no gas.
- Settlement (on-chain, one transaction). You sign a single
fill()transaction with your own wallet. This atomically pays the premium, locks any collateral, and mints your option tokens.
What You Need
A funded wallet on Polygon Amoy
Any EVM wallet. You need test USDC for the premium (and collateral, if you sell) plus a little POL for gas. Get USDC from the faucet in the dashboard or the testnet guide.
No API key
Trading endpoints are public — no API key required. (API keys are only for market makers.) Your on-chain
fill() transaction is your authorization.One USDC approval
Before
fill(), you grant a USDC allowance to the contract the backend tells you to:- Buying (long): approve the Settlement contract for the premium.
- Selling (short): approve the Core contract for the collateral.
spender and amount in a takerApproval object — you don’t have to compute it.The Four Steps
1. Discover what you can trade
Find the markets and series that exist on-chain. A trade can only settle against a registered series.conditionId and yesClobTokenId, plus a strikeBps, expiry, and optionType. See List Markets and List Series.
2. Request a live quote
Open a quote request describing exactly what you want. The backend broadcasts it to all connected market makers.option block fully identifies the contract (type, strike, expiry); makers price it using their own data and models.
Sizing. On a buy you submit a USDC budget (
trade.budgetUsd). Makers quote a per-option price, and at commit you receive floor(budgetUsd / price) whole options (capped by the winning maker’s quoted size), paying contracts × price. On a sell you submit a contract count instead: "trade": { "side": "sell", "size": 100 }.requestId:
No wallet signature is needed to open a quote request — your authorization happens later, at the on-chain
fill(). See Create Quote Request.3. Watch quotes, then accept the best
Quotes arrive within a second or two. Read the current best price, then commit when you’re happy. The recommended way to watch is the SSE stream (prices push to you live); polling also works.onchain object:
4. Settle on-chain (fill())
Two wallet actions — approve USDC, then call fill() with the order and the maker’s signature. This single transaction atomically pulls the premium, locks the maker’s collateral, and mints your option tokens.
seriesId).
The Whole Flow
After the Trade
- Check your position: your option tokens are an ERC-1155 balance on
ConvallaxOptionToken, keyed byseriesId. See Verify Your Positions. - At expiry: once the series is settled, holders claim their payout with
claimHolderPayout. See the Settlement guide for how resolution works.
Why a Signature, Not a Custodial Order Book?
Convallax is non-custodial. The maker signs “I agree to these exact terms,” and yourfill() redeems that signature on-chain. Neither side can alter the terms, and the backend never touches anyone’s funds or keys — it’s purely a matchmaker for price discovery.