il-aware-limit-order-hook
IL-Aware Limit Orders · UHI9 HookathonTurns a passive limit order into a yield-bearing position — and refunds the user for impermanent loss out of the yield it earns.
● Live · Base + Unichain77 testsERC-721 · ERC-4626UHI9 prize winner
- Oracle-free IL rebate — impermanent loss derived from sqrtPriceX96 deltas via a 2nd-order Taylor approximation; rebate = min(yield, IL).
- Yield routing — executed output deposited into an ERC-4626 vault until claim: real Aave (waBasUSDC) on Base, a simulated vault on Unichain.
- Orders as NFTs — every order is an ERC-721: composable and tradable on secondary markets.
- O(1) tick scanning — doubly-linked list of active ticks only; cost scales with populated ticks crossed, not range width.
- Anti-DoS execution — failed orders emit and re-queue instead of reverting the swap, with gas metering against OOG.
- Audit-hardened — per-pool order isolation, a per-currency solvency invariant, and a hard trigger-price gate, backed by Foundry invariant tests; scope + threat model documented for external review.
- Security research — graded the vault path against OpenZeppelin's audit of Uniswap Labs' DualPoolHook, and found a medium-severity permanent fund lock: a permissionlessly-poisoned pool baseline overflowed the IL math inside the only exit path for a filled order. Fixed with a saturating cast, proven end-to-end and mutation-verified.
Hook · Unichain:0x3983130FCD18606AfE659acDddB0018d21c254CeHook · Base:0x4fB56294f7bFf30A4d85c1bA676f0CFdB24114ce