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

When {currency} is worth {relative amount}, is the inverse of the correct percent #5414

Open
greenlucid opened this issue Feb 8, 2025 · 5 comments

Comments

@greenlucid
Copy link

Backwards logic on Limit Orders

Image

This should say, when 1 WETH is worth <999%, not
I think the issue comes from the useRatingImpact hook.

I tried digging around and the variable names are not clear, is activeRate the currently active market rate? Or the rate at which the order activates?
Likewise, is marketRate the rate at which the order becomes marketable, or the current market rate?
No comments stating this, I couldn't figure out whether if the mistaken inversion occurred at the hook level. It was also like that before last commit.

@elena-zh
Copy link
Contributor

Hey @greenlucid , could you please fill us in more about the issue you see?

@greenlucid
Copy link
Author

Image

When 1 WETH is worth (+0.9%) should say instead

When 1 WETH is worth (-0.9%)

Because the WETH has to be cheaper for the order to fill.
If it had to wait until the WETH is worth more, then the user would just buy at current market price

Also the color logic should be like, if its - x %, show green, because those are savings. And if its + x %, show red, because the limit order is worse than just buying at current market price

@elena-zh
Copy link
Contributor

Image

When 1 WETH is worth (+0.9%) should say instead

When 1 WETH is worth (-0.9%)

Because the WETH has to be cheaper for the order to fill. If it had to wait until the WETH is worth more, then the user would just buy at current market price

Also the color logic should be like, if its - x %, show green, because those are savings. And if its + x %, show red, because the limit order is worse than just buying at current market price

It says -1.1% when you sell WETH, and a price you filled in is 1,1% less than a current market price ((2600/2629)*100-100)
You will receive less sDAI (by 1.1%) with this price than selling same WETH amount using a market price.
Image

And it says +1.1% when you do an inverted trade selling sDAI: with a price of 2600$ per WETH you will receive more WETH (by 1.1%) than selling same SDAI amount for using a current market price.
Market:

Image

2600$:

Image

Does it make sense?

@greenlucid
Copy link
Author

greenlucid commented Feb 12, 2025

The When 1 WETH is worth ... card shows up in 3rd last position, not 1st position. I'm using swap.cow.fi

And it says +1.1% when you do an inverted trade selling sDAI: with a price of 2600$ per WETH you will receive more WETH (by 1.1%) than selling same SDAI amount for using a current market price.

But that's not what When 1 WETH is worth ... means, in any case, then that would have to be worded similarly to:

"You would get +% WETH at this price"

@elena-zh
Copy link
Contributor

elena-zh commented Feb 12, 2025

The When 1 WETH is worth ... card shows up in 3rd last position, not 1st position. I'm using swap.cow.fi

There is a setting that controls the field's position.

Image

"You would get +% WETH at this price"

Thank you for the details, I will send your feedback to the team.

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

No branches or pull requests

2 participants