Skip to main content

Module math

Module math 

Source
Expand description

Shared integer accounting math for Roshi vaults.

Constants§

BPS_DENOMINATOR
SHARE_DECIMALS

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 use assets_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.

Type Aliases§

MathResult