Skip to content

Conversation

@ashwinrava
Copy link
Member

@ashwinrava ashwinrava commented Dec 15, 2025

Backend changes:

  • Added simulateMarketOrder calls to get input/output based quotes for:
    • Unsponsored USDC to USDT-SPOT
    • Unsponsored USDT to USDC-SPOT
  • Used actual estimated output to calculate accurate swap impact
  • Updated getTotalFeeUsd for cctp and oft providers to not directly return bridgeFeesUsd

Frontend changes:

  • Added isHyperCoreSwap condition to display swap impact for:
    • Unsponsored USDC to USDT-SPOT
    • Unsponsored USDT to USDC-SPOT
  • Removed unsponsored swap flows from restricted routes

Testing:
Unsponsored USDC to USDT-SPOT: (exact input)
Screenshot 2025-12-16 at 12 22 21 PM

Unsponsored USDC to USDT-SPOT: (min output)
Screenshot 2025-12-16 at 12 21 49 PM

Unsponsored USDT to USDC-SPOT: (exact input)
Screenshot 2025-12-16 at 12 23 55 PM

Unsponsored USDT to USDC-SPOT: (min output)
Screenshot 2025-12-16 at 12 24 12 PM

@linear
Copy link

linear bot commented Dec 15, 2025

@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
app-frontend-v3 Ready Ready Preview, Comment Dec 16, 2025 4:37pm
sepolia-frontend-v3 Ready Ready Preview, Comment Dec 16, 2025 4:37pm

@vercel
Copy link

vercel bot commented Dec 15, 2025

Deployment failed with the following error:

Hobby accounts are limited to daily cron jobs. This cron expression (* * * * *) would run more than once per day. Upgrade to the Pro plan to unlock all Cron Jobs features on Vercel.

Learn More: https://vercel.link/3Fpeeb1

@ashwinrava ashwinrava changed the title wip: calculate fees for unsponsored oft/cctp swaps feat: calculate fees for unsponsored oft/cctp swaps Dec 15, 2025
@ashwinrava ashwinrava marked this pull request as ready for review December 15, 2025 22:32
@ashwinrava ashwinrava changed the title feat: calculate fees for unsponsored oft/cctp swaps feat: calculate swap impact for unsponsored oft/cctp swaps Dec 15, 2025
Copy link
Contributor

@dohaki dohaki left a 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

@ashwinrava
Copy link
Member Author

@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.

Copy link
Contributor

@dohaki dohaki left a comment

Choose a reason for hiding this comment

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

Nice 🔥

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.

3 participants