Integration Flow
All Bungee integrations follow the four key steps below. For detailed API specifications, see the API Reference.1. Get a quote
Request a quote from the/bungee/quote endpoint to receive available routes, fee estimates, and transaction data for your token swap.
2. Handle token approvals
For ERC20 tokens only:- Auto Mode: Uses Permit2 for gasless approvals (Permit2 tx data is provided in the quote response)
- Manual Mode: Requires standard ERC20 approval transaction (approval transaction data is provided in the quote response and execution data in the build-tx response)
3. Submit the transaction (onchain or gasless)
Auto ERC20 Sign the Permit2 typed data and submit it offchain via/bungee/submit endpoint
See submit onchain requests to get the transaction data in the quote response and submit ERC20 requests onchain
- Transaction data is provided in the quote response
- Submit the request onchain to the Inbox Contract
/bungee/build-tx endpoint and submit onchain
4. Monitor the transaction status
Use the/bungee/status API endpoint to track the status of your transaction until completion.
Submit requests with Permit2
Integrate Bungee with Permit2 for ERC20 tokens
Submit requests onchain
Integrate Bungee with the Inbox Contract
Submission Methods
Bungee Auto requests can be submitted in two ways. Use this table to decide which one fits your needs:| Requirement | Recommended Flow | Why? |
|---|---|---|
| ERC20 Tokens | Permit2 (Gasless) | Better UX, no gas for approvals, one-time signature. |
| Native Tokens | Inbox Contract (Onchain) | Native tokens (ETH, POL) cannot be approved, must be sent onchain. |
| Smart Contract Wallets | Inbox Contract (Onchain) | Unless the wallet supports EIP-1271 signatures, use the onchain fallback. |
Gasless request with Permit2
This method uses the Bungee Auto API with Permit2 for gasless approvals:- Get a quote from the Bungee API
- Create a request via the API
- Approve Permit2 contract if needed
- Sign a Permit2 message
- Submit the request with the signature
- Monitor the status via the API
Inbox Contract
This method uses the Bungee Auto inbox contract to directly submit the request onchain:- Get a quote from the Bungee API
- Create and submit a request onchain via Inbox contract
- Monitor the status via the API