WAD arithmetic
WAD = 10^18. A WAD integer unit is 10^-18 tokens or ratio units, not one whole token. Plain token and receipt transfers use their own native decimals.
decimals().
Interest rate model
In real-number notation, with integer operations rescaled to WAD:c3*(2*c1+c2) <= 10 (1000% APR). Rates shown as APR are annualized rates, not guaranteed realized APY.
Interest accrual
get_borrows returns the preview. update_state persists accrual and advances time; it does not accrue again if the current timestamp is no later than the last update. get_borrow_balance converts shares using preview borrows, so user debt includes pending interest.
Borrow share accounting
Origination fee
get_origination_fee for the actual deployment.
vToken exchange rate
Let A be liquidity plus preview borrows and S the receipt supply converted to WAD. The virtual offset v is 1, in WAD integer units.min(requested_value, floor(A/2), available_liquidity). For partial fills the burn amount is recomputed from the payout. Borrow execution separately enforces post-borrow utilization at or below 95%.
Health factor
max(0, C-D), liquidation collateral headroom as max(0, C-1.1*D), and debt limit as C/1.1. Equity and displayed debt limit are not spendable-token or new-borrow guarantees. Frontend dust handling may differ from exact contract values.
Blend b-token valuation
LP valuation
For both registered Soroswap and Aquarius LP kinds:Unpriced, revoked, frozen, missing, or stale-cache positions can have lower or zero recognized value.
Oracle price conversion
For supported oracle precision d no greater than 18,price_wad = price * (10^18 / 10^d). The service prefers an available fresh five-record TWAP, then fresh spot, then a bounded admin fallback. Upstream freshness is 600 seconds; fallback lifetime is 86,400 seconds; the production memo window is 30 seconds.
Storage TTL
Shared constants are 6,307,200 and 63,072,000 ledgers for refresh threshold and extension target. These are code-requested TTL values, not guarantees that every entry lives for a calendar year or ten years. Storage class, reads/writes, and network limits determine actual lifetime.Source reference
Protocol_V1_Soroban_testnet/contracts/lending-pool/src/pool.rsProtocol_V1_Soroban_testnet/contracts/RiskEngineContract/src/risk_engine.rsProtocol_V1_Soroban_testnet/contracts/RateModelContract/src/rate_model.rsProtocol_V1_Soroban_testnet/contracts/vanna-common/src/math.rsmercury-stellar-backend/lib/margin-health.ts

