Product
The Alixir hook
Every launch shares one hook. It collects trading tax, runs anti-snipe protection, and routes ETH on every swap.
Uniswap v4 moves swap logic out of the core pool contract and into attachable hook contracts. Alixir's entire launch model depends on this: the factory creates a pool, attaches a hook, and that hook becomes the enforcement layer for trading tax, anti-snipe protection, and ETH routing on every swap. Every pool uses the same deployed hook.
The production hook: AlixirHook
Every token launched shares one hook address per chain, configured at factory deployment time. Ethereum runs HKPDLaunchFactory and HKPDHook; Elysium runs AlixirLaunchFactory and AlixirHook. Both deployments implement the same tax schedule, anti-snipe window, and ETH-only fee routing described on this page; only contract names and addresses differ per chain. The hook implements Uniswap v4's BaseHook interface and requests the minimum permission set required to intercept swaps and return fee deltas. It does not modify pool initialization parameters beyond what the factory sets at creation.
Permission set
The hook enables beforeSwap and afterSwap callbacks so it can inspect the swap direction, apply the applicable tax rate, and collect ETH on the swap path. It does not enable liquidity modification hooks, donate hooks, or return delta hooks beyond what is required for fee collection. This keeps the attack surface narrow: the hook cannot drain LP positions or alter tick ranges after initialization.
State tracked per pool
| State variable | Scope | Purpose |
|---|---|---|
| Buy trade counter | Global per token | Drives the 6-position buy tax cycle |
| Sell trade counter | Global per token | Drives the 8-position sell tax cycle |
| Launch timestamp | Per pool | Starts the 5-second anti-snipe window |
| Whitelist bitmap | Per pool, up to 30 addresses | Exempts trusted wallets from snipe tax |
| Post-snipe sell counter | Global per token | Counts the first 5 sells after the snipe window |
Trade counters are shared across every wallet. A snipe buy from wallet A advances the same buy counter as a normal buy from wallet B.
Tax computation on each swap
On every swap, the hook executes the following decision tree in order:
- If the swap is a buy and the pool is within five seconds of initialization and the sender is not whitelisted, apply the flat 60% anti-snipe rate and route 100% to the treasury. Skip the dynamic schedule.
- If the swap is a sell and the post-snipe sell counter is below five, apply the flat 30% cooldown rate and route 100% to the creator via
AlixirFeeLocker. Skip the dynamic schedule. - Otherwise, read the applicable trade counter (buy or sell), compute the position in the cycle, look up the tier rate (base rate or fixed tier), and route to the creator or treasury according to the schedule documented on the Launchpad page.
- Increment the trade counter and emit a
TaxCollectedevent with the token address, direction, snipe flag, gross ETH, effective rate, and both cut amounts.
ETH-only collection
All tax is collected and routed in native ETH on both chains. The creator never receives their own token as tax revenue. This is enforced at the hook level: fee deltas are applied on the ETH leg of the swap regardless of pool token ordering. Withdrawal happens through claimFees on the chain's fee contract (HKPDFeeVault on Ethereum, AlixirFeeLocker on Elysium), which transfers the full accrued balance to the creator's wallet in a single transaction.