Skip to content

Commit

Permalink
perf: removed redundant check
Browse files Browse the repository at this point in the history
Exact same check (except bounds were centered at 0.5, which is the correct way of checking this) is performed at the end of `newton_D`.
  • Loading branch information
AlbertoCentonze committed May 27, 2024
1 parent 277dcc6 commit 391d378
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions contracts/main/CurveTwocryptoOptimized.vy
Original file line number Diff line number Diff line change
Expand Up @@ -965,10 +965,6 @@ def tweak_price(
# ------------------------------------------ Update D with new xp.
D: uint256 = MATH.newton_D(A_gamma[0], A_gamma[1], xp, 0)

for k in range(N_COINS):
frac: uint256 = xp[k] * 10**18 / D # <----- Check validity of
assert (frac > 10**16 - 1) and (frac < 10**20 + 1) # p_new.

# ------------------------------------- Convert xp to real prices.
xp = [
unsafe_div(D, N_COINS),
Expand Down

0 comments on commit 391d378

Please sign in to comment.