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
This calculation is somewhat similar to the getAmountIn(), but not the same.