Skip to main content
Magicblock’s Magic Router is an dynamic transaction routing engine that accelerates transactions by intelligently deciding where they should be executed — either on Ephemeral Rollups or Solana — based on transaction metadata. This eliminates the need for manual routing logic from the developer, providing significant benefits in transaction speed and development experience.
  • Simple Integration with Single Endpoint: Just connect to a single RPC endpoint.
  • Seamless Wallet Experience: Connect, sign, and submit — no need to know what’s happening behind the scenes.
  • Faster Confirmations: Magic Router routes to the fastest available endpoint.

Examples

import { sendAndConfirmTransaction } from "@solana/web3.js";
import { ConnectionMagicRouter } from "@magicblock-labs/ephemeral-rollups-sdk";

const connection = new ConnectionMagicRouter(
  "https://devnet-router.magicblock.app/",
  { wsEndpoint: "wss://devnet-router.magicblock.app/" }
);
let tx = new Transaction();
tx.add(ix);
const txHash = await sendAndConfirmTransaction(connection, tx, [payer], {
  skipPreflight: true,
  commitment: "confirmed",
});

Dynamic Transaction Routing

These public RPC endpoints are currently free and supported for development:
Magic Router Devnet: https://devnet-router.magicblock.app
Solana Devnet: https://api.devnet.solana.com
ER Devnet: https://devnet.magicblock.app
TEE Devnet (test): https://tee.magicblock.app/
The Magic Router analyzes each transaction’s metadata (e.g. writable accounts, owner, and signer) and automatically routes it to the closest dedicated endpoint:
  1. Client - Transaction Submission The dApp or user sends a transaction to the Magic Router RPC endpoint.
  2. RPC - Metadata Inspection The Magic Router inspects the transaction metadata and checks the owner of writable accounts.
  3. Validator - Smart Routing and Execution Based on the metadata, the router determines whether to send it to:
    • Ephemeral Rollup for fast, low-latency, zero-cost execution
    • Solana for persistent, high-throughput execution
I