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 price impact with near proportional inputs for AddLiquidityNested #526

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

brunoguerios
Copy link
Member

@brunoguerios brunoguerios commented Dec 9, 2024

Close #525

Main:

  • Move try/catch handler to inner Price Impact function so it covers other places where it's used

Other:

  • Bump sepolia global blockNumber
  • Remove hardcoded amounts from Price Impact integration tests (we'll need to find a better approach)

@brunoguerios brunoguerios self-assigned this Dec 9, 2024
@brunoguerios brunoguerios changed the title Fix price impact nested pools Fix price impact with near proportional inputs for AddLiquidityNested Dec 9, 2024
@@ -61,8 +58,7 @@ describe('PriceImpact V3', () => {
addLiquidityInput,
boostedPool_USDC_USDT,
);
const priceImpactSpot = PriceImpactAmount.fromDecimal('0.000057');
expect(priceImpactABA.decimal).eq(priceImpactSpot.decimal);
expect(priceImpactABA.decimal).greaterThan(0);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use a range here so that we at least check its within a reasonable result?

Copy link
Member

@johngrantuk johngrantuk left a comment

Choose a reason for hiding this comment

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

LGTM

@brunoguerios brunoguerios merged commit c156833 into main Dec 10, 2024
4 checks passed
@brunoguerios brunoguerios deleted the fix-price-impact-nested-pools branch December 10, 2024 14:19
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.

Fix PriceImpact issues for nestedPools
2 participants