0

I know that there is a 0.3% fee in the flashloan of Uniswap v2, which is deducted from the transaction. When I use the swap () function for flashloans, in the end I should pay back the money. I need to calculate the fee, I see someone calculating it this way, and I cannot understand:

uint256 _ fee = (_amount * 3) / 997 + 1

enter image description here This calculation is somewhat similar to the getAmountIn(), but not the same. enter image description here

1 Answer 1

0

The formula and explanation can be found here in the Uniswap docs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.