Skip to content

Commit 7d39684

Browse files
committed
fix: downscale grief penalty fee
1 parent 52bddd9 commit 7d39684

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

contracts/main/Twocrypto.vy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,8 +1534,8 @@ def _calc_token_fee(amounts: uint256[N_COINS],
15341534
if current_expiry > block.timestamp:
15351535
# The penalty is proportional to the remaining protection time and the current pool fee.
15361536
protection_factor: uint256 = min((current_expiry - block.timestamp) * PRECISION // self.donation_protection_period, PRECISION)
1537-
lp_spam_penalty_fee = protection_factor * fee // PRECISION
1538-
1537+
# Penalty is also proportional to donation shares amount relative to max donations ratio.
1538+
lp_spam_penalty_fee = protection_factor * fee * self.donation_shares // self.totalSupply // self.donation_shares_max_ratio
15391539
return fee * Sdiff // S + NOISE_FEE + lp_spam_penalty_fee
15401540

15411541
@view

0 commit comments

Comments
 (0)