Limit orders hook on Base

Uniswap v4 Hook Contract 0xeeee3da335342996ab288fbcf70fbe5f9ed81040 on Base · Limit orders

Volume (24h)
$10.15K
Value locked (TVL)
$10.43K
All-time volume
$44.79K
Pools using this hook
11
Swaps (24h)
928 (237 traders)
Total swaps
4,930

What it does

Adds limit-order functionality to a Uniswap v4 pool, letting users place, cancel and withdraw orders that fill as the price crosses a chosen tick.

How it works step by step

  • Records the pool's starting tick in afterInitialize
  • Lets users place a limit order at a chosen tick and direction via placeOrder
  • Assigns each order an id derived from the pool key, tick and direction (getOrderId)
  • Tracks per-order liquidity in a nested mapping keyed by order id and owner
  • Checks price movement in afterSwap and updates or fills orders that the price crossed
  • Lets owners cancel orders via cancelOrder and withdraw filled proceeds via withdraw
Swap behaviour
afterSwap is enabled and reads the last recorded tick and order mappings to detect crossings and fill or update orders; beforeSwap is dispatched but its permission is not enabled.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are present as view selectors; afterAddLiquidity and afterRemoveLiquidity are also dispatched. Order-related storage is written on placeOrder, cancelOrder and withdraw, which suggests limit orders are represented as single-sided liquidity positions tracked per order id.
Fee behaviour
Uses the pool's static fee.
Owner & admin controls
No admin controls found. The treasury() getter exists but no owner or setter selectors were decoded.

Enabled Uniswap v4 callbacks

afterInitialize, afterSwap

afterInitialize: records the initial tick for the pool (writes tick-last storage). afterSwap: reads the stored tick, checks whether the price crossed order ticks and updates order state accordingly.

Security & trust assessment

Risk level: medium (decoded bytecode, medium confidence).

Who controls it: No privileged owner was identified from the decoded selectors. Users depend only on the contract logic and the pool manager's behaviour.

Risk to user funds: The hook holds liquidity for open limit orders in the form of pool positions and tracks each order's amount in storage. Funds can be retrieved through withdraw and cancelOrder. No pause or owner-withdraw path was identified.

Security findings

  • [info] Hook custodies order liquidity: Order liquidity and order state are stored in the hook and settled through the pool manager, so funds sit with the hook while orders are open.
  • [medium] Accounting correctness not verifiable from bytecode: withdraw and cancelOrder transfer order-owned balances; correctness depends on the order-id accounting in mappings shared with placeOrder, which cannot be fully verified without source.
  • [low] Unlock callback reentrancy surface: The hook implements an unlockCallback and interacts with the pool manager to move tokens, a common source of settlement bugs if callback guards are missing.

Contract details

Verified source
No
Bytecode size
18,486 bytes
Upgradeable proxy
No

Pools using Limit orders hook