Open Sourcing our MEV Launchpad: Multiplexer

Apr 25, 2025 | Bitfinding Team

Trying to nail that perfect arbitrage, execute a complex multi-step DeFi strategy, or even simulate a frontrunning attack often means wrestling with multiple transactions, timing risks, and callback hell.

We faced these challenges constantly while intercepting attacks at Bitfinding. That's why we created Multiplexer, our internal engine for crafting powerful, precise, atomic Ethereum operations. Today, we're proud to open source it for everyone.

👉 github.com/Bitfinding/multiplexer

What does Multiplexer actually do?

Think of Multiplexer as multicall on steroids. It's a smart contract that acts like a mini virtual machine executing a list of instructions you provide. You can pack an incredible amount into one transaction:

🔗 Batch calls (CALL, DELEGATECALL) to interact with any contract.

🚀 Deploy new contracts (CREATE) that can be used in the same transaction.

Handle Flash Loans from providers like Morpho and Aave, including managing the required callbacks seamlessly.

Let's See It: Flash Loan Arbitrage Example

Imagine you want to perform a flash loan arbitrage using Morpho. With Multiplexer and our Rust FlowBuilder tool, the setup becomes much clearer:

// Simplified FlowBuilder example

// Define the steps inside the flash loan callback
let inner_arbitrage_flow = FlowBuilder::empty()
    // 1. Swap Token A for Token B on DEX 1
    // 2. Swap Token B for Token A on DEX 2
    .optimize().build_raw();

// Prepare the main flash loan call, embedding the arbitrage logic
let flashloan_calldata = IMorpho::flashLoanCall {
    token: WETH9, assets: LOAN_AMOUNT, data: inner_arbitrage_flow.into(),
}.abi_encode();

// Build the main transaction flow
let main_flow = FlowBuilder::empty()
    .set_fail() // Ensure atomicity
    .set_callback(MORPHO) // Specify expected callback sender
    // Optional: Approve necessary tokens first if needed
    .call(WETH9, &approve_calldata, ...)
    // Trigger the flash loan; Morpho executes inner_arbitrage_flow on callback
    .call(MORPHO, &flashloan_calldata, ...)
    .optimize().build();

// Send transaction with `main_flow` calldata to the Multiplexer contract.

Notice how Multiplexer handles the callback routing? You define the logic (inner_arbitrage_flow) and tell Multiplexer to expect Morpho's call. No custom callback handler needed in your main execution flow.

For the full example, check the README of the crate here.

What Else Can You Build With It?

Multiplexer is incredibly versatile:

🤖 Efficient Automation: Batch ERC-4337 UserOperations or fulfill complex Intents.

🔬 MEV & Security Research: Model sophisticated interactions or potential exploits.

🧩 Complex DeFi Strategies: Execute multi-step yield farming, collateral swaps, or liquidity migrations atomically.

🛡️ Battle-tested: Used internally at Bitfinding for intercepting exploits and executing complex rescue operations.

Get Started Now

Ready to build more powerful transactions? Don't forget to brace for EIP-7702!

🐙 Main Repo: github.com/Bitfinding/multiplexer

📦 Rust Crate: crates.io/crates/multiplexer-evm

Contains:

    * Solidity contract

    * Flow-builder for easy transaction construction

    * Examples and tests using Morpho, Aave, Uniswap.

Multiplexer has been a game-changer for our internal operations, giving us speed and precision. We're open-sourcing it because we believe these capabilities should be accessible to all builders pushing the boundaries of DeFi and MEV. We also think this is the right timing for teams tackling the challenges that enable the upcoming EIP-7702.

We can't wait to see what you create. Share your projects, ask questions, or contribute! Find us on Twitter.

Contact Us

Bitfinding © 2025.Bitfinding logo