Skip to content

Onchain events

If you would rather index Merry Men yourself than poll the Public API, these are the events to watch. Discovering launches is a single event on the factory; trading is PoolManager swaps. (Earlier generations emit different events; see Earlier generations.)

Index TokenLaunchedV4 on the factory (addresses on Contract addresses):

event TokenLaunchedV4(
address indexed token,
address indexed creator,
PoolId indexed poolId, // the 32-byte v4 pool id
PoolKey key, // full key: currencies, fee flag, tickSpacing, hook
uint256 positionId, // the locked position NFT id
uint256 totalSupply,
uint256 creationFeeWei
);

The full PoolKey is emitted because a PoolId is a one-way hash you cannot invert. Store the key; it is what you need to route swaps.

Each launch also emits, in the same transaction:

// The identity commitment, not the raw X id. The attester service resolves
// the hash to a live handle for display.
event VerifiedLaunch(address indexed token, address indexed creator, bytes32 indexed xUserIdHash, bytes32 nonce);
// Present when the creator bundled a first buy into the launch tx.
event CreatorBuy(address indexed token, PoolId indexed poolId, address indexed creator, uint256 ethIn, uint256 tokensOut);
// When the creator armed a gated launch (mode: 1 = Game, 2 = Verified).
event FrozenLaunch(address indexed token, PoolId indexed poolId, Mode mode, uint64 maxFreezeAt);

The hook emits the coin’s full economic terms at launch. Render fees from this, never from copy:

event LaunchManifest(
PoolId indexed poolId, address indexed token,
uint24 buyFee, uint24 sellFeeStart, uint24 sellFeeFloor, uint32 sellDecayBlocks,
uint16 opsFeeBps, uint24 maxFee, uint64 launchBlock
);

Trades are Swap events on the singleton PoolManager, keyed by the launch’s poolId. The hook additionally emits its fee legs per swap:

// MerrymenHookV / HookVG: the quote fee leg and the burned token leg
event FeeTaken(PoolId indexed poolId, bool zeroForOne, uint24 rate, uint256 amount);
event BurnFeeTaken(PoolId indexed poolId, uint24 rate, uint256 amount);
event FeesBurned(PoolId indexed poolId, address indexed token, uint256 amount);
event FeeReleased(PoolId indexed poolId, address indexed creator, uint256 creatorAmount, uint256 opsAmount);

Custody and creator transfers (LpLockerV4)

Section titled “Custody and creator transfers (LpLockerV4)”
event PositionLocked(uint256 indexed tokenId, address indexed creator);
event CreatorTransferStarted(uint256 indexed tokenId, address indexed creator, address indexed newCreator);
event CreatorTransferred(uint256 indexed tokenId, address indexed oldCreator, address indexed newCreator);

CreatorTransferStarted / CreatorTransferred track community takeovers of the fee stream (tokenId is the position id from the launch event).

event UpdaterSet(address indexed updater);
event RootUpdated(uint256 indexed epoch, bytes32 root);
event Funded(address indexed from, uint256 amount);
event Claimed(address indexed account, uint256 amount, uint256 totalClaimed);
event Recovered(address indexed token, address indexed to, uint256 amount);

RootUpdated fires each epoch (~6h) with the new cumulative Merkle root; Claimed tracks pull-based referral payouts. See Protocol revenue.

event Listed(uint256 indexed tokenId, address indexed seller, uint256 price);
event PriceUpdated(uint256 indexed tokenId, uint256 price);
event Cancelled(uint256 indexed tokenId, address indexed seller);
event Delisted(uint256 indexed tokenId, address indexed seller);
event Sold(uint256 indexed tokenId, address indexed seller, address indexed buyer, uint256 price, uint256 fee);
event Swept(address indexed token, uint256 amount);