From bdbc9b9c586976005548fbfaa6921d4ab836708f Mon Sep 17 00:00:00 2001 From: Nick DeLuca Date: Wed, 17 Feb 2021 11:37:41 -0600 Subject: [PATCH] remove unused total deposit value -- not needed by ltv range calculation (#832) --- x/hard/keeper/liquidation.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/x/hard/keeper/liquidation.go b/x/hard/keeper/liquidation.go index ca0f2737..b95c3c59 100644 --- a/x/hard/keeper/liquidation.go +++ b/x/hard/keeper/liquidation.go @@ -284,11 +284,9 @@ func (k Keeper) IsWithinValidLtvRange(ctx sdk.Context, deposit types.Deposit, bo } totalBorrowableUSDAmount := sdk.ZeroDec() - totalDepositedUSDAmount := sdk.ZeroDec() for _, depCoin := range deposit.Amount { lData := liqMap[depCoin.Denom] usdValue := sdk.NewDecFromInt(depCoin.Amount).Quo(sdk.NewDecFromInt(lData.conversionFactor)).Mul(lData.price) - totalDepositedUSDAmount = totalDepositedUSDAmount.Add(usdValue) borrowableUSDAmountForDeposit := usdValue.Mul(lData.ltv) totalBorrowableUSDAmount = totalBorrowableUSDAmount.Add(borrowableUSDAmountForDeposit) }