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: jupiter more accurate price impact #8566

Merged
merged 2 commits into from
Jan 14, 2025
Merged

Conversation

NeOMakinG
Copy link
Collaborator

Description

Jupiter price impact was around 1% but the API provide us the real price impact directly

For this I introduced a new prop to the quote so we can provide the price impact directly to usePriceImpact without doing some handmade maths

Sometimes it shows 0 because it's very small, I think it's acceptable as it clearly says that the impact is very small, but we might want to ask product how it should behave in that particular case? I don't want to add 4 decimals to all the amounts

Issue (if applicable)

Spotted while fixing #8556

Risk

Low

High Risk PRs Require 2 approvals

What protocols, transaction types, wallets or contract interactions might be affected by this PR?

Testing

  • Get some jupiter quote
  • Price impact should be more accurate (most of the time 0.01% on known pairs)

Engineering

n/a

Operations

n/a

  • 🏁 My feature is behind a flag and doesn't require operations testing (yet)

Screenshots (if applicable)

image

@NeOMakinG NeOMakinG requested a review from a team as a code owner January 14, 2025 10:59
Copy link
Contributor

@gomesalexandre gomesalexandre left a comment

Choose a reason for hiding this comment

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

Tested locally, looks a lot more accurate than before, v. nice one ser!

image

@gomesalexandre gomesalexandre merged commit c239295 into develop Jan 14, 2025
3 checks passed
@gomesalexandre gomesalexandre deleted the jup-price-impact branch January 14, 2025 11:58
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