1 of 8

MEGA QUANT

Quantitative Trading Platform with Native Uniswap V4 Hooks

UHISwap Hookathon 2025 | Deployed on Unichain Sepolia

2 of 8

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.

3 of 8

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.

4 of 8

ARCHITECTURE

</>

Desktop App

  • React 18 + TypeScript + Vite
  • Electron (macOS, Windows, Linux)
  • Monaco Editor for strategy scripting
  • Real-time charts & analytics

{*}

Backend Engine

  • Express + SQLite
  • Sandboxed JS strategy execution
  • 5-source price aggregation
  • Unified FIFO PnL engine

[#]

Smart Contracts

  • MegaQuantHook.sol (V4 hook)
  • MegaQuantRouter.sol (order routing)
  • PoolRegistry.sol (pool discovery)
  • VolatilityMath.sol (EWMA library)

Uniswap V4 · Uniswap V3 · 1inch · Aave V3 · Binance Spot/Futures/Options

5 of 8

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

6 of 8

STRATEGY ENGINE

Write Once, Trade Everywhere

  • Sandboxed JavaScript execution (Node.js VM)
  • Monaco Editor with syntax highlighting
  • Unified API across all protocols & chains
  • Real-time log streaming to UI
  • Pause / resume / stop controls
  • FIFO PnL tracking across all positions

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'

})

}

7 of 8

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

8 of 8

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