Skip to main content

How it works

A zk-pad coin goes through four stages: launch, trading, fee collection and claiming. This section covers the first three. Claiming is part of the privacy model.

Launch​

The creator calls ZkPadFactory.deployToken once. In that single transaction the factory:

  1. deploys a fixed-supply ZkPadToken with CREATE2;
  2. asks the ZkPadHook to create and initialize a PancakeSwap Infinity CL pool against an allow-listed quote token, at a starting price the creator picked within the quote token's bounds;
  3. has the ZkPadLpLocker place 100% of the supply in one to seven single-sided positions, which it owns forever (see single-sided liquidity);
  4. optionally executes a dev buy for the creator at the starting price;
  5. optionally arms the anti-sniper fee.

The TokenLaunched event records the token, the pool id, the quote token and the opaque beneficiary id that receives the fees.

Trading​

The coin trades on PancakeSwap Infinity from the first block. There is no bonding curve and no "graduation". Any Infinity-compatible router works, because the hook does not rely on custom hookData. The zk-pad UI uses the minimal ZkPadSwapRouter.

Every swap pays the creator-chosen fee F (1% to 5%), plus PancakeSwap's own protocol fee of about 0.03%.

Fee collection​

Fees are collected automatically. Before each swap, the hook:

  • pays out the protocol fees accumulated by earlier swaps to the factory (the treasury share);
  • asks the locker to collect the LP fees of the locked positions, convert the token-side part to the quote token, and deposit the result into the FeeVault under the coin's beneficiary id.

Anyone can also trigger collection with ZkPadLpLocker.collectRewards(token). A failing collection never blocks trading; the fees simply wait in the positions until the next attempt. A collection whose conversion would run at a price that an earlier swap in the same block pushed against it is deferred to a later block (RewardsDeferred).

Next​