-
Notifications
You must be signed in to change notification settings - Fork 4
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
base liquidity pooler #11
Conversation
}) | ||
.collect(); | ||
|
||
let provide_liquidity_msg = ProvideLiquidity { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is missing a step. You need to first simulate the transaction to know what ratio of ATOM and stATOM you can provide as liquidity. If you provide liquidity in the wrong ratio it will fail.
This is the query you need to run. You can also read more about it here: https://blog.astroport.fi/post/tutorial-how-to-create-a-pair-and-provide-liquidity-on-astroport-using-terra-js
After you get the correct ratio, you can provide the same amount of liquidity. This means that there is a possibility of some left over tokens on one side of the pair. We will then have to do another provide_liquidity call that is single sided (one asset amount is set to 0), which does not require the ratio to match the pool ratio
Additionally, we need to add some tests to test whether our logic works with various ratios of stATOM/ATOM in the pool
let current_state = CONTRACT_STATE.load(deps.storage)?; | ||
|
||
match current_state { | ||
ContractState::Instantiated => try_enter_lp_position(deps, env, info), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are these states getting updated? I'm not seeing where you save the contract state.
Merging to reopen feedback in new story after this and base #4 is merged |
Initial pr for #3
mostly ready to enter the stableswap pool on astroport, but statom is needed for that. that will follow after the LS module is ready.