What does getAmountsOut/getAmountOut and getAmountsIn/getAmountIn exactly do? There isn't an explanation in the Pancakeswap docs, so I'm not sure how could I use it. What's the difference between the two and with the 's' or none?
Pancakeswap router v2 - getAmountsOut?
1.3k Views Asked by Austin At
1
There are 1 best solutions below
Related Questions in WEB3JS
- Not able to install web3 using nodejs
- web3.eth.accounts returning a function
- web3.js calling transfer function return Invalid number of arguments to Solidity function
- How to transfer Ethereum from one wallet to another wallet by using web3?
- Solidity Overflow in my web3 code but works in oneclickdapp
- "Returned error: gas required exceeds allowance (123965250) or always failing transaction" when estimating gas for Kyber 'trade' contract function
- form result to metamask
- Making a Dapp, getting an error: setProvider is not defined?
- Getting an error while deploying smart contracts, Cannot read property 'deployed' of undefined?
- Stuck while passing the the deployed contract address to another contracts constructor
- Signatures different in web3j and web3js?
- web3 encodeFunctionCall does not work (well 2 specific functions calls together in 1 transaction does not work)
- How to reduce Ethereum GasCost when executing multiple sequence of actions within 1 transaction?
- WalletConnect error while integration in ReactJS - Uncaught (in promise) TypeError: this.send is not a function
- I keep getting error when trying to send transaction signed by web3.eth.sign with web3.eth.sendsignedtransaction
Related Questions in ERC20
- How to interact with OpenZeppelin proxy contracts from Truffle console?
- "Returned error: gas required exceeds allowance (123965250) or always failing transaction" when estimating gas for Kyber 'trade' contract function
- how can I set to stop if found any balance in ethereum addresses?
- Metatransaction EIP-712 compliant reverted on Tether USDT Polygon contract
- ERc20 balance is not update when using proxy
- How to query the all time high market cap for an ERC20 contract?
- Unhandled Rejection (Error): call revert exception
- How can I send ERC20 tokens without a gas?
- How to handle approve/allowance when using custom ERC20 token?
- ERC20: insufficient allowance
- PHP web3 ERC20 token function call
- How to Mint ERC1155 with my own ERC20 token
- Adding Liquidity to Pancakeswap in Testnet
- how to add liquidity using smart contract?
- Is smart contract receive, hold and send different kinds of ERC-20 tokens
Related Questions in PANCAKESWAP
- Problem with BSC Token pricing on Pancakeswap
- Adding Liquidity to Pancakeswap in Testnet
- how to add liquidity using smart contract?
- Vercel not rendering or not calling API
- I can't see liquidity of a token in my pancakeswap fork. that has already added liquidity on pancakeswap
- PancakeSwap Contract / Swaping token for another token
- How to get exact value of a token with Web3.py on PancakeSwap? Function getAmountsOut() returns a wrong value
- How to correctly call the API endpoint with Python 3 without getting error 500?
- PancackeswapV2Router swapExactETHForTokensSupportingFeeOnTransferTokens: 'Pancake: TRANSFER_FAILED' when "from" equals to "pancackeSwapV2pair"
- Web3 Python token sell pancakeswap slippage
- swapExactTokensForETHSupportingFeeOnTransferTokens has a path argument, I know I have to put the token's contract address first
- how to buy/sell bsc tokens on pancakeswap from a solidity smart contract?
- How does "bestTradeExactIn" returns value [PancakeSwap frontend]
- How to restrict PancakeSwap users from adding new pair on my new token's LP?
- swapExactETHForTokensSupportingFeeOnTransferTokens makes tokens disappear
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The difference is that the one with the "s" return the series of outputs resulting from a
pathof swaps. Whereas the ones without the "s" return the output for a single swap.So if I swap along the path
["ETHUSDT", "USDTUSDC"]thengetAmountsOutwill return the USDT output amount from the ETHUSDT swap and the USDC output amount from the "USDTUSDC" swap. The returned value will look like:[usdtAmount, usdcAmount].If I swap "ETHUSDT" then getAmountOut will return
usdtAmount.The inverse is true for getAmountsIn/getAmountIn.
It's defined here: https://github.com/pancakeswap/pancake-swap-periphery/blob/master/contracts/libraries/PancakeLibrary.sol#L63