Settlement
Settlement is the moment the contract reads the final FX rate, decides whether the option triggered, and freezes the payout amounts so hedgers can claim and LPs can withdraw.
It's mechanical. Once the oracle network agrees, the contract runs.
When can an event settle?
The contract enforces:
block.timestamp >= expiryDatebefore any oracle submission is accepted.- Each oracle calls
submitRate(eventId, price)once. They can re-submit if their first attempt was outside the tolerance window. - Once
requiredSignerssubmissions are withintoleranceBpsof each other, the contract computes the median and callssettleEventinternally.
Why a median, not an average?
A median is robust against a single bad-data oracle. With N = 5 signers and
requiredSigners = 3, two of the five can be wildly wrong and the settlement
price is still the middle of the honest three. An average would let one
outlier drag the result.
The settlement price determines everything
After settlement:
- For each hedge position, the contract computes
payoutAmountbased on wheresettlementPricelanded in the range. If it's outside the range,payoutAmount = 0. - For LPs, the pool's remaining capital after all hedger payouts is divided pro-rata by shares. Premiums are also distributed pro-rata to LPs by their share at expiry.
Concrete payout examples
Event: USD/GHS, strike = 11.40, cap = 12.00, strikeAbove = true,
initialRate = 11.07. Hedger bought notional = 100 USDC.
| Settlement | Calculation | Payout |
|---|---|---|
| 10.80 | below strike, option worthless | 0 |
| 11.40 | exactly at strike | 0 (technically (11.40 − 11.40)/11.07 × 100 = 0) |
| 11.70 | (11.70 − 11.40)/11.07 × 100 | 2.71 USDC |
| 12.00 | at cap, max payout | 5.42 USDC |
| 12.50 | above cap, capped | 5.42 USDC |
Notice the denominator is initialRate, not spot at settlement. This is
deliberate — it means the payout is determined entirely by the strike, cap,
and initialRate the underwriter picked at creation time. There's no
slippage-style adjustment between purchase and expiry.
What happens if the oracles never settle?
In practice this should never happen — the oracle network is multi-sig and the operators are responsible parties. But for safety:
- The hedger's premium has already been paid into the pool, so LPs are not worse off if settlement is delayed.
- There's an
recoverExpiredPayouts(eventId)admin path that lets the protocol owner sweep unclaimed payout entitlements back to the pool after a long grace period (months). It's a last-resort path; in normal operation hedgers claim promptly.
Where to watch settlement state
GET /v1/hedge/events/:chainId/:id/stats
Returns the live settlement state of an event:
{
"data": {
"id": 1,
"settlementPrice": "11700000",
"triggered": true,
"settledAt": 1775676533,
"lpCount": 4,
"hedgerCount": 12,
"totalLiquidity": "100000000",
"totalExposure": "850000000",
"totalPremiums": "9750000"
}
}
When settlementPrice > 0 and settledAt > 0, the event has settled and the
hedger/LP/creator claim paths are open. See Hedger flow for
the post-settlement claim sequence.