Skip to main content
Let’s take a look at a real-world scenario where our Gelato Smart Wallet (EIP-7702) and it’s batching transactions feature streamlines interactions while also helping prevent malicious activity.

DeFi Vault Deployment

When deploying a new customer vault on Uniswap V4/PancakeSwap V4, you need to execute three critical operations atomically:
  1. Initialize a new pool for the customer tokens
  2. Update your vault/module to use that new pool
  3. Execute a rebalance to deposit the tokens
The challenge is that these operations must happen atomically to prevent front-running attacks where bots move pool prices to unfavorable positions during the time gap between operations. Using a smart wallet with batched transactions ensures all operations execute in a single atomic transaction with the correct msg.sender. Here’s a quick guide on how to batch transactions using Gelato Smart Wallets for such use cases.

Batching Transactions

You can batch multiple transactions to be sent on-chain at once by adding them to the calls array:
This approach prevents front-running by ensuring all operations execute atomically, eliminating the time gap where bots could manipulate pool prices.

Summary

You get the security of atomic execution and the efficiency of smart wallets — without the complexity of managing multiple transactions or the risk of front-running attacks.