A state-sharded order matching engine that settles hundreds of orders per block across isolated price ticks — proving Monad's parallel execution isn't theoretical, it's measurable.
┌─────────────────────────────────────────────────────┐
│ FlashGrid │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Tick 0.10│ │ Tick 0.25│ │ Tick 0.50│ ... │ ← Each tick = isolated state
│ │ [orders] │ │ [orders] │ │ [orders] │ │ No storage conflicts
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ Monad executes in parallel
│ │ │ │ │
│ ▼ ▼ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ BatchSettlement.sol │ │
│ │ Epoch-based: collect → match → settle │ │
│ └─────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌─────────────────────────────────────────┐ │
│ │ Events → Indexer → Dashboard │ │
│ │ Real-time parallel execution metrics │ │
│ └─────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────┘
Monad's parallel execution engine detects storage slot conflicts at runtime. If two transactions touch the same slot, one re-executes.
- Traditional AMM: Every swap touches the same
reserve0/reserve1slots → serial execution - FlashGrid: Orders at tick
0.10write tomapping(uint8 => TickState)[10], orders at tick0.50write to...[50]→ zero conflicts → full parallelism
The dashboard is built to make Monad's parallel execution visible in real time, not just claim it in a benchmark table.
- Light, Apple-inspired UI with a neutral palette for long demo sessions
- Live order feed showing recent on-chain order placement as it lands
- Canvas heatmap showing liquidity concentration across isolated price ticks
- Metrics and comparison charts that make the sharded-vs-sequential story obvious
- One-click demo mode for judges who want to see the full flow without funding a wallet
The redesigned dashboard lives in dashboard/ and talks directly to Monad testnet through the app API routes.
- Node.js 18+
- Foundry (for contract compilation/testing)
- Monad testnet MON from faucet.monad.xyz
# Clone the repo
git clone <repo-url>
cd flashgrid
# Install dashboard dependencies
cd dashboard && npm install && cd ..
# Install script dependencies
cd scripts && npm install && cd ..
# Install Foundry deps
cd contracts && forge install && cd ..# Copy env example
cp .env.example .env
# Edit .env with your private key and contract addressescd contracts
forge build
forge test -vvvcd contracts
forge script script/Deploy.s.sol --rpc-url https://testnet-rpc.monad.xyz --broadcastUpdate .env and dashboard/.env.local with deployed addresses.
cd scripts
# Fund test wallets
npx tsx fund-wallets.ts
# Run FlashGrid load test
npx tsx load-test.ts sharded
# Run comparison (sharded vs sequential)
npx tsx compare.tscd dashboard
npm run devflashgrid/
├── contracts/
│ ├── src/
│ │ ├── FlashGrid.sol # Core engine (~130 LOC)
│ │ ├── FlashGridFactory.sol # Market deployer (~40 LOC)
│ │ └── ParallelBenchmark.sol # Sequential baseline (~30 LOC)
│ ├── test/
│ │ └── FlashGrid.t.sol # Foundry tests
│ ├── script/
│ │ └── Deploy.s.sol # Deployment script
│ └── foundry.toml
├── scripts/
│ ├── load-test.ts # 200-wallet parallel load test
│ ├── fund-wallets.ts # Batch fund test wallets
│ └── compare.ts # Run both tests + format results
├── dashboard/
│ ├── app/
│ │ ├── page.tsx # Main 4-panel dashboard
│ │ └── api/ # Event indexer API routes
│ ├── components/
│ │ ├── Heatmap.tsx # Order book heatmap (canvas)
│ │ ├── OrderFeed.tsx # Live event stream
│ │ ├── MetricsPanel.tsx # Execution gauges + charts
│ │ └── ParallelChart.tsx # Before/after comparison
│ └── lib/
│ ├── contract.ts # ABI + addresses
│ ├── indexer.ts # Event polling + in-memory store
│ └── types.ts # Shared types
└── plan.md
| Contract | Purpose | Key Feature |
|---|---|---|
FlashGrid.sol |
Core order matching engine | 20 isolated tick storage slots |
FlashGridFactory.sol |
Market deployer | CREATE2 deterministic deployment |
ParallelBenchmark.sol |
Sequential baseline | Single-slot bottleneck for comparison |
| Function | Gas Target | Parallelism |
|---|---|---|
deposit() |
~25k | Touches only balances[msg.sender] |
placeOrder(tick, amount, isYes) |
~45k | Touches only ticks[tick] + tickOrders[tick] |
settleTick(tick) |
~80k | Touches only that tick's state |
settleAll() |
Loops | Calls settleTick per tick — each parallelizable |
| Layer | Technology |
|---|---|
| Contracts | Solidity 0.8.24 + Foundry |
| Frontend | Next.js 15 + Tailwind + Recharts |
| Chain Interaction | viem |
| Indexer | Next.js API routes + in-memory cache |
| Load Testing | Custom TS scripts with viem |
| Network | Monad Testnet |
| RPC | https://testnet-rpc.monad.xyz |
| Chain ID | 10143 |
| Symbol | MON |
| Explorer | https://testnet.monadvision.com |
| Faucet | https://faucet.monad.xyz |
MIT