Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] OptimalSwap cannot handle pool with very small liquidity #46

Open
bigbangbtc opened this issue Jun 22, 2024 · 0 comments
Open

[BUG] OptimalSwap cannot handle pool with very small liquidity #46

bigbangbtc opened this issue Jun 22, 2024 · 0 comments

Comments

@bigbangbtc
Copy link

Giving the case:
At block number 121687748 in optimism network,
the pool 0x3C01ec09D15D5450FC702DC4353b17Cd2978d8a5 (usdc/susd) of velodrome (a fork of uni v3)
has a small liquidity: 11642027136319108.
The amounts account for the liquidity are:

  • amount0: 8479 usdc (decimal 6)
  • amount1: 575729140021818823 susd(decimal 18)

If I try to add 204503157101251919 susd to the pool, the optimal swap will return 0 amount to swap.

I believe it's the precision cause the problem.
as USDC has 6 decimal, while SUSD has 18 decimals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant