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 Manager0x153816c77256481e8E3189DdCB599caA1dab4389
Position Manager0x2873F8C62c122A403A9939b18eE562cC91f1d0fc
Quoter0x3A693DE0Bf7e48BB247b24C35A5889834c67450B
State View0x7E735D8753700B5130590978AADf03873238DE5F
Permit20x4ce562F687d0Ced27b79Ba51d79B63BD978F7F48
Position Descriptor0x2df231fc6281d1D9cC21EB1b67f772Ed4259d38f

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.