Uniswap / Uniswap/interface

Extremely unbalanced V3 pools get into a bad state in the UI

Open
#6,770 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.5k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Bug Description

Extremely unbalanced V3 pools get into a bad state in the UI which makes it impossible to add liquidity in full range or in the token which is in deficit.

E.g. fUSDC price is 0.000000000000000000000000000000000000002939 per USDC in this pool

https://www.sushi.com/pools/add?chainId=42161&fromCurrency=0x4CFA50B7Ce747e2D61724fcAc57f24B748FF2b2A&toCurrency=0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8&feeAmount=100

I tested against the Uniswap Interface as well wtih the same pool and noticed the same result, ruling out an issue on our end, and making me think this is a bug.

Screenshot_53

It appears that in this edge case which makes it so that you're unabe to add liquidity or rebalance by adding the token which is in deficit, pool.tickCurrent got to -887272 which means pool.tickCurrent === tickLower and the input is ALWAYS disabled without any way to recover.

Expected Behavior
To be able to add the token which is in deficit, in this case USDC.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the linked add-liquidity URL with the extremely unbalanced V3 pool, then trace the UI path where pool.tickCurrent is compared with tickLower and the input becomes disabled. Check the deficit-token and full-range cases, and consider the work complete when liquidity can be added in the deficit token without the input remaining permanently disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.