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

feat: create lbp #605

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft

feat: create lbp #605

wants to merge 15 commits into from

Conversation

mkflow27
Copy link
Contributor

@mkflow27 mkflow27 commented Feb 26, 2025

This feature add lbp creation support to the sdk.

Outstanding:

  • Add more tests around creation
  • Review if new input Validators need to be added due to the removal of the validateCreateInput of the BaseInputValidator.

Copy link
Member

@brunoguerios brunoguerios left a comment

Choose a reason for hiding this comment

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

Overall approach to input validator seems to make sense - I don't think we can do much better than this with how it's currently structured - let's consider a greater refactor in another PR 👍
I left a few comments that should help polish the current implementation a bit.

export type CreatePoolInput =
| CreatePoolV2WeightedInput
| CreatePoolV2ComposableStableInput
| CreatePoolV3WeightedInput
| CreatePoolV3StableInput
| CreatePoolStableSurgeInput;
| CreatePoolStableSurgeInput
| CreateLiquidityBoostrappingPoolInput;
Copy link
Member

Choose a reason for hiding this comment

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

I'd keep the standard:

Suggested change
| CreateLiquidityBoostrappingPoolInput;
| CreatePoolLiquidityBootstrappingInput;

@@ -34,7 +37,9 @@ export class InputValidatorComposableStable extends InputValidatorBase {
}

validateCreatePool(input: CreatePoolV2ComposableStableInput): void {
super.validateCreatePool(input);
validateCreatePoolTokens(input.tokens);
validateCreatePoolTokenConfig(input);
Copy link
Member

Choose a reason for hiding this comment

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

validateCreatePoolTokenConfig seems to be relevant to v3 only and ComposableStable exists only on V2 so you should be able to remove this from here

Comment on lines 69 to 70
| CreatePoolV2WeightedInput
| CreatePoolV2ComposableStableInput
Copy link
Member

Choose a reason for hiding this comment

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

We don't have Boosted pools on V2, so you should be able to remove these 2 options

throw new Error('Start time must be in the future');
}
// tokens cannot be the same
if (input.lbpParams.projectToken === input.lbpParams.reserveToken) {
Copy link
Member

Choose a reason for hiding this comment

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

Please use isSameAddress helper to avoid issues with case sensitive comparisons

Comment on lines 14 to 15
| CreatePoolV2WeightedInput
| CreatePoolV2ComposableStableInput
Copy link
Member

Choose a reason for hiding this comment

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

Same here about removing first 2 options (which are related to V2)

@MattPereira
Copy link
Member

I'm having the same Lint check issues with #570

maybe something to do with that last PR bruno merged? 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Should be no change to the pnpm-lock file.

Copy link
Member

@MattPereira MattPereira Mar 4, 2025

Choose a reason for hiding this comment

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

@mkflow27 I ran into the same lockfileVerison: '9.0' change causing problem with Lint check

The cause was that my machine had pnpm v9.x globally installed

The fix was...

  1. global install of verison that matches our package.json
npm install -g pnpm@8.6.0
  1. revert the lock file back to state of latest commit on main branch
git checkout de8956de -- pnpm-lock.yaml
  1. run install again
pnpm install

@johngrantuk
Copy link
Member

I'm having the same Lint check issues with #570

maybe something to do with that last PR bruno merged? 🤔

I believe its because the pnpm-lockfile is updated with a different version. Reverting that change should fix things.

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.

4 participants