蔵treasury model
the showcase vault uses a pre-funded treasury reserve. that's the simplest possible source — admin tops up usdc, ticks drain it. real production replaces this with a live yield source (drift funding capture, sanctum LST, phoenix MM).
two token accounts
kagura-vault holds usdc in two distinct pdas:
| account | seed | role |
|---|---|---|
principal_account | [b"principal", vault.key()] | the “real” vault balance backing all shares. deposits land here, withdraws drain here, ticks fill it. |
treasury_account | [b"treasury", vault.key()] | the funding reserve. admin tops up. ticks transfer accrued amount treasury → principal. |
the economic flow
1 ┌──────────────┐2 │ admin │ top_up_treasury(amount)3 └──────┬───────┘4 │ spl-token transfer5 ▼6 ┌──────────────┐ ┌─────────────────┐7 │ treasury │ ── tick_funding ──→ │ principal │8 │ (reserve) │ ↑ │ (backing shares)│9 └──────────────┘ │ └─────────────────┘10 │ │11 │ │ withdraw(shares)12 │ ▼13 │ ┌─────────┐14 │ │ user │15 └─ accrued = └─────────┘16 principal × rate × elapsed_ms / (10000 × ms_year)treasury runway
At a fixed rate r with constant principal P and treasury balance T, the vault can sustain its target apr for:
1runway_years = T / (P × r)2 3example:4 treasury = 100,000 USDC5 principal = 10,000 USDC6 rate = 22%7 8 runway = 100_000 / (10_000 × 0.22)9 ≈ 45.45 yearsAt more realistic numbers (TVL approaching treasury):
1treasury = 100,000 USDC2principal = 100,000 USDC (TVL = treasury)3rate = 22%4 5runway = 100_000 / (100_000 × 0.22) ≈ 4.55 years6 = ~1659 days7 = ~ 39,792 hours8 = ~143,251,200 seconds9 = ~95,500,800 ticks at 1.5s cadencereal-yield replacements
kagura-vault is intentionally simple. The interface for swapping in a real yield source is to replace one cpi: the treasury → principal transfer becomes a cpi to the chosen yield primitive.
| source | cpi | nature |
|---|---|---|
| drift funding | drift::deposit / withdraw | vault holds a delta-neutral perp position; funding accrues continuously and is captured by the vault. |
| sanctum LST | sanctum::deposit_sol | vault holds an LST that compounds staking rewards into share price automatically. |
| phoenix mm | phoenix::place_limit_orders | vault provides liquidity on phoenix clob; spread + maker rebate captured. |
| treasury reserve | spl-token transfer | what the showcase uses. admin pre-funds, ticks drain. |
v1 of kagura-vault keeps the synthetic reserve so the math is observable from the on-chain accounts alone. v1.5 swaps it for drift funding capture. See changelog.