-
Notifications
You must be signed in to change notification settings - Fork 65
feat: calculate swap impact for unsponsored oft/cctp swaps #2106
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
base: master
Are you sure you want to change the base?
feat: calculate swap impact for unsponsored oft/cctp swaps #2106
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Deployment failed with the following error: Learn More: https://vercel.link/3Fpeeb1 |
dohaki
left a comment
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.
This works great for input-amount based swaps 💪 But we need a few more changes for output-amount flows
|
@dohaki Thanks for the review and suggestions! I addressed your comments, used your commit's changes, and also modified the OFT strategy to get the bridge quote after calculating the required input for output based flows. That was missing in my previous revision. Here is the commit with the changes: 5ed9559 The screenshots show a negative swap impact for the OFT flows because I think the USD price for USDC-SPOT is a bit different than what we get for USDT0. |
dohaki
left a comment
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.
Nice 🔥
Backend changes:
simulateMarketOrdercalls to get input/output based quotes for:getTotalFeeUsdfor cctp and oft providers to not directly returnbridgeFeesUsdFrontend changes:
isHyperCoreSwapcondition to display swap impact for:Testing:

Unsponsored USDC to USDT-SPOT: (exact input)
Unsponsored USDC to USDT-SPOT: (min output)

Unsponsored USDT to USDC-SPOT: (exact input)

Unsponsored USDT to USDC-SPOT: (min output)
