Skip to content

Conversation

@owen-eth
Copy link
Contributor

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

  • I have added tests that prove my fix is effective or that my feature works
  • I have made corresponding changes to the documentation

@owen-eth owen-eth requested review from aloknerurkar and removed request for aloknerurkar January 27, 2026 00:39
@owen-eth owen-eth changed the title initial fastswap api logic feat: initial fastswap api logic Jan 27, 2026
@owen-eth owen-eth requested a review from aloknerurkar January 27, 2026 00:53
Copy link
Collaborator

@aloknerurkar aloknerurkar left a 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 &ETHSwapResponse{
Copy link
Collaborator

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?

Copy link
Contributor Author

@owen-eth owen-eth Jan 27, 2026

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)

@owen-eth owen-eth requested a review from aloknerurkar January 27, 2026 17:56
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.

4 participants