diff --git a/contracts/main/CurveTwocryptoOptimized.vy b/contracts/main/CurveTwocryptoOptimized.vy index 38195ed3..d036988d 100644 --- a/contracts/main/CurveTwocryptoOptimized.vy +++ b/contracts/main/CurveTwocryptoOptimized.vy @@ -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 diff --git a/tests/unitary/pool/test_oracles.py b/tests/unitary/pool/test_oracles.py index c3808777..96cf2b16 100644 --- a/tests/unitary/pool/test_oracles.py +++ b/tests/unitary/pool/test_oracles.py @@ -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)