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

Gradual Add/Remove Liquidity #802

Open
green-jay opened this issue Apr 15, 2024 · 2 comments
Open

Gradual Add/Remove Liquidity #802

green-jay opened this issue Apr 15, 2024 · 2 comments

Comments

@green-jay
Copy link
Contributor

green-jay commented Apr 15, 2024

Problem statement:
The circuit breaker limits amount of added/removed liquidity in one block. This can be a limiting factor for entities wanting to Add/Remove higher $ values as it needs to be spread on the way in/out into many transactions and smaller chunks. This has to be currently a manual action, which is tedious and complicated in some setups like multisigs.

Goals:
Ideally users would be able to send just 1 transaction to Add/Remove any amount and the chain will take care of successful execution.

Potential ways to address this problem:

  • using system scheduler
  • special extrinsic that would add/remove liquidity gradually
    • something like dca for LP positions
    • or intention with off chain worker
  • just introduce delay
@spazcoin
Copy link

After discord discussion, my suggestions/requests are:

  1. Allow all accounts to use the scheduler pallet so that other chains can remotely use XCM calls to schedule operations on Hydra. Critical for treasuries to manage their large deposits without requiring Hydra governance involvement or multiple referenda.
  2. On the account liquidity page, if there are multiple LP positions for a single token then allow a user to visualize the aggregate value or drill down to see details for each individual NFT position.

I know that add/remove liquidity were a security concern, and allowing broad use of scheduler or @jgreen's suggestion to create a special extrinsic for gradually addition seems to be circumventing it. What if add/remove liquidity limits were applied on a longer timespan than one block, or a limit per every 4 hours? I think Treasuries would be ok with slowly depositing large batches of tokens over a period of days or a week, and it allows enough time for chain monitoring to alert the team to an attack.

@jak-pan
Copy link
Contributor

jak-pan commented May 16, 2024

While we are at this. We should also solve the 1% slippage problem. Users currently need to wait if the price is volatile to exit the pool. We could include this in the gradual add / remove.

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

3 participants