From 1a81769615463a3aa160d6e611fc0d2921ac6e4c Mon Sep 17 00:00:00 2001 From: Marc Puig Date: Thu, 25 Jan 2024 14:39:47 +0100 Subject: [PATCH] fix (#749) --- x/liquidstakeibc/keeper/host_chain.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x/liquidstakeibc/keeper/host_chain.go b/x/liquidstakeibc/keeper/host_chain.go index c942d70ad..b772328a4 100644 --- a/x/liquidstakeibc/keeper/host_chain.go +++ b/x/liquidstakeibc/keeper/host_chain.go @@ -197,6 +197,12 @@ func (k *Keeper) ProcessHostChainValidatorUpdates( // shares * validator_lsm_cap - liquid_shares capRoom := validator.DelegatorShares.Mul(hc.Params.LsmValidatorCap).Sub(validator.LiquidShares) + // if the bond factor functionality is disabled, calculate available room based only on the cap + if hc.Params.LsmBondFactor.Equal(sdk.NewDecFromInt(sdk.NewInt(-1))) { + validatorHasEnoughRoom = msgDelegate.Amount.Amount.LT(capRoom.TruncateInt()) + continue + } + // calculate the amount of shares left to reach the validator bond cap // bond_shares * bond_factor - liquid_shares bondRoom := validator.ValidatorBondShares.Mul(hc.Params.LsmBondFactor).Sub(validator.LiquidShares)