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

Create a helper function for creating splash pools #198

Merged
merged 7 commits into from
Aug 14, 2024

Conversation

wjthieme
Copy link
Member

Add a helper function for creating splash pools. Some people have complained that it is not clear how to create a splash pool from the UI. This PR is a short term solution for this. In v2 sdk we should think of a better way to set this up and make the devex better

@wjthieme wjthieme requested a review from odcheung August 12, 2024 18:26
@wjthieme wjthieme self-assigned this Aug 12, 2024
@wjthieme wjthieme requested a review from yugure-orca as a code owner August 12, 2024 18:26
* @return `poolKey`: The public key of the newly created whirlpool account. `tx`: The transaction containing instructions for the on-chain operations.
* @throws error when the tokens are not in the canonical byte-based ordering. To resolve this, invert the token order and the initialTick (see `TickUtil.invertTick()`, `PriceMath.invertSqrtPriceX64()`, or `PriceMath.invertPrice()`).
*/
createSplashPool: (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to match CPMM, we need to hide the "tick" & "tick-array" concepts from the dev.

  • this method sets the initial price to some default (ex $1)
  • creates both tick-arrays in a splash-pool in the same call (createPool only creates 1 of them)

Copy link
Member Author

@wjthieme wjthieme Aug 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. I assume it would be better to still be able to set initial price though instead of some default

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have it as an optional?

Copy link
Member Author

@wjthieme wjthieme Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 B/A as the default?

@wjthieme wjthieme requested a review from odcheung August 12, 2024 19:54
Copy link
Collaborator

@odcheung odcheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! I think we should make iniPrice as an optional parameter to mimic the full CPMM experience. approved otherwise

* @return `poolKey`: The public key of the newly created whirlpool account. `tx`: The transaction containing instructions for the on-chain operations.
* @throws error when the tokens are not in the canonical byte-based ordering. To resolve this, invert the token order and the initialTick (see `TickUtil.invertTick()`, `PriceMath.invertSqrtPriceX64()`, or `PriceMath.invertPrice()`).
*/
createSplashPool: (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have it as an optional?

@wjthieme wjthieme merged commit 0c8f482 into main Aug 14, 2024
4 checks passed
@wjthieme wjthieme deleted the wjthieme/splash-pool-creation-helper branch August 14, 2024 15:13
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