> ## Documentation Index
> Fetch the complete documentation index at: https://docs.biconomy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Chain Orchestration, Explained

> Biconomy uses the Supertransaction Data Model and specialized Relayers to achieve the gold standard of blockchain UX

## The Problem You Know Too Well

You've built an amazing DeFi feature. It works perfectly... in your tests. Then real users try it:

<Steps>
  <Step title="Transaction 1">
    "Please approve spending"
  </Step>

  <Step title="Transaction 2">
    "Now execute the swap"
  </Step>

  <Step title="Fund wallet">
    *Needs to fund wallet with gas on destination chain*
  </Step>

  <Step title="Transaction 3">
    "Approve on the destination chain"
  </Step>

  <Step title="Result">
    **User closes tab**
  </Step>
</Steps>

<Warning>
  A customer lost due to the limitations of current Web3 UX. Biconomy is here to solve it!
</Warning>

## Enter the Modular Execution Environment

MEE is Biconomy's infrastructure that lets you orchestrate complex blockchain operations with a single user signature. Think of it as a transaction compiler - you write high-level intents, MEE handles all the messy blockchain details.

<CodeGroup>
  ```typescript Before MEE theme={null}
  // Multiple transactions, multiple signatures
  await token.approve(spender, amount)  // Sign 1
  await protocol.deposit(amount)         // Sign 2
  await bridge.transfer(chainB, amount)  // Sign 3
  // ... user already left
  ```

  ```typescript With MEE theme={null}
  // One signature, complete flow
  await meeClient.execute({
    instructions: [approveAndDepositAndBridge],
    feeToken: { address: ANY_TOKEN_USER_HAS }  // Even LP tokens!
  })
  ```
</CodeGroup>

## How It Works

MEE operates through a network of orchestrator nodes that:

<Steps>
  <Step title="Accept Signature">
    Accept a single signature from the user
  </Step>

  <Step title="Execute Operations">
    Execute multiple operations across chains
  </Step>

  <Step title="Handle Dependencies">
    Handle all timing and dependencies (bridges, async operations)
  </Step>
</Steps>

<Tip>
  Your users sign once. MEE handles everything else.
</Tip>

## Core Capabilities

### 1. Composable Instructions

Chain operations together like Lego blocks. Each instruction can use outputs from previous ones.

```typescript theme={null}
const instructions = [
  swap(USDC → USDT),              // Output: USDT amount
  deposit(/* uses USDT amount */), // Output: aTokens
  bridge(/* uses aTokens */)       // To another chain
]
```

### 2. Universal Gas Abstraction

Users can pay with **any valuable token** - not just native gas tokens.

<CardGroup cols={2}>
  <Card title="Stablecoins" icon="dollar-sign">
    USDC, USDT, DAI
  </Card>

  <Card title="LP Tokens" icon="water">
    Uniswap/Curve positions
  </Card>

  <Card title="Yield Tokens" icon="chart-line">
    aUSDC, stETH
  </Card>

  <Card title="Any ERC-20" icon="coins">
    Literally any token with value
  </Card>
</CardGroup>

### 3. Cross-Chain Orchestration

Single signature, multiple chains. MEE handles bridge timing, confirmations, and execution.

```typescript theme={null}
// This just works
await meeClient.execute({
  instructions: [
    operationOnOptimism,
    bridgeToBase,
    operationOnBase,
    bridgeToArbitrum,
    finalOperationOnArbitrum
  ]
})
```

### 4. Runtime Parameter Injection

Handle dynamic values that aren't known until execution time.

```typescript theme={null}
supply({
  amount: runtimeERC20BalanceOf({
    token: USDT,
    minBalance: parseUnits('100', 6)  // Safety constraints
  })
})
```

## Why Developers Choose MEE

<Tabs>
  <Tab title="Ship Features, Not Infrastructure">
    * Write business logic in TypeScript
    * No smart contract deployments
    * Update logic without audits
    * Test locally with mainnet forks
  </Tab>

  <Tab title="10x Better DevEx">
    ```typescript theme={null}
    // Old way: 500 lines of Solidity across 3 contracts
    // New way: 50 lines of TypeScript
    const strategy = async (ctx) => {
      await ctx.compose('abi', { /* your logic */ })
    }
    ```
  </Tab>

  <Tab title="Your Users Will Thank You">
    * **Industry leading conversion rates**
    * **One-click everything** (even complex DeFi strategies)
    * **Never "out of gas"** (pay with tokens they have)
    * **Automatic cleanup** (unused funds always returned)
  </Tab>
</Tabs>

## Integration in 5 Minutes

<Steps>
  <Step title="Create account">
    ```typescript theme={null}
    import { createMeeClient, toMultichainNexusAccount, getMEEVersion, MEEVersion } from "@biconomy/abstractjs"

    const account = await toMultichainNexusAccount({
      signer: userWallet,
      chainConfigurations: [
        {
          chain: optimism,
          transport: http(),
          version: getMEEVersion(MEEVersion.V2_1_0)
        },
        {
          chain: base,
          transport: http(),
          version: getMEEVersion(MEEVersion.V2_1_0)
        },
        {
          chain: arbitrum,
          transport: http(),
          version: getMEEVersion(MEEVersion.V2_1_0)
        }
      ],
    })
    ```
  </Step>

  <Step title="Create client">
    ```typescript theme={null}
    const meeClient = await createMeeClient({ account })
    ```
  </Step>

  <Step title="Execute anything">
    ```typescript theme={null}
    const { hash } = await meeClient.execute({
      instructions: [...],  // Your orchestrated flow
      feeToken: { address: USER_PREFERRED_TOKEN }
    })
    ```
  </Step>
</Steps>

## The Bottom Line

<Note>
  Every signature you don't ask for is a user you keep. Every chain boundary you hide is friction removed. Every gas token hunt you eliminate is a transaction completed.
</Note>

MEE isn't just infrastructure - it's how you ship Web3 products that users actually want to use.

<Card title="Ready to give your users superpowers?" icon="bolt" href="/docs/getting-started">
  Get started with MEE in 5 minutes
</Card>
