MEV-resistant limit orders for Uniswap V4. Encrypt your trades with TEE, stop front-running.
Shadow Orders brings privacy-preserving limit orders to Uniswap V4 by leveraging Inco Network's Lightning SDK with Trusted Execution Environment (TEE) encryption.
Traditional DEX limit orders expose traders to MEV attacks—bots can see pending orders in the mempool and front-run them, causing slippage and losses. Shadow Orders solves this by encrypting order parameters (price, amount, direction) client-side before they hit the blockchain.
Users create limit orders through our Next.js frontend, where order details are encrypted using Inco Lightning TEE. The encrypted orders are stored on-chain via a custom Uniswap V4 hook deployed on Base Sepolia. When market prices reach the target, our keeper network automatically executes swaps—delivering tokens at the exact price users wanted, with zero MEV extraction.
Built on Uniswap V4's revolutionary hooks architecture, Shadow Orders integrates seamlessly with existing liquidity pools while adding a privacy layer that makes front-running impossible. MEV bots can see transactions but cannot decode order parameters, eliminating sandwich attacks and ensuring fair execution for all traders.
Shadow Orders is built with a modern full-stack architecture combining cutting-edge blockchain privacy technology:
Frontend (Next.js 15.5 + React 19): Built with TypeScript and Tailwind CSS for a responsive UI. Uses Wagmi v3.4 and RainbowKit v2.2 for seamless wallet integration. The frontend handles client-side encryption via Inco's Lightning SDK, encrypting order parameters (price, amount, direction) using TEE before blockchain submission. Real-time price tracking integrates CoinGecko API with React Query for caching and live market data simulation.
Smart Contracts (Solidity 0.8.26 + Foundry): The core is ShadowOrdersHook.sol—a custom Uniswap V4 hook that intercepts swap operations via beforeSwap() and afterSwap() callbacks. Orders are stored on-chain with encrypted parameters, making them invisible to MEV bots. The hook integrates directly with Uniswap V4's PoolManager on Base Sepolia (Chain ID 84532), leveraging concentrated liquidity pools while adding privacy guarantees.
Encryption (Inco Lightning + TEE): We chose Inco's Lightning SDK over traditional FHE because TEE offers 100x faster performance with lower gas costs—critical for mainnet viability. The Trusted Execution Environment provides hardware-backed security, ensuring encrypted values remain private throughout the entire order lifecycle. Each order parameter is encrypted separately using encrypt64() and encryptBool() functions.
Keeper Network (Node.js + Viem): A decentralized execution layer monitors OrderTriggered events emitted by the smart contract. When conditions are met, keepers pull tokens from users (via ERC20 approvals), execute swaps through Uniswap V4's PoolSwapTest contract, and transfer output tokens back to users. This trustless design ensures orders execute at target prices without revealing strategy to MEV searchers.
Notable Hacks:
Partner Technologies:
The combination of Uniswap V4's extensibility, Inco's TEE encryption, and Base's L2 efficiency creates a practical privacy solution that works today—not just theoretical cryptography. All code is open source and deployed on testnet for immediate testing.

