Skip to content

Commit

Permalink
Twocrypto -> replace linear with square in the xcp_profit vs virtual_…
Browse files Browse the repository at this point in the history
…price check
  • Loading branch information
michwill committed Dec 15, 2024
1 parent c6f3c28 commit c2a8f09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/main/CurveTwocryptoOptimized.vy
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ def tweak_price(
self.xcp_profit = xcp_profit

# ------------ Rebalance liquidity if there's enough profits to adjust it:
if virtual_price * 2 - 10**18 > xcp_profit + 2 * rebalancing_params[0]:
if virtual_price ** 2 > xcp_profit * (10**18 + 2 * rebalancing_params[0]):
# allowed_extra_profit --------^

# ------------------- Get adjustment step ----------------------------
Expand Down Expand Up @@ -1052,7 +1052,7 @@ def tweak_price(
# ---------------------------- Proceed if we've got enough profit.
if (
old_virtual_price > 10**18 and
2 * old_virtual_price - 10**18 > xcp_profit
old_virtual_price ** 2 > xcp_profit * 10**18
):

self.D = D
Expand Down

0 comments on commit c2a8f09

Please sign in to comment.