New answers tagged

0

If you're swapping tokens with hard coded tax inside on their smart contract (in your case 10%). The "minimum token" appearing on the website is wrong, because it is based on normal token contract with no tax/fees.


0

The AMM itself has no way of knowing how many tokens are deducted for fees. It can only calculate on the knowledge it has inside itself, so it gives you data based on its own numbers. However, a frontend for such AMM may try to emulate such transaction to see how many tokens would be received. But I think at least Uniswap's website doesn't calculate the ...


0

From BEP20 documentation What is BEP20? A token protocol on BSC which is compatible with BEP2 and ERC20. It extends ERC20 and contains more interfaces, such as getOwner and decimals. BEP-20 compliant doesn't require any support for Pancakeswap.


0

I found the answer... pancakeswap has some pairs quoted in maaany decimal places, so the output is not in tokens but in 1/1000000000000 of a token.


0

I believe it is because you need to add .send() to the end of any call to the blockchain that changes state (and .call() when reading state) for example: tx = await uniswap.swapExactTokensForTokens( amountIn, amountOutMin, path, to, deadline ); should be: tx = await uniswap.swapExactTokensForTokens( amountIn, ...


0

When you make a swap, you're likely to get a little less than the expected amount ( if other people sell/buy while your tx is being processed the price will be different that the one calculated by getAmountsOut(), that's called slippage, you probably already heard the word). If you're doing this as a test project i suggest setting minAmountOut to 0, if you'...


0

The problem is quite clear with the wss://mainnet.infura.io/ws/v3/<code> you are accessing Ethereum mainnet. The pancake contracts are on the Bsc network. They provide some endpoints you could use in their documentation.


Top 50 recent answers are included