MEGA QUANT
Quantitative Trading Platform with Native Uniswap V4 Hooks
UHISwap Hookathon 2025 | Deployed on Unichain Sepolia
THE PROBLEM
!
No Advanced Orders On-Chain
DEX traders lack limit orders, stop-losses, and bracket orders — forced to watch markets 24/7 or use centralized alternatives.
%
LP Losses During Volatility
Liquidity providers suffer impermanent loss with static fee models that don't adapt to market conditions.
~
Fragmented Trading Tools
Quants juggle multiple platforms for DeFi, CEX, lending, and derivatives — no unified strategy execution layer.
ON-CHAIN HOOK FEATURES
MegaQuantHook.sol — Deployed on Unichain Sepolia
EWMA Dynamic Fees
Auto-adjusts swap fees (0.05% – 1.0%) based on exponentially weighted moving average of volatility. Protects LPs during turbulent markets.
On-Chain Limit Orders
Deposit tokens → receive ERC1155 claim tokens → auto-execute when price crosses target tick via afterSwap(). No keepers required.
Stop-Loss Orders
Trigger in the same direction as price movement. Auto-liquidate positions if price falls below threshold — fully atomic on-chain.
Bracket / OCO Orders
Linked take-profit + stop-loss pairs. One-Cancels-Other: when one fills, the partner is automatically cancelled on-chain.
ARCHITECTURE
</>
Desktop App
{*}
Backend Engine
[#]
Smart Contracts
Uniswap V4 · Uniswap V3 · 1inch · Aave V3 · Binance Spot/Futures/Options
DEPLOYED ON UNICHAIN
Unichain Sepolia · Chain ID 1301 · Live & Verified
MegaQuantHook
0xB591b5096dA183Fa8d2F4C916Dcb0B4904f6f0c0
V4 hook: dynamic fees, limit/stop/bracket orders
MegaQuantRouter
0x608AEfA1DFD3621554a948E20159eB243C76235F
Order placement & advanced swap routing
PoolRegistry
0x680762A631334098eeF5F24EAAafac0F07Cb2e3a
On-chain pool discovery & management
PoolManager (V4)
0x00b036b58a818b1bc34d502d3fe730db729e62ac
Uniswap V4 core pool manager
Explorer: sepolia.uniscan.xyz
STRATEGY ENGINE
Write Once, Trade Everywhere
strategy.js
async function execute(dt) {
const chain = dt['unichain-sepolia']
// Place a limit order via V4 hook
await chain.uniswapV4.limitOrder({
pool: 'WETH/USDC',
side: 'buy',
price: 1950,
amount: '0.5'
})
}
TECH STACK
Frontend
React 18, TypeScript, Vite 6, Radix UI, Tailwind CSS, Monaco Editor
Backend
Express 4, TypeScript, SQLite, WebSocket, Node.js VM sandbox
Desktop
Electron 33 — macOS (arm64 + x64), Windows, Linux
Contracts
Solidity 0.8.26, Foundry/Forge, Uniswap V4 core + periphery
Blockchain
ethers.js v6, viem, Unichain Sepolia (chain ID 1301)
Data
5-source price aggregation: Binance, Chainlink, CoinGecko, CoinMarketCap, DefiLlama
MEGA QUANT
Bringing institutional-grade quant trading to DeFi
through native Uniswap V4 hooks
4
On-Chain
Order Types
3
Deployed
Contracts
6
Protocol
Integrations
3
Supported
Platforms