Skip to content

Commit

Permalink
adjust decimal handling
Browse files Browse the repository at this point in the history
  • Loading branch information
bonedaddy committed Mar 26, 2021
1 parent 9d263b3 commit 90b9183
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bclient/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ func (c *Client) GetTotalValueLocked(ip IndexPool, mc *multicall.Multicall, logg
if err != nil {
return 0, errors.Wrap(err, "failed to get exchange amount")
}
tokenEthPriceDec := utils.ToDecimal(tokenEthPrice, int(decimals[addr]))
// we should be able to just handle decimals of 18 here and not worry
// about the commented out code, i think this is the case because we are calculating
// price of the uniswal pair which is 18
tokenEthPriceDec := utils.ToDecimal(tokenEthPrice, 18)
// todo(bonedaddy): may need to reconsider handling this
// tokenEthPriceDec := utils.ToDecimal(tokenEthPrice, int(decimals[addr]))

ethDaiPrice, err := c.EthDaiPrice()
if err != nil {
Expand Down

0 comments on commit 90b9183

Please sign in to comment.