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

base liquidity pooler #11

Merged
merged 7 commits into from
Jun 29, 2023
Merged

base liquidity pooler #11

merged 7 commits into from
Jun 29, 2023

Conversation

bekauz
Copy link
Collaborator

@bekauz bekauz commented Jun 22, 2023

Initial pr for #3

  • cleans up interchaintests; deploys and instantiates astroport contracts needed for entering a atom/statom position
  • tidying up cargo files to use workspace

mostly ready to enter the stableswap pool on astroport, but statom is needed for that. that will follow after the LS module is ready.

contracts/lper/src/msg.rs Show resolved Hide resolved
})
.collect();

let provide_liquidity_msg = ProvideLiquidity {
Copy link
Contributor

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),
Copy link
Contributor

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.

@bekauz
Copy link
Collaborator Author

bekauz commented Jun 29, 2023

Merging to reopen feedback in new story after this and base #4 is merged

@bekauz bekauz merged commit 95538ae into main Jun 29, 2023
@bekauz bekauz mentioned this pull request Jun 29, 2023
@bekauz bekauz deleted the benskey/lp branch August 9, 2023 15:59
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.

2 participants