hackquest logo

ShadowBook

Zero MEV • Zero Slippage • Institutional Privacy

Videos

Description

Shadow-Book🛡️ Dark Pool DEX on Arbitrum Stylus

Zero MEV • Zero Slippage • Institutional-Grade Privacy

The Problem

Every time you trade on a DEX, MEV bots are watching. They see your order in the public mempool, sandwich it, and extract 2-5% of your value. This costs traders $500M+ annually — and retail users suffer the most.

Traditional solutions don’t work:

  • AMMs (Uniswap) expose you to price impact and MEV

  • Off-chain orderbooks introduce centralization and trust assumptions

  • On-chain orderbooks in Solidity are impossible — looping through 100 orders costs ~$500 in gas

The Solution

Shadow-Book is an on-chain dark pool powered by Arbitrum Stylus. We write our matching engine in Rust, making it 500x cheaper than Solidity.

Your orders go directly to our Stylus contract — they never touch the public mempool. MEV bots can’t see what they can’t find.


How It Works


Traditional DEX:

User → Public Mempool → MEV Bot Attacks → Execution

Result: You lose 2-5%

Shadow-Book:

User → Stylus Contract (Hidden) → Instant Execution

Result: You lose 0%

  1. Submit Order — Your trade goes directly to the Rust smart contract

  2. Dark Matching — The matching engine scans 150+ orders in <50ms

  3. Atomic Settlement — Trades execute instantly with zero MEV exposure


Key Features

| 🛡️ MEV Protection | Orders hidden from public mempool |

| ⚡ Instant Matching | 150+ orders scanned in <50ms |

| 💰 500x Cheaper | Rust efficiency vs Solidity |

| 🔒 On-Chain Privacy | No trusted relayers or off-chain components |


Tech Stack

  • Smart Contract: Rust + Arbitrum Stylus SDK

  • Frontend: Next.js 16, React, Tailwind CSS, Shadcn/UI

  • Animations: Framer Motion

  • Web3: Wagmi + Viem

  • Network: Arbitrum Stylus Testnet


Why Stylus?

This project is impossible in Solidity. Here’s the key insight:


// In Solidity: This loop costs ~$500 gas, often exceeds block limit

// In Stylus: Same loop costs <$0.01

for order in orders.iter() {

if order.matches(incoming_order) {

execute_swap(order, incoming_order);

}

}

Stylus compiles Rust to WASM, giving us 10-100x gas efficiency. This unlocks on-chain dark pools — a primitive that was architecturally impossible before.


Demo

The live demo shows the contrast between public and dark pool trading:

PUBLIC Mode (Red)

  • Watch MEV bots attack transactions in real-time

  • See your trade get sandwiched

  • Toast notification: “You lost 3.2% to MEV”

SHADOW Mode (Green)

  • Orders fly into an encrypted container

  • Matching animation with particle effects

  • Toast notification: “Matched! MEV Loss: $0.00”

Links


Built for the Arbitrum Stylus Hackathon 2025-2026

Progress During Hackathon

During this hackathon, we built Shadow-Book from the ground up. starting with a formal specification document outlining requirements, architecture, and correctness properties, then implementing a complete Rust smart contract with order submission and O(n²) matching logic, followed by a production-ready Next.js 16 frontend featuring a cyberpunk trading terminal with real-time mempool visualization, MEV attack animations, and Wagmi/Viem wallet integration. The codebase includes 36 property-based tests validating core invariants like order matching, balance consistency, and round-trip serialization. The result is a fully functional demo that visually proves the value proposition: the same trade that loses 2-5% to MEV bots on public DEXs executes with zero loss on Shadow-Book.

Tech Stack

React
Web3
Ethers
WalletConnect
Viem
Shadcn-ui
Solidity
Mev

Fundraising Status

N/A

Team Leader
SSkia Variants
Sector
InfraDeFi