Skip to content

Commit 8dbe7ff

Browse files
committed
add explanatory comment
1 parent 868b1ba commit 8dbe7ff

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pallets/omnipool/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,6 +2152,9 @@ impl<T: Config> Pallet<T> {
21522152
.delta_update(&state_changes.asset)
21532153
.ok_or(ArithmeticError::Overflow)?;
21542154

2155+
// Using total balance to include reserved LRNA in balance calculations.
2156+
// Speciically important uin case when LRNA is in lockdown by our deposit limit circuit breaker
2157+
// If we used free_balance, ratio will increase as more LRNA gets locked, causing add liquidity to fail.
21552158
let hub_reserve_ratio = FixedU128::checked_from_rational(
21562159
new_asset_state.hub_reserve,
21572160
T::Currency::total_balance(T::HubAssetId::get(), &Self::protocol_account())

0 commit comments

Comments
 (0)