Function runtime_common::update_nav_with_input
source · pub fn update_nav_with_input<T>(
pool_id: <T as Config>::PoolId,
price_input: PriceCollectionInput<T>
) -> Result<PoolNav<<T as Config>::Balance>, DispatchError>where
T: Config<PoolId = <T as Config>::PoolId, Balance = <T as Config>::Balance> + Config + Config<PoolId = <T as Config>::PoolId, Balance = <T as Config>::Balance>,
Expand description
§Updates the nav for a pool.
NOTE: Should NEVER be used in consensus relevant state changes!
§Execution infos
- For external assets it is either using the latest oracle prices if they are not outdated or it is using no prices and allows the chain to use the estimates based on the linear accrual of the last settlement prices.
- IF
nav_fees > nav_loans
then thenav_total
will saturate at 0