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

withdrawAndUnstake Missing #165

Open
addiaddiaddi opened this issue May 25, 2023 · 2 comments
Open

withdrawAndUnstake Missing #165

addiaddiaddi opened this issue May 25, 2023 · 2 comments

Comments

@addiaddiaddi
Copy link

addiaddiaddi commented May 25, 2023

Hi, we are currently using curve.js to add liquidity provisioning to our own frontend.

We see that there is a depositAndStake function.

However, we do not see an equivalent unstakeAndWithdraw function. We would like our users to be able to unstake from the gauge and redeem their underlying LP tokens atomically.

Why isn't this included in the library. Oversight? Not possible?

Would it be optimal to add this function to the curve.js package, or create a helper contract to faciliate? Thanks for the help.

@Macket
Copy link
Contributor

Macket commented Aug 1, 2023

I didn't include that because it's impossible to make in 1 tx for most of the pools (or maybe even all, I don't remember). Only 2 txs. Do you think we need it?

@addiaddiaddi
Copy link
Author

Thanks @Macket for the response.

Could you give an example of pools that it works/doesn't for? Why can't it be completed atomically? Is there some time delay? Never really heard of things that can be done in separate transactions that can't be done in one.

It would be helpful for us to have. Saves our users from having to do an additional transaction.

For context, we built our own pool frontend for our LST and have abstracted away the stake component (we only let users depositAndStake). It would be nice to be able to do that on the withdraw side to minimize confusion.

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

2 participants