Prediction-Informed Router (Piro)
A Uniswap v4 hook that dynamically adjusts swap fees based on live prediction market signals. When the probability of an adverse ETH price event rises, the hook increases fees or blocks swaps entirely — protecting LPs and swappers in real time.
Tech Stack
Description
What it is:
A Uniswap v4 dynamic-fee hook on Arbitrum Sepolia that reads a live prediction market signal to enforce risk-tier-based swap policy — low fees when risk is low, higher fees when risk rises, and full swap blocking when risk is critical.
How it works:
A Chainlink CRE workflow polls Polymarket's CLOB API every 60 seconds for the probability of "Will ETH dip to $1,600?", classifies it into Green/Amber/Red tiers, and publishes the tier on-chain to a RiskSignal contract via writeReport. The Uniswap v4 PredictionHook reads this tier in beforeSwap and returns a dynamic fee override (0.30% for Green, 1.00% for Amber) or reverts the swap entirely on Red. A 5-minute staleness window auto-escalates tiers if the CRE workflow stops updating, ensuring fail-safe behavior.
Problem solved:
DeFi liquidity providers and swappers have no way to react to off-chain risk signals in real time. This hook bridges prediction market intelligence directly into swap execution policy, protecting users during adverse market conditions without requiring manual intervention.