End-to-end MegaETH development playbook (Feb 2026). Covers wallet operations, token swaps (Kyber Network), eth_sendRawTransactionSync (EIP-7966) for instant receipts, JSON-RPC batching, real-time mini-block subscriptions, storage-aware contract patterns (Solady RedBlackTreeLib), MegaEVM gas model, WebSocket keepalive, bridging from Ethereum, and debugging with mega-evme. Use when building on MegaETH, managing wallets, sending transactions, or deploying contracts.
2. RPC: Multicall for eth_call batching (v2.0.14+)
Prefer Multicall (aggregate3) for batching multiple eth_call requests
As of v2.0.14, eth_call is 2-10x faster; Multicall amortizes per-RPC overhead
Still avoid mixing slow methods (eth_getLogs) with fast ones in same request
Note: Earlier guidance recommended JSON-RPC batching over Multicall for caching benefits. With v2.0.14's performance improvements, Multicall is now preferred.
3. WebSocket: keepalive required
Send eth_chainId every 30 seconds
50 connections per VIP endpoint, 10 subscriptions per connection
Use miniBlocks subscription for real-time data
4. Storage: slot reuse patterns
SSTORE 0→non-zero costs 2M gas × multiplier (expensive)
Use Solady's RedBlackTreeLib instead of Solidity mappings
Design for slot reuse, not constant allocation
5. Gas: skip estimation when possible
Base fee stable at 0.001 gwei, no EIP-1559 adjustment
Ignore eth_maxPriorityFeePerGas (returns 0)
Hardcode gas limits to save round-trip
Always use remote eth_estimateGas (MegaEVM costs differ from standard EVM)