Skip to content

Events ​

Indexing the factory gives you every launch; indexing each curve, the router and the hook gives you every trade. Together they reconstruct the full state of the protocol without any Hanok service.

Factory ​

solidity
event Launched(address indexed token, address indexed curve, address indexed creator, address launcher,
    uint256 configId, address quoteAsset, uint16 creatorTaxBps, uint40 tradingStartsAt);
event DevBuy(address indexed token, address indexed buyer, uint256 quoteSpent, uint256 tokensOut);
event Graduated(address indexed token, bytes32 indexed poolId, uint256 quoteAmount, uint256 tokenAmount, uint128 liquidity);
event CreatorTransferStarted(address indexed token, address indexed currentCreator, address indexed pendingCreator);
event CreatorUpdated(address indexed token, address indexed previousCreator, address indexed newCreator);
event TakeoverProposed(address indexed token, address indexed newCreator, uint40 executableAt, uint40 expiresAt);
event TakeoverCancelled(address indexed token, address indexed newCreator);
event BuybackEnabledUpdated(address indexed token, bool enabled, address indexed caller);

Curve ​

solidity
event Bought(address indexed buyer, address indexed recipient, address indexed referrer,
    uint256 quoteIn, uint256 tokensOut, uint256 fee, uint256 tax);
event Sold(address indexed seller, address indexed recipient, address indexed referrer,
    uint256 tokensIn, uint256 quoteOut, uint256 fee, uint256 tax);
event Refunded(address indexed buyer, uint256 amount);
event ReferralPaid(address indexed referrer, uint256 amount);
event FeesSwept(uint256 protocolAmount, uint256 creatorAmount, uint256 buybackQuote, uint256 buybackTokens);
event BuybackSkipped(uint256 pendingQuote);
event SoldOut(uint256 timestamp);
event GraduationDeferred(bytes reason);
event Closed(address indexed to, uint256 quoteAmount, uint256 tokenAmount);

quoteIn on Bought is what was actually spent after any clamp; tax includes the snipe tax on buys. Treat GraduationDeferred as a work queue: the launch is finished but still needs a push.

Router ​

solidity
event Traded(address indexed token, address indexed trader, address indexed recipient,
    bool isBuy, bool viaPool, uint256 amountIn, uint256 amountOut);

Filter viaPool == true for post-graduation trades. Trades made directly through Uniswap routers do not emit this; index the hook's FeeCollected or the PoolManager's Swap for those.

Hook ​

solidity
event PoolRegistered(bytes32 indexed poolId, address indexed token, address quoteAsset);
event FeeCollected(bytes32 indexed poolId, address indexed referrer, uint256 fee, uint256 tax, uint256 referral);
event PoolFeesSwept(bytes32 indexed poolId, uint256 protocolAmount, uint256 creatorAmount, uint256 buybackQuote, uint256 buybackTokens);
event BuybackSkipped(bytes32 indexed poolId, uint256 pendingQuote);
event ReferralFlushed(address indexed referrer, address indexed asset, uint256 amount);

Escrow and vault ​

solidity
event Credited(address indexed account, address indexed asset, address indexed from, uint256 amount);
event Claimed(address indexed account, address indexed asset, address to, uint256 amount);
event Locked(address indexed token, address indexed from, uint256 amount, uint64 vestingEnd);
event Released(address indexed token, address indexed creator, uint256 creatorAmount, uint256 protocolAmount);

Block timestamps

GIWA produces one block per second, so latestTimestamp − (latestBlock − log.blockNumber) is a good estimate of a log's time without fetching each block.

Hanok is unaudited testnet software. Tokens can lose all value.