Skip to content

dolepee/capletfi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CapletFi

CapletFi CI

DeepBook Predict carry notes on Sui with an enforced hedge budget. One DUSDC deposit becomes a downside binary hedge, a PLP carry leg, a shared Sui note object, a Walrus term sheet, and a settlement receipt.

Product Moment

CapletFi packages low-level DeepBook Predict primitives into a note a user can understand before signing:

  1. Pick deposit, expiry, risk budget, and upside target.
  2. The app previews the downside strike, enforced hedge budget, PLP allocation, and term sheet.
  3. The V3 mint path rejects a note if the binary budget exceeds the declared risk budget or the structure is not a live downside hedge.
  4. If valid, minting buys the DeepBook Predict binary, supplies the carry leg into PLP, stores the term sheet on Walrus, and creates the shared Sui note.
  5. After oracle expiry, any keeper can settle the shared note while payout still routes to the recorded holder.
  6. The holder can claim any manager credit from the Receipts page with the manager-owner wallet.

The product enforces the hedge budget, not the final outcome. It is not principal-guaranteed, not risk-free, and not fixed APY.

Enforced vs Disclosed

Item Enforced on-chain Disclosed after mint/settlement
Hedge budget Binary budget must be <= declared risk budget. Actual binary cost and unspent manager credit.
Hedge structure Downside-only binary, active oracle, expiry match, strike below spot. Oracle id, strike, expiry, and DeepBook events.
Settlement outcome No realized-loss assert, so settlement cannot brick valid notes. Keeper/Walrus summary compares realized total value against the declared budget.

Why DeepBook Is Load-Bearing

CapletFi cannot mint or settle without DeepBook Predict:

  • predict::create_manager creates the holder-owned manager used for binary redemption.
  • predict::mint buys the downside binary hedge.
  • predict::supply supplies the carry leg into PLP.
  • predict::redeem_permissionless redeems the hedge after oracle settlement.
  • predict::withdraw returns PLP value to the note holder.
  • predict_manager::withdraw lets the holder claim manager credit after settlement.

Without those calls, there is no hedge leg, no carry leg, no note payout, and no settlement path.

Live Proof Snapshot

Proof What it shows Digest
Hedge paid Same note structure can recover binary payout plus PLP value Cbgrz1si8QioAXR8CPL7pmAjEmqUPiiYzoZU9FtbCn2S
Hedge expired Same note structure still settles PLP when binary payout is zero CFNQ4q8jqDiVzf2uTnUguphegRPBJvKQkc2yfDpFjEhU
V3 enforced budget Mint emitted CapletRiskBudgetEnforced; later settled by a non-holder with risk-budget Walrus attestation EWfmQzAt72ThYg2qCSC4s3HjcF3ZtLrLdYhn54HrLhmU
V2 non-holder settled Shared CapletNote was settled by a non-holder signer and paid the recorded holder FXYriUuFnuqkvBtiPZTkXttCAQE5xCqtgFGAaZVZdYTv

The V3 proof is the current headline receipt: the mint capped binary budget at the declared 0.100000 DUSDC risk budget, emitted CapletRiskBudgetEnforced, then the shared note was settled by 0x06db...ddf while payout routed to holder 0xa751...9c1. The Walrus summary records realized delta -84 bps and withinDeclaredBudget: true.

Detailed receipt ledger, package ids, and namespace notes live in docs/PROOF_SURFACE.md.

Verify

Replay the live receipt portfolio:

npm run verify:receipts

Expected markers:

  • CAPLETFI_V1_1_PORTFOLIO_VALID
  • CAPLETFI_V2_SETTLED_NOTE_VALID
  • CAPLETFI_V3_RISK_BUDGET_VALID
  • CAPLETFI_NON_HOLDER_SETTLEMENT_VALID
  • CAPLETFI_DEEPBOOK_CALL_PATH_VALID

Run the broader local check:

npm run verify:judge

This builds the keeper, replays live receipts, typechecks the web app, and builds the web app. GitHub Actions also runs Move build/tests, web checks, keeper checks, live receipt replay, and the V2/V3 invariant guard.

Narrative safety:

npm run verify:narrative

Expected marker: CAPLETFI_NARRATIVE_VALID. Bankr is optional; the deterministic guarded narrative is the live-safe path and avoids guarantee language.

Mint From The App

Use a Sui testnet wallet with:

  1. SUI gas from https://faucet.sui.io
  2. DUSDC from https://tally.so/r/Xx102L
  3. A holder-owned PredictManager created by clicking Create PredictManager in the mint form

Use your own PredictManager, not a demo wallet manager. Binary proceeds and unspent hedge budget redeem into the holder-owned manager after settlement, while the PLP payout goes to the holder recorded at mint.

After settlement, open Receipts, paste your PredictManager id, enter the manager-credit amount, and click Claim DUSDC. That call is holder-only by DeepBook design; a keeper can settle someone else's note but cannot withdraw from someone else's manager.

Boundaries

  • CapletFi runs on Sui testnet because DeepBook Predict is testnet-only during the Sui Overflow submission window.
  • DUSDC is a DeepBook Predict test asset.
  • The May 30 V2 receipt proves non-holder settlement and holder-directed payout, not mainnet production readiness.
  • Some historical proof events still use the original Strata module namespace so already published receipts remain verifiable. The public product and current V3 package are CapletFi.

See docs/RISK_MODEL.md for the full risk and control boundary.

Repo Layout

caplet_contracts/   CapletFi-native V3 Move package and router
strata_contracts/   Legacy V1.1 proof package kept for published receipts
keeper/             TypeScript settlement daemon, verifier, and Walrus summary tooling
web/                Next.js mint form, receipts UI, and narrative API route
docs/               Current risk/proof docs plus archived build and deployment notes

Sources

License

MIT.

Packages

 
 
 

Contributors