Skip to content

Commit 868b1ba

Browse files
committed
fix bug: we should incorporate the reserved balance of LRNA as LRNA can be on lockdown by our circuit breaker. If we dont do we this, the more LRNA we have in lockdown, the more this ratio increases, leading to unwanted add liquidty fail
1 parent 1745c9c commit 868b1ba

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pallets/omnipool/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2154,7 +2154,7 @@ impl<T: Config> Pallet<T> {
21542154

21552155
let hub_reserve_ratio = FixedU128::checked_from_rational(
21562156
new_asset_state.hub_reserve,
2157-
T::Currency::free_balance(T::HubAssetId::get(), &Self::protocol_account())
2157+
T::Currency::total_balance(T::HubAssetId::get(), &Self::protocol_account())
21582158
.checked_add(*state_changes.asset.total_delta_hub_reserve())
21592159
.ok_or(ArithmeticError::Overflow)?,
21602160
)

0 commit comments

Comments
 (0)