What is the purpose of the quote function and how does it differ from getAmountOut?
1 Answer
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.