Skip to content

Commit

Permalink
simplify claim admin fees a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
bout3fiddy committed Aug 2, 2023
1 parent 1b5095e commit ed15aa1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contracts/main/CurveTricryptoOptimizedWETH.vy
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ def _claim_admin_fees():
# -------------------------------- Calculate admin share to be minted.
frac = vprice * 10**18 / (vprice - fees) - 10**18
admin_share = total_supply * frac / 10**18
total_supply += admin_share

# ------ Subtract fees from profits that will be used for rebalancing.
xcp_profit -= fees * 2
Expand All @@ -1147,10 +1148,7 @@ def _claim_admin_fees():
# than old virtual price, since the claim process can result
# in a small decrease in pool's value.

vprice = (
10**18 * self.get_xcp(D, packed_price_scale) /
(total_supply + admin_share)
)
vprice = 10**18 * self.get_xcp(D, packed_price_scale) / total_supply
if vprice < 10**18:
return # <------ Virtual price goes below 10**18 > Do not claim fees.

Expand Down

0 comments on commit ed15aa1

Please sign in to comment.