The product
The solvency model
The hard part of leverage is keeping the lender whole. TORQUE's answer: the vault is a secured lender, never a counterparty.
Fully hedged
Every open position is backed 1:1 by the q NVDA it bought, and the market contract holds that NVDA. The vault's exposure is a loan of D(t) USDG secured by q NVDA. The vault is never short NVDA, which is why long-only works with a small vault. Shorts would need NVDA inventory in the vault, so they are v2.
How the vault values its loans
totalAssets = idle USDG + Σ markᵢ, where markᵢ = min(Dᵢ(t), qᵢ × min(P_feed, P_pool30m) × 0.99).
Loans are marked at the lower of the feed and the pool's 30-minute average, less the full 1% execution allowance. A loan that a gap has pushed underwater is written down as soon as either price shows it, before the knock-out lands, so an LP cannot withdraw at face value ahead of a known loss.
Caps, enforced in the contract
| Parameter | Value | Why |
|---|---|---|
| Vault cap | 20 USDG | LP vault capped at $20 USDG for the buildathon. Checked in maxDeposit / maxMint and again in _deposit |
| Utilisation | 80% | total borrow ≤ 80% of vault assets: the $20 vault lends at most $16 |
| Open interest | 30 USDG | 1.5× the vault; the NVDA hedge is at most ~0.13 NVDA |
| Positions | 32 | bounds the valuation loop; the caps allow at most 15 |
| Leverage | 2×–5× | 5× keeps a ~19% weekend-gap cushion |
| Knock-out buffer | 5% | an in-session knock-out still repays in full after a 3.7% drop between feed updates (the largest single update measured was 1.43%) |
| Slippage | 1% | every swap must land within 1% of Chainlink |
| Financing | 10% APR | paid to LPs |
| Open fee | 0.10% of margin × L | paid to LPs |
| Minimum margin | 1 USDG | no dust positions |
There is no owner, no pause and no upgrade path. All parameters are constants. The only privileged call is a one-shot setMarket from the deployer, made once at deployment, and the deploy script seeds the vault in the same run.
A weekend gap through the knock-out level
- Friday evening the feed freezes with a position open. Either the pool check or the 12-hour age limit shuts opens, knock-outs and LP flows.
- Over the weekend NVDA trades lower in the pool.
knockOut,open,depositandwithdrawrevert;closereverts withUnderwaterif the pool no longer covers the debt. - Monday's first fresh price is below the financing level.
knockOutsucceeds, the trader receives 0 (the margin, never more), and the vault takes the sale proceeds. Any shortfall is bad debt, and it was already in NAV from the moment a fresh price showed it.
A fresh position takes no bad debt unless the Monday price is below F / 0.99: a gap of about 19.2% below entry at 5× and 49.5% at 2×.
The invariants, written before the product code
- Backing: the market's NVDA balance equals
Σ qᵢover open positions. - No stranded USDG: the market holds exactly the residuals owed to traders.
- Conservation: vault USDG = deposits − withdrawals − principal lent + repayments + fees.
- Cap: no deposit ever leaves total assets above the cap.
- Open interest: within both caps at every open.
- NAV never overstated, recomputed independently.
- Bad debt needs a gap: with no gap larger than the cushion, bad debt is zero.
- Unsafe means shut: no open, deposit or withdrawal on a stale feed or out-of-band pool, judged by the handler's own geometric average.
- Exact payouts: every close or knock-out pays exactly proceeds − repayment.
All nine pass at 1,024 runs × 128 calls (131,072 calls each) under FOUNDRY_PROFILE=ci, re-run on 2026-10-03; the default profile runs 256 × 64. The handler simulates in-session moves, sell-offs, gaps and weekends.