1

enter image description here

What is the purpose of the quote function and how does it differ from getAmountOut?

1 Answer 1

4

Both functions return the price of asset in an Uniswap pool which has token composition as specified by the reserveA and reserveB (or reserveIn and reserveOut) arguments.

The quote function returns the price without the swap fee, the getAmountOut function includes swap fee.

According to the docs, quote is useful for computing the amounts for minting tokens, getAmountOut for trading.

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.