-
Notifications
You must be signed in to change notification settings - Fork 432
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: quote provider has the enable fot flag awareness #399
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mikeki
reviewed
Sep 14, 2023
mikeki
approved these changes
Sep 14, 2023
jsy1218
force-pushed
the
jsy1218/quote-provider-have-enable-fot-flag
branch
from
September 14, 2023 23:32
e9f3fd7
to
8c89735
Compare
jsy1218
commented
Sep 14, 2023
jsy1218
changed the title
Quote provider has the enable fot flag awareness
Fix: quote provider has the enable fot flag awareness
Sep 15, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Big fix
What is the current behavior? (You can also link to an open issue here)
There's a bug in the FOT quote and routes calculation path, so that it would cause interface to double quote FOT tax immediately, if we ship Feature: Routing-api support for FOT quote routing-api#362 today.
Let's use BULLET => WETH as an example. Hypothetically interface will issue two requests:
The problem is in (2), interface has no awareness that the quote and routes are from cached routes, and they have the hardcoded FOT tax logic in prod today https://github.com/Uniswap/interface/blob/main/src/hooks/useSwapTaxes.ts. Since smart-order-router also quoted with FOT tax in quote-provider, this is effectively double FOT taxation in prod, before we enable FOT backend support to 100%. And since cached routes hit rate is over +80%, this bug is considered a blocker before we ship Uniswap/routing-api#362.
What is the new behavior (if this is a feature change)?
Quote provider doesn't calculate FOT tax. As such because it also doesn't pass the FOT tax to the
outputAmount
/inputAmount
, the routes returned from routing-api will not include the FOT tax in both token construct as well as theoutputAmount
/inputAmount
.Other information: