-
Notifications
You must be signed in to change notification settings - Fork 20
feat: initial fastswap api logic #878
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: main
Are you sure you want to change the base?
Conversation
aloknerurkar
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 work. Overall structure is good, comments are mostly minor.
| "gasLimit", gasLimit, | ||
| ) | ||
|
|
||
| return ÐSwapResponse{ |
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.
So we return the calldata and not enqueue the txn? Is this like some estimation request?
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.
When a user wants to swap using ETH we take the request, create the unsigned tx, then return it to the dapp for them to sign and submit since they are the ones executing tx in this case. (We submit ourselves for other inputs)
Describe your changes
Adds two endpoints for FastSettlementV3 swap execution via Barter API integration:
/fastswap (Path 1 - Executor Submission for standard intent flow)
For ERC20→token swaps using Permit2 signatures.
-User signs intent off-chain with Permit2
-Request includes intent + signature
-Executor calls Barter API for optimal swap route
-Executor builds, signs, and submits executeWithPermit tx
-Returns tx hash
/fastswap/eth (User Submission)
For native ETH→token swaps where user must submit their own tx with ETH value.
-User requests swap quote with ETH amount + output token
-Server calls Barter API for route (using WETH internally)
-Returns unsigned executeWithETH calldata + gas estimate
-User signs and submits tx themselves
New flags:
--barter-api-url / --barter-api-key - Barter routing API
--fast-settlement-address - FastSettlementV3 contract
--fastswap-keystore-path - Separate executor wallet (For Path 1)
Issue ticket number and link
Fixes # (issue)
Checklist before requesting a review