Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelhly committed Nov 21, 2020
1 parent c45b360 commit d110681
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def remove_liquidity_imbalance(self, amounts):

def calc_withdraw_one_coin(self, token_amount, i):
xp = self.xp()
xp_reduced = xp
xp_reduced = list(xp)

D0 = self.D()
D1 = D0 - token_amount * D0 // self.tokens
Expand All @@ -166,6 +166,6 @@ def calc_withdraw_one_coin(self, token_amount, i):
self.x = [x // (p // 10 ** 18) for x, p in zip(xp_reduced, self.p)]
dy = xp_reduced[i] - self.y_D(i, D1)
self.x = [x // (p // 10 ** 18) for x, p in zip(xp, self.p)]
dy_0 = (xp[i] - new_y)
dy_0 = xp[i] - new_y

return dy, dy_0 - dy

0 comments on commit d110681

Please sign in to comment.