Single Chain: This guide covers single-chain batch execution. The Biconomy stack supports multi-chain batch execution with a single signature as well. Follow this guide to learn how.
Using EIP-7702: This guide focuses on atomic execution from External Wallets though the usage of Fusion Execution. If you’re working with Embedded Wallets - adapt the
toMultichainNexusAccount
, .getQuote
and .execute
steps to work with EIP-7702. Follow the EIP-7702 guide hereWhy Should You Care?
- No ETH required for gas — everything is paid in USDC.
- Lower dropoff in multi-step flows — users only sign once.
- Eliminates complexity — no frontend juggling approvals, swaps, and deposits.
- Business win: better UX, fewer support issues, and higher conversion.
- Full support: Works for all EOA users, including regular MetaMask, Rabby, Trust, etc…
1
Setup
Import all the required dependencies.
2
Create an Orchestrator
An orchestrator is a smart account owned by the user. All instructions are executed on top of this account.
What is Nexus? Nexus is the engine behind composable orchestration and gasless execution. It’s the most gas efficient smart account system.
3
Connect to the Modular Execution Environment (MEE)
Gasless multichain orchestration is enabled by connecting to the Modular Execution Environment. This is a trustless, globally distributed network of Relayer nodes executing instructions on top of smart accounts.
4
Declare Constants
These are the contract addresses we’ll need for this tutorial.
5
Build Instructions
Approve Uniswap
This will encode anERC-20
approve
function which approves the Uniswap contract to spend USDC.Helper Function: This is a helper. You can always encode it manually with
type: "default"
and erc20Abi
if needed.Swap USDC → WETH (Runtime Injection)
Using the.buildComposable
helper, we are encoding a call to the exactInputSingle
function on the Uniswap contract. This will swap USDC for WETH.Note the use of runtimeERC20BalanceOf
in the amountIn
field of the call. This means that we’re not predetermining the amount being swapped - we’ll use whatever is available on the orchestrator account.Runtime injection lets you defer the exact amount to use until execution time — crucial when the actual balance isn’t known upfront.
Approve Morpho
This instruction approves Morpho to spend WETH. Again, note the usage ofruntimeERC20BalanceOf
function. Since we don’t know how much exactly we’ll get from a swap on Uniswap due to slippage - we’re working with runtime values.Another thing to note is the constraints
field. It defines the minimum amount of WETH on the account before the orchestration will proceed with the approve instruction.Deposit WETH into Morpho
Deposit WETH to Morpho. Ordering for this function call depends on two factors:balanceNotZeroConstraint
defines that the instruction can’t be executed until the swap has happened- Implicit Ordering works here as well. The orchestrator will wait until the approval has been set
6
Quote & Execute (Fusion)
Create the Fusion trigger
In order for the orchestrator account to “pull” the funds for orchestration, we must give it an approval to do so. This is done by thetrigger
param. It tells the orchestrator which token on which chain and which amount to approve.Read more about triggersQuote the cost
Execute the flow
7
Confirm Atomic Completion
Checklist Before Production
- Replace
amountOutMinimum: 0n
with real slippage. - Dial in
gasLimit
s to optimize quotes. - Add cleanup
transfer
if leftover tokens aren’t desired. - Monitor quote accuracy vs. actual gas used.