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

fix(cpmm-add-liquidity): the deposits will fail in any sol pool if invariant changes #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SushantChandla
Copy link

@SushantChandla SushantChandla commented Nov 7, 2024

I noticed that in the implementation when converting sol to wsol, we only convert anotherAmount variable, but it is possible that in invariant changes. In that case, if anotherAmount is slightly smaller than the amount needed for the deposit, the instruction on the smart contract side will cause failure with the error Insufficient balance.

It is more ideal that in the computePairAmount the slippage is also passed(right now its passed as 0) and then the amount calculate will be more correct.

…variant changes

I noticed that in the implementation when converting sol to wsol, we only convert anotherAmount variable, but it is possible that in invariant changes. In that case, if `anotherAmount` is slightly smaller than the amount needed for the deposit, the instruction on the smart contract side will cause failure with the error Insufficient balance.

It is more ideal that in the computePairAmount the slippage is also passed(right now its passed as 0) and then the amount calculate will be more correct.
@SushantChandla SushantChandla changed the title fix(cpmm-add-liquidity): the deposits will fail in any sol pool if in… fix(cpmm-add-liquidity): the deposits will fail in any sol pool if invariant changes Nov 7, 2024
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

Successfully merging this pull request may close these issues.

1 participant