Function total_assets_for_fee_accrual

Source
pub fn total_assets_for_fee_accrual(
    cur_total_assets: u128,
    anchor_total_assets: u128,
    anchor_timestamp_ns: u64,
    now_ns: u64,
    max_rate: Option<Wad>,
) -> u128
Expand description

Compute the effective total_assets for fee accrual, clamping growth to the max rate if configured.

When max_rate is Some, limits the effective total_assets to anchor_total_assets * (1 + max_rate * elapsed / YEAR). If the anchor asset value is zero, any positive current assets are treated as uncapped zero-anchor growth and excluded from fee accrual until the anchor is advanced by the caller.