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: inverse rate when clicked #9002

Closed

Conversation

presstab
Copy link
Contributor

Description

It is an industry standard for swappers to be able to inverse a quoted rate to switch the denomination back and forth between basecoin and quotecoin.

For example by default, when I am trading USDC -> FOX, the app displays: 1 USDC = XXX FOX. This is not very helpful, as almost all exchanges will default to denominating a rate in terms of fiat. I need a calculator to actually see the fiat rate that I get.

Clicking on the rate should swap the perspective and show 1 FOX = XXX USDC, which is the human readable form of the quote.

Issue (if applicable)

closes #9001

Risk

Low

High Risk PRs Require 2 approvals

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

Testing

Engineering

Operations

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

Screenshots

rate_toggle

Sorry, something went wrong.

@presstab presstab requested a review from a team as a code owner March 11, 2025 22:40
@0xApotheosis 0xApotheosis self-assigned this Mar 11, 2025
Copy link
Member

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @presstab! Some comments below.

In addition, we'll want to ensure the rate text is not highlightable on click:

Screenshot 2025-03-12 at 10 45 37

https://jam.dev/c/6818d541-ad7e-4bed-9041-9d162f4fdebb

@gomesalexandre
Copy link
Contributor

@presstab can we take a step back on this until #8970 goes in - appreciate the work and speccing an issue for this, but we'll want to make sure this is product stamped and fits nicely with the current work-in-progress in swapper

@presstab
Copy link
Contributor Author

@presstab can we take a step back on this until #8970 goes in - appreciate the work and speccing an issue for this, but we'll want to make sure this is product stamped and fits nicely with the current work-in-progress in swapper

no problem, i will watch for #8970 merge

@NeOMakinG
Copy link
Collaborator

gm @presstab

Thanks a lot for the contrib! I wasn't intended to front run your PR but I definitely had to implement this bit in the limit order PR considering that #8970 would have changed a lot of your logic, which was also invalidating some reviews you already fixed... I've been pragmatic and avoided more back and forth because of my work (mainly due to automatic side changes depending on limit order discriminator asset).

image image

So, this PR can be closed as it's implemented now!

@NeOMakinG NeOMakinG closed this Mar 13, 2025
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.

Click on swapper's displayed rate to inverse base/quote coin perspective.
4 participants