-
Notifications
You must be signed in to change notification settings - Fork 65
feat: sponsored cctp strategy evm #1929
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: epic/sponsored-bridging-to-hypercore
Are you sure you want to change the base?
feat: sponsored cctp strategy evm #1929
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| // TODO: Should this always be fast? | ||
| const cctpMode = "fast" as const; |
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.
@melisaguevara Do you know if this should be always fast?
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'm not sure either. We should double check with Niha or Ryan.
| inputAmount: | ||
| crossSwap.type === AMOUNT_TYPE.EXACT_INPUT | ||
| ? bridgeQuote.inputAmount | ||
| : bridgeQuote.inputAmount.add(maxFee), |
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.
Not 100% sure about this for output-amount based flows 🤔 Appreciate some input
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 think we have to use inputAmount because we are already considering the difference caused by the maxFee inside calculateMaxBpsToSponsor.
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.
ok right. so that means we can use the same calculation for input- and output-amount based flows?
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.
Looking good! Left some questions
|
|
||
| export const SPONSORED_CCTP_INPUT_TOKENS = ["USDC"]; | ||
|
|
||
| export const SPONSORED_CCTP_OUTPUT_TOKENS = ["USDC-SPOT", "USDH-SPOT"]; |
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.
Should this be USDC-PERPS?
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.
In this commit I removed the notion of USDS-SPOT like we discussed offline. Lmk what you think 14f2588
| chainId: outputToken.chainId, | ||
| tokenIn: { | ||
| symbol: "USDC", | ||
| decimals: 8, |
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.
Should this be 6? Or could we use the values from inputToken?
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.
My thinking here was that USDC as a spot token on HyperCore always has 8 decimals 🤔 Because inputToken has 6 decimals, I opted to hardcode the 8 decimals here.
But I guess the question is: when we do a swap on HyperCore, will it always be spot-to-spot swap?
| inputAmount: | ||
| crossSwap.type === AMOUNT_TYPE.EXACT_INPUT | ||
| ? bridgeQuote.inputAmount | ||
| : bridgeQuote.inputAmount.add(maxFee), |
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 think we have to use inputAmount because we are already considering the difference caused by the maxFee inside calculateMaxBpsToSponsor.
Closes ACX-4608
Adds support for sponsored CCTP route strategy. The strategy is enabled for Sepolia Arbitrum -> HyperCore Testnet. Here is an example request.
Examples
Below are some test transactions that at least validate that the signatures are correct and the values are correctly set. We can't test the full e2e flow yet though: