Skip to content
PlutusShield
Live on Cardano Preview testnet

Settlement & claims

Parametric cover pays when a quorum of authenticated oracle feeds attests the trigger. There is no claims form and no committee. Assessed claims go through Midnight.

← Back to site
DocsSettlement & claims

Parametric settlement#

A depeg policy settles in one Cardano transaction. The holder references oracle feed UTxOs, burns their policy tokens, and takes exactly coverage from the policy's own currency tranche, paid in the policy's asset (ADA or USDC). The validator checks everything. Nobody approves the claim.

Trigger (types.ak) and the default depeg trigger (sdk depegTrigger)
Trigger { covered_asset, threshold_bps, window_ms }

depeg:  threshold_bps = 9_500        -- price below 0.95 of peg
        window_ms     = 86_400_000   -- over a window of at least 24h

Try it in the claim checker. It runs the SDK's exact mirror of these rules (settlementCheck) against example prices, so you can see which window pays, when the claim window closes, and what happens when feeds go offline.

On Preview, live policies carry their action in My policies. Once the quorum attests a depeg inside a policy's cover period, the wallet holding its claim token gets a Claim button that signs the Settle directly; the coverage lands in that wallet in the same transaction. After expiry plus the grace period, any wallet can Release an unclaimed policy (Expire), and its deposit goes back to the buyer. Both use one shared builder (lib/tx/claim.ts) that the emulator test run and pnpm web-claim also submit.

Authenticating feeds#

Oracle data is read from reference inputs, so feeds aren't spent and can serve many claims. A reference input counts as a feed only if:

  • It holds exactly one token under params.oracle.policy_id, with quantity 1.
  • That token's name is on the allowlist params.oracle.feeds.
  • Its inline datum decodes as OracleDatum. Anything else is ignored, never trusted.
OracleDatum (types.ak)
OracleDatum {
  covered_asset: ByteArray   -- e.g. "USDM"
  price_bps:     Int         -- time-weighted price over the window vs peg, 10_000 = 1.00
  window_start:  Int         -- POSIX ms
  window_end:    Int
}

Each feed name is counted at most once, so the same feed referenced twice can't make a quorum. Settlement needs quorum ≥ 1 and at least quorum distinct agreeing feeds. The validator tests use a 2-of-3 allowlist, and the live Preview deployment uses the same values: three feeds (feed-a, feed-b, feed-c) with a quorum of 2. Mainnet values haven't been chosen.

What counts as a trigger#

A feed's datum agrees with the policy when all of these hold:

attests (oracle.ak)
datum.covered_asset == trigger.covered_asset
datum.price_bps      <  trigger.threshold_bps
datum.window_end − datum.window_start ≥ trigger.window_ms
datum.window_start   ≥ policy.start
datum.window_end     ≤ policy.expiry

In plain terms, the feed reports a time-weighted price below the threshold over a window at least as long as required, and that window lies entirely inside the cover period. A depeg that began before the policy started, or ended after it expired, doesn't count. Each feed attests its own window. The validator does not require the feeds' windows to be identical.

The same feeds gate sales#

A parametric pool is only fair if nobody can buy cover after the event has started. Every Buy runs a circuit-breaker against the same allowlisted feeds, with a waiting period on top:

attests_peg (oracle.ak) and validate_buy (cover.ak)
datum.covered_asset == trigger.covered_asset
datum.price_bps      ≥ trigger.threshold_bps            -- healthy peg
datum.window_end     ≥ tx_upper_bound − max_price_age_ms  -- fresh
-- for EVERY allowlisted feed (not a quorum), and
policy.start         ≥ tx_upper_bound + waiting_period_ms

Settlement needs a quorum, but sales need every feed. The buyer chooses which feed UTxOs to attach, so with a 2-of-3 rule they could leave out the one feed that already shows a depeg. If any feed is depegged, stale, or missing, no cover can be sold. A depeg that begins during the waiting period is never covered, because a trigger window must start at or after policy.start. Defaults: 24h waiting period, readings at most 2h old. Preview uses 60 min and 2h so test drills stay quick.

Settle transaction rules#

  1. 01

    Burn both policy tokens

    The transaction burns exactly the reference token and the user token for this policy. Burning the user token means the claimant must hold it. On Cardano, the claim right is a bearer asset.
  2. 02

    Spend the policy UTxO

    Exactly one input carries the reference token and its PolicyDatum. That UTxO is spendable only because its reference token is burned.
  3. 03

    Claim before the grace deadline

    The validity upper bound must be ≤ expiry + claim_grace_ms. The grace period lets a holder claim for a trigger window that ended on or just before expiry. The tests use 3 days.
  4. 04

    Oracle quorum attests

    The quorum and trigger rules above hold against the transaction's reference inputs.
  5. 05

    Pay exactly coverage, once

    In the policy's tranche, capital_out = capital − coverage and active_cover drops by the same amount. Every other tranche is untouched. Once the reference token is burned, the policy no longer exists, so it can't be claimed twice.

Attack cases tested#

The Aiken test suite (131 checks) includes these settlement and sale cases:

Settlement and sale test coverage
CaseExpected
Quorum of 2 allowlisted feeds, depeg to 0.91 for 26hPays
Claim within grace after expiryPays
Claim after graceRejected
Depeg window starts after expiry, or before startRejected
Look-alike feed token from another policyRejected
Feed name not on the allowlistRejected
Single feed below quorum, or the same feed twiceRejected
Price 0.96, above the 0.95 thresholdRejected
Below peg for 12h of the required 24hRejected
Pool pays out more than coverageRejected
Burn only the user token to keep the policy aliveRejected
Replay a claim after the policy UTxO is goneRejected
USDC policy settles from the USDC tranchePays
USDC policy paid out of the ADA trancheRejected
Buy while feeds show 0.91, or 1 of 3 feeds depeggedSale refused
Buy attaching only the 2 healthy feeds, omitting the depegged oneSale refused
Buy with peg readings older than the max age, or none at allSale refused
Buy landing inside the waiting periodSale refused
Expire that keeps the buyer's deposit, or refunds 1 lovelace shortRejected

Assessed claims (Midnight)#

Exploit cover can't be fully parametric, so its claims go through the private registry on Midnight. Only a commitment to the evidence bundle (exploit writeups, transaction dumps) goes on the ledger.

Midnight claim circuits
CircuitCallerRule
fileClaim(id, evidenceCommitment)HolderPolicy must be ACTIVE. Evidence commitment non-zero. → CLAIM_PENDING
voteClaim(id, true)Committee memberOne vote per member per claim round. 2-of-3 approvals → PAID. claimsPaid +1, activePolicies −1
voteClaim(id, false)Committee member2-of-3 rejections → CLAIM_PENDING returns to ACTIVE. Evidence commitment cleared

While a claim is pending, the policy can't prove cover, be rotated to a new holder, or be expired. On Midnight the decision sits with a committee too: the v2 registry's three assessor role commitments, fixed at deployment, each voting once per claim round (the v1 registry's single assessor key is kept as history). The Cardano payout below needs its own 2-of-3 assessor committee on top of that. Holder authorization works as described in Privacy.

Claimants build the commitment with the evidence vault, which encrypts the bundle in the browser and computes the contract's evidenceCommitment. The committee member opens the bundle with the claimant's key file and checks it against the record before voting with voteClaim. Details in the vault's trust model.

This runs on Midnight Preprod today. The v1 drill filed demo evidence on two mirrored test policies; the assessor verified each bundle against its on-ledger commitment, then approved one (PAID) and rejected the other (back to ACTIVE, commitment cleared). On the v2 committee registry, the first live decision was a split vote — seat 0 approve, seat 1 reject (still CLAIM_PENDING under 2-of-3), seat 2 approve → PAID. The first claim a holder filed themselves, from a passphrase-encrypted claim kit (policy 496dced8…, 25 tADA), was approved by seats 0 and 2 and paid on Cardano Preview by a 2-of-3 committee-signed Settle; the operator relay never held that policy key. Tx hashes are on the evidence vault page and in the public deployment record.

Payout on Cardano. Exploit cover has its own pool and validator, validators/exploit_cover.ak, parameterised with the same CoverParams plus an assessor Committee: a list of assessor key hashes and a threshold (2-of-3 on Preview). InitPool refuses a malformed committee: empty, a hash that isn't 28 bytes, a duplicate key, or a threshold outside 1..=size. Its Settle has no oracle path: it requires signatures from at least threshold distinct committee members, a validity range inside [policy start, expiry + grace], both policy tokens burned, exactly the coverage paid from the policy's tranche, and active cover released. Buy keeps the pricing, capacity, and waiting period, without the peg circuit-breaker (there is no peg). The depeg validator is untouched, so the live depeg pool keeps its script hash.

Exploit Settle (exploit_cover.ak, 2-of-3 committee)
AttemptResult
Any 2 of the 3 assessors sign, inside the claim window, pays exactly the coveragePaid
2 assessors plus extra non-committee signers (holder, others)Paid: outsiders are ignored
Only 1 of the 3 assessors signs, alone or padded with outsidersRejected
The same assessor listed twiceRejected: counted once
Signed only by keys outside the committeeRejected
Pays one lovelace more or less than the coverageRejected
After expiry + grace, or before cover startsRejected
Keeps active cover, or keeps the user tokenRejected