Skip to content

Commit

Permalink
Update changelog and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
allt0ld committed Oct 20, 2023
1 parent 55fd31c commit 3126709
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Changed
-------

- Enabled _claim_admin_fees for CurveCryptoPool. For maintainability, Tricrypto_ng's
implementation and usage patterns, which are in test/fixtures/curve/tricrypto_ng.vy
(Ctrl + F _claim_admin_fees), are used for both 2-coin and 3-coin Cryptoswap pools.
13 changes: 11 additions & 2 deletions curvesim/pool/cryptoswap/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,14 @@ def _tweak_price( # noqa: complexity: 12
self.virtual_price = virtual_price

def _claim_admin_fees(self) -> None:
"""
If the pool's profit has increased since the last fee claim, update profit,
pool value, and LP token supply to reflect the admin taking its share of the
fees by minting itself LP tokens. Otherwise, change nothing.
Tricrypto-NG and Cryptopool implement this functionality differently, so we
copy only Tricrypto-NG's way in this class for consistency.
"""
# no gulping logic needed for the python code
A: int = self.A
gamma: int = self.gamma
Expand Down Expand Up @@ -892,7 +900,7 @@ def remove_liquidity_one_coin(

return dy

# pylint: disable-next=too-many-locals,too-many-arguments
# pylint: disable-next=too-many-locals,too-many-arguments, too-many-branches
def _calc_withdraw_one_coin(
self,
A: int,
Expand Down Expand Up @@ -1054,7 +1062,8 @@ def lp_price(self) -> int:
price_oracle: List[int] = self.internal_price_oracle()
price: int = factory_2_coin.lp_price(virtual_price, price_oracle)
elif self.n == 3:
# 3-coin vyper contract uses cached packed oracle prices instead of internal_price_oracle()
# 3-coin vyper contract uses cached packed oracle prices instead of
# internal_price_oracle()
virtual_price = self.virtual_price
price_oracle = self._price_oracle
price = tricrypto_ng.lp_price(virtual_price, price_oracle)
Expand Down

0 comments on commit 3126709

Please sign in to comment.