mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-26 08:15:19 +00:00
remove unused total deposit value -- not needed by ltv range calculation (#832)
This commit is contained in:
parent
53eab47c07
commit
bdbc9b9c58
@ -284,11 +284,9 @@ func (k Keeper) IsWithinValidLtvRange(ctx sdk.Context, deposit types.Deposit, bo
|
|||||||
}
|
}
|
||||||
|
|
||||||
totalBorrowableUSDAmount := sdk.ZeroDec()
|
totalBorrowableUSDAmount := sdk.ZeroDec()
|
||||||
totalDepositedUSDAmount := sdk.ZeroDec()
|
|
||||||
for _, depCoin := range deposit.Amount {
|
for _, depCoin := range deposit.Amount {
|
||||||
lData := liqMap[depCoin.Denom]
|
lData := liqMap[depCoin.Denom]
|
||||||
usdValue := sdk.NewDecFromInt(depCoin.Amount).Quo(sdk.NewDecFromInt(lData.conversionFactor)).Mul(lData.price)
|
usdValue := sdk.NewDecFromInt(depCoin.Amount).Quo(sdk.NewDecFromInt(lData.conversionFactor)).Mul(lData.price)
|
||||||
totalDepositedUSDAmount = totalDepositedUSDAmount.Add(usdValue)
|
|
||||||
borrowableUSDAmountForDeposit := usdValue.Mul(lData.ltv)
|
borrowableUSDAmountForDeposit := usdValue.Mul(lData.ltv)
|
||||||
totalBorrowableUSDAmount = totalBorrowableUSDAmount.Add(borrowableUSDAmountForDeposit)
|
totalBorrowableUSDAmount = totalBorrowableUSDAmount.Add(borrowableUSDAmountForDeposit)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user