Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

feat: update block remove liquidity #1125

Merged
merged 9 commits into from
Oct 3, 2024

Conversation

groninge01
Copy link
Collaborator

@groninge01 groninge01 commented Sep 25, 2024

fixes #1096

  • block remove liquidity when single asset withdraw is >25% of pool balance

Note: I added the warning as a disabledReason first so I created a TooltipWithTouch component to get the tooltips to show on mobile. However PK asked me to move the warning msg closer to the input but still keep the tooltips available on mobile in the remove-liquidity flow. So keep that change here or take it out and do another PR for it?

Copy link

vercel bot commented Sep 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2024 2:54pm
test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2024 2:54pm

Copy link
Contributor

@agualis agualis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm testing pools/mode/v2/0x7c86a44778c52a0aad17860924b53bf3f35dc932000200000000000000000007/remove-liquidity
impersonated with 0x652AB9e3577eD85d7fC9A41fAFf68E9DA4Db00Ff

Going to single token shows the 25% warning but still shows an error:
Screenshot 2024-09-26 at 10 48 39

We should avoid running the priceImpact and simulation if the 25% condition is true.

@groninge01 groninge01 marked this pull request as draft September 30, 2024 08:02
@groninge01
Copy link
Collaborator Author

I'm testing pools/mode/v2/0x7c86a44778c52a0aad17860924b53bf3f35dc932000200000000000000000007/remove-liquidity impersonated with 0x652AB9e3577eD85d7fC9A41fAFf68E9DA4Db00Ff

Going to single token shows the 25% warning but still shows an error: Screenshot 2024-09-26 at 10 48 39

We should avoid running the priceImpact and simulation if the 25% condition is true.

  • disabled both queries while the condition is true
  • show the user's wallet balance (in ratio w/ the percentage) while the condition is true

@agualis
Copy link
Contributor

agualis commented Oct 3, 2024

I'm testing pools/mode/v2/0x7c86a44778c52a0aad17860924b53bf3f35dc932000200000000000000000007/remove-liquidity impersonated with 0x652AB9e3577eD85d7fC9A41fAFf68E9DA4Db00Ff

Tested again with the same pool/user. Now it works as expected but we are still getting some BAL#306 errors in price impact query when moving the slider to less than 25%.

Bal306Error

@groninge01 groninge01 merged commit 25330fb into main Oct 3, 2024
6 of 7 checks passed
@groninge01 groninge01 deleted the feat/update-block-remove-liquidity branch October 3, 2024 14:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable single exits for low liquidity pools
2 participants