Orchestrate the
Real-Time World.
MegaFlow enables sub-10ms atomic transaction flows on MegaETH. Bundle complex multi-step on-chain operations into a single transaction — all-or-nothing, no partial failures, no race conditions.
Stop waiting for
sequential confirmations.
Bundle everything. Execute once. Every operation succeeds together or reverts together — atomically.
How a MegaFlow executes
From SDK call to on-chain receipt — every step runs atomically through the MegaRouter contract.
client.batch().approve() .swap().executeSync()
Dry-run preflight — validates all calls, no gas consumed
eth_sendRawTransactionSync (EIP-7966)
Dispatches all calls atomically via tstore — all-or-nothing
Instant on-chain confirmation — <10ms finality
Built by developers,
for developers.
Chainable, type-safe, zero-config. Ship production flows without touching raw ABI encoding.
npm install @megaflow-labs/sdkWhat will you flow?
Any multi-step on-chain logic — DeFi, NFTs, gaming, governance — reduced to one transaction.
Flash Arbitrage
Borrow flash liquidity, execute multi-DEX arbitrage across Uniswap V2 pools, and repay in a single atomic transaction. No capital locked, no partial execution risk.
Yield Stack Rebalance
Unwind your position across Aave, claim rewards, swap to a new asset, redeposit — all in less than 10ms without any intermediate state where you could be liquidated.
NFT Mint + LP
Mint an NFT during a whitelist phase and simultaneously provide liquidity with the remaining ETH — all gated behind a single signature from your wallet.
Everything you need, nothing you don't.
Six foundational primitives, composable into any on-chain workflow.
Atomic Execution
Every operation in your batch either succeeds together or reverts together. No stuck transactions. No partial state. Pure atomicity.
.batch().approve().swap().execute()Real-Time Receipts
Leverage MegaETH's native eth_sendRawTransactionSync. Get instant, provable transaction receipts without polling — in under 10ms.
.executeSync() // receipt in <10msZero Storage Overhead
MegaRouter uses transient storage (tstore) for reentrancy protection — eliminating SSTORE costs and matching MegaETH's gas model.
tstore(LOCK_SLOT, 1) // zero-costType-Safe API
Chainable, viem-native API with complete TypeScript definitions. Autocomplete for every method, parameter, and return type.
client.batch() // fully typed ✓Zero Config
MegaFlowClient.fromPrivateKey() — that's it. The SDK ships with the deployed MegaRouter address and chain config baked in.
fromPrivateKey('0x...') // doneKyberSwap Aggregator
Built-in KyberSwap routing finds the best path across all MegaETH liquidity, composable within any batch operation.
await .kyberSwap(params, sender)Start in 30 seconds.
Ship tomorrow.
One npm install. One import. Atomic multi-step transactions on MegaETH — no viem setup, no wallet config, no partial failures.
import { MegaFlowClient, parseUnits } from '@megaflow-labs/sdk'; // Zero-config — fromPrivateKey() handles account setup const client = MegaFlowClient.fromPrivateKey('0xYOUR_KEY'); // Read on-chain state const allowance = await client.getAllowance(USDC, client.address!, DEX); // Build + execute atomically const result = await client .batch() .safeApprove(USDC, DEX, parseUnits('100', 6), allowance) .swapExactTokensForTokens({ ... }) .executeSync(); // instant receipt on MegaETH