UnitFlow LogoUnitFlow Docs

V4 — Singleton Pool Manager with Hooks

NewSelect "V4" in the version picker to use this mode

V4 introduces a singleton PoolManager contract that manages all pools in a single deployment, reducing gas costs. It also adds a hooks system for attaching custom logic to pool lifecycle events.

Contracts (Arc Testnet)

ContractAddress
Pool Manager0x33C02bfb9e39AAAe30F8bE86b850f8ce53d20C0b
Position Manager0x33eF9605420D61FCCcEc1A3048Df65b92E1ff491
Quoter0xf9d5Ae3c08602390ea15A3968f2D25cc3c3A7ced
State View0xEAea934839E8A7CfBfd85336380F77d72e090bBe
Permit20x4ce562F687d0Ced27b79Ba51d79B63BD978F7F48
Position Descriptor0x228432d1D38c2bcAa8eE579ed52C07ef190591e4

Fee Tiers

Same as V3: 0.01%, 0.05%, 0.30%, 1.00%.

Key Differences from V3

  • All pools are managed by a single PoolManager contract (singleton pattern)
  • Swaps are executed via PositionManager.modifyLiquidities using SWAP_EXACT_IN_SINGLE
  • Price output is estimated via the V4 Quoter (quoteExactInputSingle)
  • An optional hooks address can be specified in the advanced settings panel
  • Native USDC maps to address(0) in the PoolKey
  • Uses Permit2 for token approvals

Hooks

V4 hooks allow custom smart contract logic to execute at specific points in the pool lifecycle. The swap UI exposes an optional hooks address field in the advanced section. The default (no hooks) uses the zero address (0x000...000).

ℹ️
Hook contracts are not deployed or managed by UnitFlow. The hooks field is for advanced users who have deployed their own hook contracts on Arc Testnet.

Components

  • V4SwapCard — swap interface with fee tier and optional hooks address
  • V4AddLiquidity — add V4 liquidity
  • V4RemoveLiquidity — remove V4 positions
  • V4Positions — view active V4 positions
  • V4PoolsList — browse V4 pools

Data

V4 pool data is fetched from a GraphQL subgraph via the useV4GraphQL hooks:useV4Pools, useV4ProtocolStats, and useV4Positions.