diff --git a/contracts/main/CurveTwocryptoOptimized.vy b/contracts/main/CurveTwocryptoOptimized.vy index 4c409b59..c4089642 100644 --- a/contracts/main/CurveTwocryptoOptimized.vy +++ b/contracts/main/CurveTwocryptoOptimized.vy @@ -1250,13 +1250,11 @@ def _fee(xp: uint256[N_COINS]) -> uint256: @internal @pure def get_xcp(D: uint256, price_scale: uint256) -> uint256: + return isqrt( + unsafe_div(D, N_COINS) * # <------------- xp[0] + D * PRECISION / (price_scale * N_COINS) # xp[1] + ) # <------------------------------- Geometric mean - x: uint256[N_COINS] = [ - unsafe_div(D, N_COINS), - D * PRECISION / (price_scale * N_COINS) - ] - - return isqrt(x[0] * x[1]) # <------------------- Geometric Mean. @view diff --git a/requirements.txt b/requirements.txt index a2b9e663..931c4383 100644 --- a/requirements.txt +++ b/requirements.txt @@ -23,5 +23,5 @@ pandas matplotlib # vyper and dev framework: -git+https://github.com/vyperlang/titanoboa@87593bb5c4d02bb8eaf4cc93e0e940ebf9a37900 +git+https://github.com/vyperlang/titanoboa@8c2f673c10439d13b976d1f1667462810379f010 vyper>=0.3.10 diff --git a/tests/unitary/math/test_newton_D.py b/tests/unitary/math/test_newton_D.py index d1cfe5b7..efdc0d88 100644 --- a/tests/unitary/math/test_newton_D.py +++ b/tests/unitary/math/test_newton_D.py @@ -4,7 +4,6 @@ from decimal import Decimal import pytest -from boa.vyper.contract import BoaError from hypothesis import given, settings from hypothesis import strategies as st diff --git a/tests/unitary/math/test_newton_D_ref.py b/tests/unitary/math/test_newton_D_ref.py index 6852c39d..aa49b7b2 100644 --- a/tests/unitary/math/test_newton_D_ref.py +++ b/tests/unitary/math/test_newton_D_ref.py @@ -3,7 +3,7 @@ from decimal import Decimal import pytest -from boa.vyper.contract import BoaError +from boa import BoaError from hypothesis import given, settings from hypothesis import strategies as st