TokiHook on Arbitrum

Uniswap v4 Hook Contract 0x916bc355488071a414e7d916e05fb7c177241888 on Arbitrum · Custom pricing · Verified contract

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
19
Swaps (24h)
0 (0 traders)
Total swaps
7

What it does

A Uniswap v4 custom-curve hook for Pendle-style yield trading of Principal Tokens: it prices swaps on a fixed-rate curve, mints LP tokens for liquidity, and can rehypothecate idle reserves into ERC4626 vaults.

How it works step by step

  • Overrides the pool's swap pricing via beforeSwapReturnDelta, so swaps are executed by an internal implied-rate curve rather than the default pool math
  • Blocks direct PoolManager liquidity additions and routes all LP deposits through the hook's addLiquidity and removeLiquidity functions
  • Mints and burns a per-pool ERC20 LP token (TokiPoolToken) representing pro-rata claims on raw balances and vault shares
  • Optionally deposits idle underlying and principal token balances into ERC4626 vaults, with target and min/max raw-token ratios
  • Maintains a logarithmic implied-rate TWAP oracle with observation cardinality that anyone can expand by paying gas
  • Accrues swap fees split between a curator and a protocol treasury, collectable by the curator or the protocol fee role
Swap behaviour
beforeSwap runs a nonReentrant custom curve calculation that computes the swap output and returns a BeforeSwapDelta; swaps can be paused by the principal token's pause flags and are disabled after expiry.
Liquidity behaviour
beforeAddLiquidity reverts for direct PoolManager use. addLiquidity and removeLiquidity pull or push tokens, optionally move funds into or out of vaults, and mint or burn LP tokens; both can be paused, and deposits are disabled after expiry.
Fee behaviour
Swap fees are accrued in the hook's fee accumulators and split between curator and protocol; collectCuratorFee and collectProtocolFee transfer accrued fees out via the PoolManager. Pool initialization requires a zero fee.
Owner & admin controls
Access is governed by an AccessManager owned by the curator: updateConfiguration changes vault addresses and raw/vault ratios (with irreversible freeze flags), unwindVault redeems vault shares, and collectCuratorFee is restricted to the curator's access manager. collectProtocolFee is restricted to the factory access manager. Pause flags are set at deployment and enforced via the principal token. Hooklets can add custom logic before and after operations.

Enabled Uniswap v4 callbacks

afterInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

afterInitialize enforces zero pool fee and emits initial state; beforeAddLiquidity disables direct PoolManager liquidity; beforeSwap runs the custom curve; beforeSwapReturnDelta lets the hook take over the swap amount delta.

Security & trust assessment

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

Who controls it: The curator controls vault selection, ratios, pause configuration and fee receiver for its pool instance, and can unwind vault positions; users must trust the curator for pool risk management.

Risk to user funds: The hook custodies pool liquidity through the PoolManager and can hold funds in ERC4626 vaults that the curator can add or change; the curator can also unwind vault shares and pause withdrawals, so user funds can be moved or temporarily blocked.

Security findings

  • [medium] Curator-controlled vault configuration: The curator can change rehypothecation vaults and ratios via updateConfiguration and can unwind vault shares into raw balances through unwindVault, so user-deposited funds sit in external vaults whose behaviour the curator selects.
  • [medium] Pausable swaps and deposits: The pause guard (LibPauseGuard) can block swaps, LP deposits, withdrawals and LP transfers based on flags set at deployment; the source indicates these are configured by the curator, so a pause can freeze user exits.
  • [info] Hook takes tokens via return delta: beforeSwapReturnDelta means the hook directly determines the amounts settled with the PoolManager during swaps, so the curve math is a critical trust point for users.
  • [info] Hooklet and external dependency risk: An optional immutable hooklet and external ERC4626 vaults are called during swaps and liquidity operations; their behaviour is outside this contract and could affect accounting.
  • [info] Curator fee collection: collectCuratorFee is callable by the curator's access manager and sends accrued curator fees to a chosen receiver; this is an intended privileged action rather than a bug.

Contract details

Verified source
Yes (TokiHook)
Compiler
solc 0.8.28+commit.7893614a
Bytecode size
23,851 bytes
Upgradeable proxy
No
Detected patterns
erc6909-claims, liquidity-management, moves-currency, oracle, pausable, return-delta, self-unlock

Pools using TokiHook