One validator, two roles#
All Cardano logic lives in one parameterised Plutus V3 multi-validator, cover(params). Its script hash is both the minting policy of every PlutusShield token and the payment credential that locks the pool and every policy reference UTxO. There is no admin key: the accepted currencies, product terms, oracle allowlist, quorum and claim grace period are fixed in CoverParams when the script is deployed.
| Token | Asset name | Lives at | Meaning |
|---|---|---|---|
| Pool NFT | pool | Script address | Marks the one genuine pool UTxO. Minted once by consuming params.seed. |
| LP share | lp ‖ tranche byte | LP wallets | Fungible, pro-rata claim on one currency tranche (6c7000 = ADA, 6c7001 = USDC). |
| Policy reference token | 000643b0 ‖ id[0..28] | Script address, with PolicyDatum | Live policy state (CIP-67 label 100). |
| Policy user token | 000de140 ‖ id[0..28] | Buyer's wallet | Bearer right to claim (CIP-67 label 222). Burning it is how you claim. |
Every LP or policy action spends the pool UTxO, and the pool spend checks the transaction's exact mint and burn, the capital change in the one tranche it touches, that every other tranche is untouched, and the next pool datum. The mint handler's ViaPool redeemer only requires that the pool UTxO is an input. A policy UTxO can be spent only if its reference token is burned in the same transaction, which only the pool's Settle and Expire paths allow.
Lifecycle#
- 01
InitPoolCardano
Mints the pool NFT exactly once by spendingparams.seed. The pool starts with one empty tranche per accepted currency, and the params are sanity-checked. For example, there must be 1 to 256 distinct assets, quorum must be between 1 and the number of feeds, and the single-policy cap must not exceed the utilization cap. - 02
Deposit / WithdrawCardano
Underwriters add capital to one currency tranche for that tranche's LP shares, and redeem shares for capital in the same asset, subject to the capital lock. See Underwriting pool. - 03
BuyCardano
The buyer picks a currency (ADA or USDC) and pays the premium in it, into that tranche. The transaction mints one reference token, locked at the script with aPolicyDatum, and one user token for the buyer. That tranche'sactive_covergrows by the coverage amount. The buy must reference a fresh healthy-peg reading from every oracle feed, and cover starts only after the waiting period. The buyer's browser also makes a private Midnight policy key and writes only its commitment into the datum. See the purchase rules. - 04
registerPolicyMidnight
After the Cardano mint confirms, the issuer mirrors the policy into the private registry, keyed by the same 32-byte policy id. The record holds a holder commitment and a coverage commitment, and the circuit refuses any pair that doesn't open the datum's commitment. See Privacy. - 05
Settle (claim)Cardano
If a quorum of allowlisted oracle feeds attests the trigger inside the cover period, the holder burns both policy tokens, and the policy's tranche pays exactlycoveragein the policy's asset. The claim must land beforeexpiry + claim_grace_ms. See Settlement. - 06
ExpireCardano
Once the validity range starts afterexpiry + claim_grace_ms, anyone can burn the reference token to retire the policy. Capital stays in the pool, and the tranche'sactive_coverdrops by the coverage, which frees capacity. The reference UTxO's min-ada deposit must go back to the buyer'srefund_toaddress, whoever submits. The user token can be burned in the same transaction or later withBurnUserTokens.
MintAction = InitPool | ViaPool | BurnUserTokens
PoolAction = Deposit { tranche } | Withdraw { tranche, shares } | Buy | Settle | ExpireWhat a purchase must satisfy#
validate_buy accepts a Buy only if all of these hold. Product terms are fixed by the deployment. The buyer can't choose them.
- Exactly one reference token and one user token are minted for the derived policy id. The reference output sits at the script and holds only that token plus ada.
policy_idequalsblake2b_256(cbor(pool OutputReference spent)). Each pool UTxO is spent once, so ids are unique.product_idandtriggerequal the product's, so a buyer can't pick a looser threshold.assetis one of the accepted currencies. It selects the tranche. Premium, capacity, the premium floor (with that asset'smin_premium), and the active-cover update all use that tranche only. Every other tranche's capital is unchanged.midnight_commitmentis exactly 32 bytes.coverage > 0. The term is a whole number of days betweenmin_daysandmax_days.- Waiting period. The transaction's validity upper bound plus
sale_guard.waiting_period_msmust be≤ start. That rules out backdating, and a depeg that begins during the wait is never covered, because trigger windows must start at or afterstart. - Circuit-breaker. Every allowlisted oracle feed, passed as a reference input, reports the covered asset at or above the trigger threshold, with a
window_endno older thansale_guard.max_price_age_ms. All feeds, not a quorum: the buyer picks the reference inputs, so a quorum rule would let them leave out the feed that already shows a depeg. If any feed is depegged, stale, or missing, nothing can be sold. - The capacity caps hold against the tranche's pre-purchase capital, and the premium paid (the tranche's capital increase) is at least the integer floor. See Pricing.
- The tranche's next ledger is exactly
active_cover + coverage, with shares unchanged.
The policy datum#
PolicyDatum {
policy_id: ByteArray -- 32 bytes, blake2b_256(cbor(pool OutputReference))
product_id: ByteArray -- "depeg"
asset: AssetClass -- currency of coverage, premium and payout; picks the tranche
coverage: Int -- base units of that asset
premium: Int
start, expiry: Int -- POSIX ms, expiry = start + days * 86_400_000
trigger: Trigger -- { covered_asset, threshold_bps, window_ms }
midnight_commitment: ByteArray -- 32-byte Midnight coverage commitment
refund_to: Address -- gets the reference UTxO's min-ada back on Expire
}packages/sdk builds this datum (buildPolicyDatum), derives ids and token names, and encodes Plutus Data byte-for-byte as the validator does. Golden vectors are checked on both sides.
Products#
The quote engine prices three product lines. One deployment of cover serves one product with one trigger, and can accept several currencies (ADA and USDC by default). The cover products catalog shows each line's status, premium currencies, claim model and deployed parameters.
| Product | Settlement | Status |
|---|---|---|
| Stablecoin depeg | Parametric. Oracle TWAP below 0.95 of peg for 24h (threshold_bps 9_500, window 86_400_000 ms) | Implemented in the Cardano validator (MVP) |
| Smart-contract exploit | Assessed. Evidence commitment on Midnight plus an assessor decision; the Cardano payout needs 2 of 3 assessor-committee signatures | Live on Preview: Midnight Preprod claim flow plus a Cardano exploit-cover pool that pays on a 2-of-3 committee Settle |
| Protocol SLA | Parametric. Uptime oracle below an SLA threshold | Priced in SDK. Oracle and deployment planned |