Tapezero docs
Market Rules

Rule Execution

The order the hook actually applies things in.

Where the hook runs

TAPEZERO uses three Uniswap v4 callbacks: beforeInitialize, beforeSwap and afterSwap. The hook's address encodes exactly those permissions, which is why it is deployed to a mined CREATE2 address.

CallbackWhat it does
beforeInitializerefuses to let a pool exist with this hook unless the market's configuration is already registered
beforeSwapcharges the quote-side fees, or takes the burn when the specified amount is on the launch side
afterSwapenforces the anti-snipe cap and burns from the realised output

A buy, step by step

  1. 01Swap arrives at the PoolManager
  2. 02beforeSwap: market must be registered
  3. 03Classify: buy or sell, exact-in or exact-out, which side is specified
  4. 04Quote fees computed and taken as a hook delta
  5. 05Pot counter advances, before any token moves
  6. 06Pool executes the swap
  7. 07afterSwap: anti-snipe cap checked against this block's cumulative outflow
  8. 08Auto burn taken from the launch-token output
  9. 09Vault credited, events emitted

Which fees apply to which direction

ComponentBuysSells
protocol feeyesyes
creator feeyesyes
launch taxyes, while decayingno
anti-snipe extra feeyes, inside the windowno
pot contributionyes, if the buy qualifiesno
auto burnyes, on the token outputno

Rounding and accounting

Every fee component is bps × amount / 10000, rounded down — which favours the trader — and the total is the sum of the already-rounded components, so the vault's accounting is exact with no dust left over.

Fees are collected as Uniswap ERC-6909 claim tokens rather than ERC-20 transfers. On a market's first buy the PoolManager holds no quote asset at all, so a real take would try to move tokens that are not there yet. Minting a claim to the vault moves accounting only, nets against the hook's returned delta inside the same unlock, and leaves the vault holding something it can redeem on demand.

TAPEZERO is an independent protocol and is not affiliated with Robinhood, Uniswap or Chainlink. The contracts are unaudited. Nothing here is investment advice.