remove unused total deposit value -- not needed by ltv range calculation (#832)

This commit is contained in:
Nick DeLuca 2021-02-17 11:37:41 -06:00 committed by GitHub
parent 53eab47c07
commit bdbc9b9c58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}