`getAmountsOut` function returns the different value from what the Uniswap front-end shows
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Bug Description
I'm building a small dex platform of my own, and wanna let users know how much they can receive after the trade.
-
First approach
I used getAmountsOut function in the Router contract, but the result was different from what the Uniswap front-end shows. -
Second approach
I gave it a try with bestAmountExactIn function in the Trade contract, but the same value as the one of what getAmountsOut returns
I guess Uniswap itself uses its own SDK under the hood,
But I'm not sure why the result is different.
Can anyone guide me on how I can resolve this issue?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the Router contract's getAmountsOut result and the Trade contract's bestAmountExactIn result with the value shown by the Uniswap front-end. Trace how the front-end obtains its quote and identify the cause of the discrepancy; done means the difference is explained and the reported quote behavior is corrected or documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blockchain, typescript
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100