From 232ba081be2bf6cba5e4068225cd80fc457b58d9 Mon Sep 17 00:00:00 2001 From: Alberto Date: Sun, 17 Mar 2024 19:34:14 +0100 Subject: [PATCH] fix: `calc_token_amount` correction --- contracts/main/CurveStableSwapNGViews.vy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/main/CurveStableSwapNGViews.vy b/contracts/main/CurveStableSwapNGViews.vy index c891703d..c49e7270 100644 --- a/contracts/main/CurveStableSwapNGViews.vy +++ b/contracts/main/CurveStableSwapNGViews.vy @@ -283,7 +283,7 @@ def calc_token_amount( else: difference = new_balance - ideal_balance - xs = old_balances[i] + new_balance + xs = rates[i] * (old_balances[i] + new_balance) / PRECISION _dynamic_fee_i = self._dynamic_fee(xs, ys, base_fee, fee_multiplier) new_balances[i] -= _dynamic_fee_i * difference / FEE_DENOMINATOR