fix: include fees in public liquidity

This commit is contained in:
Mohamed Sohail 2024-03-26 16:56:44 +08:00
parent 78844169c5
commit 4931ef1d70
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
3 changed files with 3 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -140,7 +140,6 @@ contract SwapPool {
uint256 balance;
uint256 fee;
uint256 outValue;
uint256 trueBalance;
outValue = getQuote(_outToken, _inToken, _value);
@ -148,9 +147,6 @@ contract SwapPool {
require(r, "ERR_TOKEN");
balance = abi.decode(v, (uint256));
// unwithdrawn fees should remain untouched
trueBalance = balance - fees[_outToken];
// deduct the fees from the quoted outValue
fee = getFee(outValue);
outValue -= fee;