-
Notifications
You must be signed in to change notification settings - Fork 114
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: Add Swap Settings v1 api support #1189
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
let slippagePercentage = params.maxSlippage; | ||
// Adjust slippage for V1 API (aggregator) | ||
// V1 expects slippage in tenths of a percent (e.g., 30 = 3%) | ||
if (params.useAggregator) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't follow, is useAggregator: true
what everyone uses at the moment?
If that so, we should not change this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tl;dr: No one should be using useAggregator: true
There are two different APIs, V1
wallet/swap-service and V2
cloud/swap-router.
V1
:
useAggregator: true
- Expects slippage in tenths of a percent (e.g., 30 = 3%) which is why we must multiply
maxSlippage
by 10 before sending the request.
V2
:
useAggregator: false
- Expects slippage in a percent, which is why we do not have to adjust the
maxSlippage
value.
PartyDOA is the only known customer who is using the maxSlippage
parameter. No other user is using the maxSlippage
parameter, and therefore they are defaulting to a hard coded slippage value of 10%.
I know this is confusing, but we are planning to deprecate the V1 API once we deprecate the experimental
prop.
4a96c04
to
10ce2b1
Compare
3c01a71
to
9be06de
Compare
What changed? Why?
Notes to reviewers
How has it been tested?