Architecture
Stormbit is a collar vault. Lender capital sits in one ERC-4626 vault; every loan drawn against it is wrapped in an options collar at origination. Four contracts, one job each.

CollarVault, the core. An ERC-4626 vault holding lender USDC and the loan book. Lenders deposit and withdraw; borrowers openCollar and repayCollar; requestExit queues a withdrawal against capital that is currently lent, and settleMatured closes a loan past its expiry. Each loan records its floor, cap, and expiry on-chain. Upgradeable, pausable, reentrancy-guarded.
StormbitRouter, batches user operations (open, repay, approvals) into a single transaction. It is the only contract permitted to pull a repayment on the borrower’s behalf.
OptionDesk, the collar’s option leg. When a loan opens, the vault writes the position here: the collateral backs a sold call at the cap, funded by premium from a keeper-prefunded pool. On repay the call detaches to the borrower; at or after expiry it settles against the spot oracle in-kind from the collateral.
QuoteOracle, prices the collar. The vault reads it at origination to quote the loan against LTV, term, and implied volatility.
Collateral spot prices come from Pyth feeds, normalized and staleness-checked, and are read only at origination and settlement.
See Contract Addresses for deployments per network.