We integrated two partners. The entire system runs on Unichain because Uniswap v4's PoolManager is deployed there natively, and our hook address is mined against it — it's baked into the pool's immutable PoolKey and can't be moved. The frontend detects chain 1301, auto-prompts wallet switching, and a sync script reads our deployment artifact to wire all contract addresses into the app at build time. For Reactive Network, we replaced the two keeper jobs that every perp DEX needs — funding settlement and liquidations — with two event-driven reactors deployed on Lasna: LiquidationReactor watches for PositionUnderwater events on Unichain and automatically calls liquidateFromReactive back on Unichain when a trader's margin drops below threshold, while FundingReactor watches FundingDue and triggers settleFromReactive when the funding interval elapses — no bot, no incentive token, no missed windows.
Github:https://github.com/Kaushik2003/para-dex Slides: https://app.chroniclehq.com/90a08334-d861-45de-85fb-6d3c391a78ae/document/4f7103e7-d544-4d1b-97a2-7cfcd0360a47/2112c210-0dd9-4a45-bf92-a8d452e3ef4e Project Link:https://para-dex-phi.vercel.app/ Demo Video:https://youtu.be/Kx8j7pACEtE
Perp DEXs and spot AMMs are usually separate systems: perps depend on external oracles/keepers, while AMMs do not price the risk of one-sided perp demand to LPs.
This separation produces oracle manipulation/staleness risk, invisible LP directional exposure, and no native skew deterrent; keepers add liveness/incentive failure modes.
Uniswap v4 hooks allow the perp lifecycle to run inside swap execution: perp actions are v4 “virtual swaps” (sentinel amountSpecified + encoded hookData) so margin checks, OI updates, funding accrual, and automation events are atomic.
What makes this unique is that the perp market and spot market are the same pool — not two systems talking to each other, but one pool where perp skew atomically overrides spot fees in beforeSwap and spot volume prices perp positions through the tick TWAP. No existing perp DEX does this. The practical consequences are real: spot LPs earn elevated fees precisely when they bear the most directional risk, perp traders get an oracle that can't be manipulated without spending real money on spot trades, and the market self-corrects extreme skew through fee pressure rather than waiting for a funding rate to settle hourly. If this pattern holds, it's a template — any token with a v4 pool could have a native perp market embedded in it with no separate deployment, no external oracle dependency, and no keeper infrastructure.
The hardest part was the Uniswap v4 unlock-callback pattern in PerpController — you cannot call PoolManager directly, everything must route through unlock() and execute inside the callback, which meant restructuring the entire position lifecycle around a pattern that has almost no existing documentation or examples. Integrating Pyth as a pull oracle added UX complexity we didn't anticipate: every openPosition and closePosition transaction requires fetching a fresh price update from Hermes and bundling it with the call, with the Pyth fee paid as msg.value, which required changes across the contract ABI, the frontend hooks, and the transaction flow. The Reactive Network migration from Kopli to Lasna mid-build changed the chain ID, RPC URL, system contract address, and verification endpoint simultaneously. And the ReactVM isolation constraint — where react() genuinely cannot call anything external and the first callback argument is silently overwritten with the ReactVM ID — took significant debugging to understand because the failure mode is silent: the reactor deploys, appears subscribed, but callbacks never land.