programs/vanna_credit_layer/src/math/ and constants.rs.
Scales
Utilization and borrow rate
Each reserve stores aRateCurve { linear_coeff_wad, jump_coeff_wad, rate_multiplier_wad }. Every coefficient must be greater than zero and at most 10 × WAD.
u approaches 1 (the u^32 and u^64 terms).
Accrual
interest_remainder_wad, fee_remainder) carry forward, so frequent accruals neither overcharge borrowers nor shortchange the treasury. now < last_update is rejected (TimestampRegression).
Lender shares
total_supply_shares), so share tokens burned outside Vanna don’t change anyone’s claim. The first deposit locks MIN_INITIAL_SHARES that nobody can redeem.
Debt shares
USD value and health
Liquidation
seized ≥ min_seized. While the margin is solvent, the bonus never exceeds its equity, so a liquidation never turns a solvent margin into bad debt.
Write-off
admin_write_off clears every debt of a margin whose collateral is at most $1 and below its debt, with no venue position open. Each reserve’s accrued_protocol_fees absorb the loss first. Lender assets fall by the rest.
