Skip to content

Commit

Permalink
remove admin fee auto claim in add_liquidity
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Dec 16, 2023
1 parent 4cc4b74 commit ab2080b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions contracts/main/CurveTwocryptoOptimized.vy
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,6 @@ def add_liquidity(
@return uint256 Amount of LP tokens received by the `receiver
"""

self._claim_admin_fees() # <--------- Auto-claim admin fees occasionally.

A_gamma: uint256[2] = self._A_gamma()
xp: uint256[N_COINS] = self.balances
amountsp: uint256[N_COINS] = empty(uint256[N_COINS])
Expand Down
10 changes: 4 additions & 6 deletions tests/unitary/pool/test_admin_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ def test_admin_fee_after_deposit(
swap.exchange(1, 0, to_swap, 0)

balances = [swap.balances(i) for i in range(2)]
print("Balance of the pool: " + str(balances[0]) + ", " + str(balances[1]))
print("Ratio:", ratio)
split_quantities = [int(balances[0] * ratio), int(balances[1] * ratio)]
with boa.env.prank(user):
swap.add_liquidity(split_quantities, 0)

print("FEES 0: " + str(coins[0].balanceOf(fee_receiver)))
print("FEES 1: " + str(coins[1].balanceOf(fee_receiver)))

print()
assert (
coins[0].balanceOf(fee_receiver) + coins[1].balanceOf(fee_receiver)
== 0
)

return swap

0 comments on commit ab2080b

Please sign in to comment.