TORQUE

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

ParameterValueWhy
Vault cap20 USDGLP vault capped at $20 USDG for the buildathon. Checked in maxDeposit / maxMint and again in _deposit
Utilisation80%total borrow ≤ 80% of vault assets: the $20 vault lends at most $16
Open interest30 USDG1.5× the vault; the NVDA hedge is at most ~0.13 NVDA
Positions32bounds the valuation loop; the caps allow at most 15
Leverage2×–5×5× keeps a ~19% weekend-gap cushion
Knock-out buffer5%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%)
Slippage1%every swap must land within 1% of Chainlink
Financing10% APRpaid to LPs
Open fee0.10% of margin × Lpaid to LPs
Minimum margin1 USDGno 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

  1. 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.
  2. Over the weekend NVDA trades lower in the pool. knockOut, open, deposit and withdraw revert; close reverts with Underwater if the pool no longer covers the debt.
  3. Monday's first fresh price is below the financing level. knockOut succeeds, 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

  1. Backing: the market's NVDA balance equals Σ qᵢ over open positions.
  2. No stranded USDG: the market holds exactly the residuals owed to traders.
  3. Conservation: vault USDG = deposits − withdrawals − principal lent + repayments + fees.
  4. Cap: no deposit ever leaves total assets above the cap.
  5. Open interest: within both caps at every open.
  6. NAV never overstated, recomputed independently.
  7. Bad debt needs a gap: with no gap larger than the cushion, bad debt is zero.
  8. 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.
  9. 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.