Skip to content
SuperArb Bot

SuperArb Bot

Using Interop to Arb the on-chain economy for a better future

Created on 1st March 2025

•

SuperArb Bot

SuperArb Bot

Using Interop to Arb the on-chain economy for a better future

The problem SuperArb Bot solves

Arbitrage bot that utilizes Superchain interop to profit from price differences across common DEX pools on different chains (e.g., ChainA and ChainB).

User Interaction and Data Flow

Dependencies Setup
Make sure you have foundry and supersim installed in order to run this repository.

To install the necessary dependencies, run:

bun install
The github submodules used have been included in the repo. Cloning the repository will take care of getting the necessary submodules, which are not yet available as published packages.

Steps to Run the Arbitrage Bot
Step 1: Set Up Supersim Fork
Since the interop functionality is not live on mainnet yet, we generate a fork of Supersim to help demonstrate the arbitrage.

Run the following command to start Supersim:

bun run src/scripts/startSupersim.ts
In our example, we use Base and Optimism as the two chains.
The private key used belongs to an account generated from the Supersim deploy.
Additional chains can be added as needed.
This command starts an instance of Supersim fork with:
Forked Chains (Base & Optimism)
Interop and Autorelay Enabled
The flags that you desire to start up Supersim with can be modified in the startSupersim.ts file.
Step 2: Build the contracts
Run the following forge command to build the contracts:

forge build --via-ir
In case of changes to BridgeSwap.sol, the ABI constructed on running forge build will also change.
Please remember to update the BrideSwap.ABI accordingly in that case by getting the ABI from the out folder generated.
Step 3: Deploy ERC20 and BridgeSwap Contracts
bun run src/scripts/setUpEnvironment.ts
Deployment configurations are stored in deploy-config.toml.
You can set the following in the deploy-config.toml file:
chains you want to fork on
unique 'salt' used by CREATE2. We randomly append a number to the salt when running the set up script, to make testing less cumbersome.
owner_address, name, symbol and decimals of the token to be deployed.
Uses Foundry to enable the SuperchainERC20.sol script.
The Create2 mechanism ensures that both the ERC20 and BridgeSwap contracts are deployed at the same address on all chains.
The deployed token address and bridge address are

The project architecture and development process

Same as last answer

Key differentiators and uniqueness of the project

This project showcases the feasibility of Superchain Arbitrage by leveraging the Superchain's interop capabilities. By optimizing deployment, monitoring, and execution strategies, we enable profitable and gas-efficient arbitrage transactions across multiple chains. Future improvements can further enhance profitability and scalability.

Trade-offs and shortcuts while building

In the future we are planning to integrate more DEXs, and implement a more robust risk management system. We also plan to support more complex arbitrage routes.

Tracks Applied (2)

SwapSmart with Superchain Interop

Our project is a clear example of cross-chain swaps powered by Optimism's cross chain messaging functionality.
Optimism

Optimism

INFRASTRUCTURE + SCALABILITY

Our project showcases a core use case of OP stack rollups' novel interop functionality, which relates to scaling and inf...Read More

Discussion

Builders also viewed

See more projects on Devfolio