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: handle positive price impact #5087

Merged
merged 3 commits into from
Aug 17, 2023

Conversation

0xApotheosis
Copy link
Contributor

@0xApotheosis 0xApotheosis commented Aug 16, 2023

Description

  • Handle positive price impacts (receiving a higher dollar amount than your sell amount - rare, but it happens) by not taking the absolute value of the price change %
  • Extracts duplicate logic to a hook

Pull Request Type

  • 🐛 Bug fix (Non-breaking Change: Fixes an issue)
  • 🛠️ Chore (Non-breaking Change: Doc updates, pkg upgrades, typos, etc..)
  • 💅 New Feature (Breaking/Non-breaking Change)

Issue (if applicable)

Closes #5066

Risk

Small

Testing

Get a quote with a positive price impact (at the moment $20 FOX to ETH will do this).

Ensure the price impact warning does not show on either the quote screen or confirm screen.

Engineering

☝️

Operations

☝️

Screenshots (if applicable)

Current prod (sad) state:

Screenshot 2023-08-16 at 1 02 32 pm

@0xApotheosis 0xApotheosis requested a review from a team as a code owner August 16, 2023 03:11
@0xApotheosis
Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

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.

Wasn't able to get price impact to show up on this pair on prod (neither positive nor negative), nor test on THOR which is currently down and the usual offender of high price impacts, but both commits (logic abstraction and positive price impact handling) LGTM, let's get this in

@gomesalexandre gomesalexandre enabled auto-merge (squash) August 17, 2023 16:39
@gomesalexandre gomesalexandre merged commit ae6a880 into develop Aug 17, 2023
3 checks passed
@gomesalexandre gomesalexandre deleted the 08-16-fix_handle_positive_price_impact branch August 17, 2023 16:44
This was referenced Aug 21, 2023
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.

Price impact wrong way round - positive price movement
2 participants