LimitOrderHook on Polygon

Uniswap v4 Hook Contract 0xc773b905b8b2919ec5b7fffc228cd7c436fc00c0 on Polygon · Limit orders · Verified contract

Volume (24h)
$1.62K
Value locked (TVL)
$702
All-time volume
$59.66M
Pools using this hook
3
Swaps (24h)
56 (42 traders)
Total swaps
145,977

What it does

A Uniswap v4 hook that lets resting limit orders execute automatically when a swap moves the pool price through their tick range, with a fee manager able to set the pool's dynamic LP fee up to 5%.

How it works step by step

  • Records the pool's tick before each swap in transient storage (beforeSwap).
  • Reads the tick after each swap and passes the before/after ticks and swap direction to the limit order manager (afterSwap).
  • The external limit order manager fills resting orders between those ticks, so limit orders execute as part of ordinary swaps.
  • Lets a FEE_MANAGER_ROLE holder set a pool's dynamic LP fee via updateDynamicLPFee, capped at 5%.
  • Uses OpenZeppelin AccessControl with DEFAULT_ADMIN_ROLE and FEE_MANAGER_ROLE granted to the admin at deployment.
Swap behaviour
beforeSwap records the pool tick; afterSwap reads the new tick and calls the limit order manager to fill any limit orders crossed by the price move in the swap direction.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Pool uses a dynamic LP fee. A FEE_MANAGER_ROLE holder can set it per pool via updateDynamicLPFee, capped at 5% (50000 pips). The hook does not take a fee on swaps itself and returns zero fee override in beforeSwap.
Owner & admin controls
DEFAULT_ADMIN_ROLE and FEE_MANAGER_ROLE are granted to the deployer-supplied admin address. The FEE_MANAGER_ROLE holder can call updateDynamicLPFee to set a pool's LP fee up to 50000 (5%). Admin can grant and revoke roles. The hook contract itself has no pause or upgrade mechanism; the limit order manager (external contract) controls order execution and keeper settings.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap: records the pool's current tick into transient storage before the swap executes. afterSwap: reads the post-swap tick and calls limitOrderManager.executeOrder with the before and after ticks and swap direction so resting limit orders crossed by the swap get filled.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: A FEE_MANAGER_ROLE or DEFAULT_ADMIN_ROLE key can change any pool's LP fee up to 5% instantly, affecting all swappers and LPs in that pool. Admin can grant itself or others roles at will. Because executeOrder runs on every swap, a compromised or buggy limit order manager could affect swap execution in every pool using this hook.

Risk to user funds: The hook itself never holds or transfers tokens and returns zero balance deltas, so it cannot directly custody swap funds. Indirect exposure comes from the immutable limitOrderManager, which is called on every swap and handles escrowed limit order funds, and from the fee manager's ability to raise the pool fee up to 5%.

Security findings

  • [medium] Privileged fee setting: updateDynamicLPFee lets a role holder change the LP fee of any pool using this hook to any value up to 5%, without timelock or per-pool notice.
  • [medium] Dependency on external order manager in swap path: afterSwap calls the external limitOrderManager.executeOrder; if that contract reverts or is malicious, swaps in affected pools revert or are manipulated. The manager address is immutable, so it cannot be replaced by an upgrade.
  • [info] Transient tick tracking: Previous tick is stored in transient storage in beforeSwap and read in afterSwap, which is a reasonable pattern; the hook does not hold user tokens itself and returns zero deltas.
  • [low] Single-admin AccessControl without timelock: The contract uses OpenZeppelin AccessControl with no timelock and a single admin address supplied at deployment.

Contract details

Verified source
Yes (LimitOrderHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
5,472 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, limit-orders

Pools using LimitOrderHook