Clanker Documentation
  • Introduction to Clanker
  • Changelog
  • General
    • FAQ
    • Token Deployments
      • Farcaster Bot Deployments
      • Clanker.world Deployments
      • Preclank Deployments
      • Alternative Interface Deployments
    • Creator Rewards & Fees
    • Clanker.world Warning Tags
  • SDK
    • Quick Start
    • v4.0.0
    • v3.1.0
    • CLI
  • API
  • Quick Start
  • Public
    • Get Tokens
    • [PLANNED EOL] Get Tokens (Search)
  • Authenticated
    • Deploy Token (v4.0.0)
    • Get Token by Address
    • Get Tokens Deployed by Address
    • Get Estimated Rewards
    • Get Uncollected Fees
    • Deploy Token (v3.1.0)
    • Deploy Token w/Splits (v3.1.0)
  • References
    • Core Contracts
      • v4.0.0
        • Deployment Config
        • Fee Management Contracts
          • ClankerFeeLocker
          • ClankerLpLockerMultiple [Deprecated]
          • ClankerLpLockerFeeConversion
        • Extensions
          • ClankerVault
          • ClankerAirdrop
          • ClankerUniv4EthDevBuy
        • ClankerHook
          • ClankerHookStaticFee
          • ClankerHookDynamicFee
        • Mev Modules
          • ClankerMevModule2BlockDelay
          • ClankerSniperAuctionV0
        • ClankerToken
        • Administrative Permissions
      • v3.1.0
        • Clanker (Direct Contract Deployments)
        • LpLockerv2
        • ClankerVault
      • ClankerToken v3.1.0 and v4.0.0
    • Brand Assets
    • Audits
    • Compatible Trading Platforms
    • Deployed Contracts
    • Supported Quote Tokens
    • Core Team
    • Contact
Powered by GitBook
On this page
  1. References
  2. Core Contracts
  3. v4.0.0

ClankerHook

PreviousClankerUniv4EthDevBuyNextClankerHookStaticFee

Last updated 1 month ago

CtrlK

The ClankerHook contract is the abstract base contract that our other hooks inherit from.

The ClankerHook contract itself facilitates:

  • Automatic fee collection of the initial LP position's fees. Fees are collected by the IClankerLpLocker contracts and are routed to the ClankerFeeLocker contract for users to claim.

  • Collection of a DEX-level protocol fee, separate from the creator LP fees, always in the paired token.

  • Triggering of a pool's MevModule until it is disabled or expired.

Note: both of the fee collection mechanisms lag by a swap, so the fees collected in a swap are the fees from the previous swap. This is because a swap's fees are only sent into the PoolManager contract after the swap has completed.

v4.0.0's initial release introduces two different fee hook types: ClankerHookStaticFee and ClankerHookDynamicFee. For both hooks, the protocol's DEX fee is always taken in the paired token and will always be 20% of the active LP fee.

The maximum LP fee is 30% of a swap. It is NOT recommended to set the fee this high if it is desired for the token to work with every router; fees that high should be reserved for esoteric use cases only.

Clanker's hooks allow for deployment of pools not created by the factory via an 'open' version of the initialization pathway. Pools created via this method do not have automatic LP fee claiming or mev module operations. Note: this function will revert if called with the clanker address set to WETH. We only collect the protocol's fee on the paired token and would prefer it to be WETH when possible.

// callable by anyone
function initializePoolOpen(
    address clanker,
    address pairedToken,
    int24 tickIfToken0IsClanker,
    int24 tickSpacing,
    bytes calldata poolData
) public returns (PoolKey memory)