'web3.exceptions.ContractLogicError: execution reverted: UniswapV2Router: INSUFFICIENT_A_AMOUNT

Please, help. I want to add liquidity to token pair: weth/uni-v2. I calculate optimal numbers of tokens to add. After approving to router withdraw tokens I execute "addLiquidityETH" function. In Remix IDE this function execute without mistakes, but in my python dapp I receive this error:

web3.exceptions.ContractLogicError: execution reverted: UniswapV2Router: INSUFFICIENT_A_AMOUNT.

getAmountsOut call

How can I solve this problem? I calculate optimal numbers of tokens with "getAmountsOut" function



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source