Skip to content

Commit

Permalink
Fix more decimal errs (#677)
Browse files Browse the repository at this point in the history
* fix: turn Decimal prices to floats
  • Loading branch information
BobTheBuidler authored Nov 18, 2023
1 parent 094e00c commit 9653789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion yearn/prices/curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ async def calculate_apy(self, gauge: Contract, lp_token: AddressOrContract, bloc
try:
rate = (
inflation_rate * relative_weight * 86400 * 365 / working_supply * 0.4
) / token_price
) / float(token_price)
except ZeroDivisionError:
rate = 0

Expand Down
2 changes: 1 addition & 1 deletion yearn/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async def describe(self, block=None):
return {
'totalSupply': crv_locked,
'token price': crv_price,
'tvl': crv_locked * crv_price,
'tvl': crv_locked * float(crv_price),
}

async def total_value_at(self, block=None):
Expand Down

0 comments on commit 9653789

Please sign in to comment.