Uniswap v4 Exploring New Possibilities
summary
Uniswap v4 adds a singleton architecture, continuous/dynamic fees, ERC-6909 and flash accounting, and exposes 14 hook functions with one hook allowed per pool. The talk claims hooks can implement TBAP splitting, RWA primary issuance with KYC, rehypothecation of out‑of‑range liquidity, no‑loss lottery yield and L2 sub‑$5k best‑price routing. The demo uses the v4 Hook Template, Foundry, Anvil fork, deploy/create‑pool/add‑liquidity scripts and counter.sol; scripts return a hook address and successfully create a pool and execute swaps.
AI-written summary · about
chapters (29)
- 0:00Start
- 0:02Why v4 now: customize DeFi around the swap
- 0:33Hooks = pre/post-swap custom logic (whitelists, loyalty, RWA, LP UX)
- 1:31Uniswap Foundation pillars & role
- 1:56Protocol recap: LPs ↔ traders; censorship-resistant, self-custody
- 3:13What’s new in v4: singleton, dynamic fees, ERC-6909, flash accounting
- 4:38Hooks overview: 1 hook per pool; 14 hook functions available
- 5:02v3 routing vs v4 singleton + flash accounting (one tx)
- 6:00Where hooks run: before/after swap, add/remove liquidity, fees, donate
- 7:25Hook lifecycle flags (before/after) & flow
- 7:48Hack ideas: large stable-stable, TBAP execution, Pendle-style AMM
- 9:15World ID–verified/KYC pools; sybil resistance & UX
- 10:01No-loss lottery pools with social yield (Pull-Together-style)
- 10:20Smart borrow: rehypothecate out-of-range liquidity
- 10:38RWA primary issuance hooks + compliance (ARC-standards)
- 11:09L2 sub-$5k ETH-USDC best-price hooks; mid-size trade incentives
- 12:20Resources: Hook Directory (Atrium), Hacker Toolkit
- 13:01v4 Hook Template intro (GitHub)
- 13:54Setup: clone, Foundry update, forge test
- 14:16Scripts tour: deploy, create pool, liquidity helpers
- 14:37Example hook: counter.sol (before/after swap & liquidity)
- 15:22Writing tests: deploy hook, add liquidity, assert counters
- 16:12Anvil fork (Uni Sepolia) for local testing
- 16:43Deploy the hook (forge script) → get hook address
- 17:11Configure base script with hook address
- 17:57Create mock tokens & mint balances
- 18:38Create pool + add liquidity (multicall actions)
- 20:09Execute a swap via router; pool key params in v4
- 20:26Wrap-up: template = fastest path to production hooks
related talks
15mSecurity considerations when building Hooks in Uniswap V4
30mMempool Primitives: A New Class of Money Legos
21mFireside Chat with Stani on Future of DeFi
26mDiscussion - Protocols, Session 1
20mPrice Manipulation Exploits
24m500 days of Security Summer
31mHigh-Yield Strategies in DeFi
39mThe challenges of building, scaling and securing DeFi protocols
