Skip to content

Commit

Permalink
fix(account_field): use isQuote for determining quota Tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
5lliot committed Oct 17, 2023
1 parent a293fb1 commit 462ee13
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions calc/account_fields_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ func (c Calculator) CalcAccountFieldsv3(ts uint64, blockNum int64, poolDetails P
if balance.IsEnabled && balance.HasBalanceMoreThanOne() {
//
var quotaInUSD *big.Int
if quota := balance.Quota; quota != nil {
if balance.IsQuoted {
quota := new(core.BigInt)
if balance.Quota != nil {
quota = balance.Quota
}
quotaInUSD = c.convertToUSD(quota.Convert(), underlying, version, blockNum)
} else {
quotaInUSD = utils.GetExpInt(84)
quotaInUSD = utils.GetExpInt(90)
}
//
tokenValueInUSD := c.convertToUSD(balance.BI.Convert(), token, version, blockNum)
Expand All @@ -70,7 +74,6 @@ func (c Calculator) CalcAccountFieldsv3(ts uint64, blockNum int64, poolDetails P
calBorrowWithInterestAndFees = new(big.Int).Mul(calBorrowWithInterest, accruedFees)
//
calHF = new(big.Int).Quo(utils.GetInt64(calThresholdValue, -4), totalDebt)

return
}

Expand Down

0 comments on commit 462ee13

Please sign in to comment.