Skip to content

Commit

Permalink
fix: lp price isqrt input
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Dec 23, 2023
1 parent 6246ad9 commit 50b381b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/main/CurveTwocryptoOptimized.vy
Original file line number Diff line number Diff line change
Expand Up @@ -1630,7 +1630,7 @@ def lp_price() -> uint256:
0th index
@return uint256 LP price.
"""
return 2 * self.virtual_price * isqrt(self.internal_price_oracle()) / 10**18
return 2 * self.virtual_price * isqrt(self.internal_price_oracle() * 10**18) / 10**18


@external
Expand Down
2 changes: 1 addition & 1 deletion tests/unitary/pool/test_oracles.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ def test_lp_price(swap_with_deposit):
// 10**18
)
naive_price = tvl * 10**18 // swap_with_deposit.totalSupply()
assert abs(swap_with_deposit.lp_price() / naive_price - 1) < 2e-3
assert approx(naive_price, swap_with_deposit.lp_price(), 0)

0 comments on commit 50b381b

Please sign in to comment.