By Predicate team
Summary
The Predicate team proposes a novel implementation of Uniswap V4 hooks to enable policy-guarded liquidity and seamless support for rebasing stablecoins, specifically USDL. Leveraging Uniswap V4’s extensible hook framework, we introduce two distinct onchain extensions—AutoWrapper Hook and the Predicate Hook—and orchestrate their interaction across a dual-pool topology to deliver yield-bearing trading pairs that meet the compliance needs of Paxos.
- Objective & Scope
- Enable Predicate-enforced swaps (e.g. KYC/AML/geofencing) at the smart-contract layer.
- Support USDL’s rebasing mechanics in Uniswap by auto-wrapping using a canonical ERC-20 representation (wUSDL).
- Create and manage two interconnected pools (“ghost” & “liquid”) under a unified design.
- Key Components
- AutoWrapper Hook
- Automatically wraps/unwraps USDL ↔ wUSDL during mint, burn, and swap operations, obviating manual user intervention.
- Predicate Hook
- Executes arbitrary compliance predicates (via the Predicate Network) before swaps, enforcing policy gates on every trade as required by the Paxos compliance team.
- Dual-Pool Architecture
- Ghost Pool: Facilitates wrapping/unwrapping between USDL and wUSDL; functions as an intermediary step with zero slippage impact.
- Liquid Pool: Hosts the wUSDL/USDC trading pair, enabling compliant liquidity provision and swaps through Predicate.
- Benefits & Outcomes
- Compliance by Design: All swap transactions automatically pass Paxos-defined checks, ensuring risk management at the smart contract level.
- Stablecoin Yield Integration: USDL holders can now access Uniswap liquidity while preserving daily yield distributions.
- Modular, Reusable Hooks: The same hook implementations can be adopted across other V4 pools (e.g., PYUSD, USDG), to enable 24/7 compliant liquidity access.
This design consolidates Uniswap V4’s hook capabilities and the Predicate Network’s policy engine to deliver a flexible, secure, and user-friendly pool for USDL/USDC. Next steps include a second security audit and front-end integration.
Architecture

Components
-
V4 Router
The abstract routing contract for swaps, implemented by both UniversalRouter
and V4SwapRouter
. It orchestrates swap execution across pools.
-
Ghost Pool
A “virtual” pool with no native liquidity. It’s the USDL/USDC pool to which the AutoWrapper Hook is attached, Its purpose is to invoke wrapping/unwrapping logic and swaps through the underlying liquid pool.
-
PoolManager
The single contract that tracks all V4 pools and their liquidity positions via unique poolKeys
. Unlike prior versions, there are no standalone pool contracts.
-
Liquid Pool
The real liquidity-bearing pool (e.g. wUSDL/USDC) where swaps and liquidity provisioning occur. The Predicate Hook is implemented here to enforce compliance checks on every trade.
-
AutoWrapper Hook
Attached to the Ghost Pool, this hook is triggered by any pool action (swap, liquidity provisioning). In its _beforeSwap()
callback it:
- Determines the amounts and direction for underlying swap (e.g., USDC → WUSDL)
- Swaps through underlying pool
- Wraps USDL → wUSDL (or unwraps wUSDL → USDL)
- Settles balances on the poolManager
-
Predicate Hook
Attached to the Liquid Pool, this hook executes before each swap. It:
- Decodes onchain hook data into a predicate payload
- Verifies signatures and runs compliance logic (e.g. KYC/AML/geofencing)
- Reverts the transaction if checks fail