Decentralized options with Uniswap v4 hooks, flash accounting, and idle LP liquidity vaults.
elpi is a decentralized options protocol built on fixed agreements over disclosed risks, where every term and execution venue is immutably bound at mint. This project delivers the production-ready Uniswap v4 integration (OH_UNISWAP), solving the execution friction and capital inefficiency typical of on-chain derivatives:
Flash Settlement Execution (UniswapV4VenueAdapter): Implements elpi's ISettlementVenue via Uniswap v4's singleton PoolManager. Using transient flash accounting (unlock, sync, settle, take), option settlements execute with zero persistent intermediate balances, strictly bounding single-position insolvency (Invariant I1).
Zero-Fee Settlement Hook (OptionSettlementHook): A custom Uniswap v4 hook operating on dynamic fee pools that waives AMM swap fees (overrideFee = 0) specifically for authorized elpi PositionAccounts. This guarantees protocol fee withholding is restricted solely to profitable payouts (Invariant I4).
Idle LP Capital Staging (V4LiquidityVault & V4LPRouterRestaker): Instead of letting collateral sit unproductive, uncommitted LP collateral is staged in Uniswap v4 AMM pools to earn trading fees. Collateral is atomically extracted as raw ERC-20 at mint and automatically re-staked post-settlement within a safe, gas-bounded try/catch boundary without risking oracle-free expiry recovery (Invariant I3).
Continuous Clearing & Monitoring UI: Includes a full Next.js dApp featuring an asset onboarding wizard, real-time pool swap tracking, and TradingView charts displaying live strike and payoff zones.
We built this integration using Solidity 0.8.26 targeting the Cancun EVM, Foundry for contract development and formal testing, and Next.js 14, Viem, and TradingView Lightweight Charts for the frontend application.
Key architectural highlights and technical feats:

