Expand description
Shared integer accounting math for Roshi vaults.
Constants§
Functions§
- assets_
for_ redeem - assets_
for_ shares - Floor-rounded base value of
shares. Zero is a valid result: a dust position can be worth less than one base atom, and withdrawal-ticket strikes must price it (to nothing) rather than wedge. Immediate redemption paths that must pay out should useassets_for_redeem. - base_
atoms_ from_ asset_ atoms - Floor-rounded base atoms for
asset_atoms, priced through two whole-token oracle legs sharing one quote currency: - bps_
ceil - bps_
floor - checked_
u64 - mul_
div_ ceil - mul_
div_ ceil_ u64 - mul_
div_ floor - mul_
div_ floor_ u64 - performance_
fee_ for_ nav - pow10
- share_
price_ from_ assets - shares_
for_ deposit - validate_
percentage_ bps - virtual_
share_ offset - The virtual share supply backing one virtual base atom:
10^(SHARE_DECIMALS - base_decimals), the empty-vault mint ratio.