Skip to main content
Runtime injection lets you use values that aren’t known until execution—like token balances after a swap or bridge.

The Problem

Traditional batching requires hardcoded values:

The Solution

Use runtime functions to inject actual values at execution time:

Available Functions

runtimeERC20BalanceOf

Most common—inject token balance at execution:

runtimeNativeBalanceOf

For native token operations:

Constraints

Constraints control when instructions execute and protect against bad values.

Minimum Balance

Non-Zero Check

Transaction Ordering

Constraints determine execution sequence. MEE retries until satisfied:
Flow:
  1. Bridge instruction executes
  2. Swap instruction simulated → fails (no tokens yet)
  3. MEE waits and retries
  4. Bridge completes, tokens arrive
  5. Constraint satisfied → swap executes

Example: Swap and Deposit All

Best Practices

Use for Unknown Values

Swap outputs, bridge results, slippage

Add Constraints

Protect against unexpected states

Sweep Remaining

Transfer leftover tokens back to user

Set Slippage Tolerance

Use greaterThanOrEqualTo with minimum

Summary

Runtime injection turns static transactions into adaptive, state-aware flows that handle:
  • Unknown swap outputs
  • Bridge timing
  • Slippage protection
  • Automatic sequencing
No more guessing values or stuck transactions.