Skip to main content

Factory

LaunchCreated is your discovery stream. It carries the creator’s launchParams (for type 1, the addresses exempt from the anti-snipe surcharge) but not the launch’s economics: a launch snapshots the factory defaults and its type’s parameters at creation, so one config() call on a type-1 launch turns the log into a priceable curve. contractURI is write-once — no setter, no update event. Pool creation at graduation logs on the DEX factory, not here.

Launch (one stream per clone)

Semantics that are easy to get wrong:
  • The launch is log.address. There is no token or launch field — one contract, one token, one stream.
  • trader is asymmetric by design: on a buy it is the recipient (who ends up holding); on a sell it is the seller (whose balance moved). The event follows whose balance in the launched token changed.
  • quoteAmount is the reserve delta, whichever entry was used. A buyer paid quoteAmount + fee (minus any completion refund); a seller received quoteAmount − fee.
  • sold is not monotonic — sells decrease it. It is curve state, not cumulative volume.
  • CurveCompleted and Graduated share a transaction. The buy that fills the curve emits its Trade, then CurveCompleted, and graduates the launch before it returns — the DEX’s PoolCreated and the locker’s Locked land in between, Graduated last. There is no block in which a launch is full but not graduated.
  • FeesSwept fires inside collectFees(), once per side actually paid — creator or protocol. A side whose transfer fails emits nothing and keeps its balance.

LunyaLaunchToken

Same name as the launch’s Graduated, different topic0. It is a signal only — the token is freely transferable from its first block. Burns show up as ordinary ERC-20 Transfer events to the zero address.

Locker

All keyed by tokenId; locker.positionOf(token) maps a graduated token to its position. There is no protocol-recipient event on the locker: the protocol’s side follows the factory, so watch the factory’s FeeRecipientUpdated.

Indexer rules of thumb

  1. Never infer state from balances. A launch rejects stray native transfers, and counts none of any stray quote tokens sent to it; reserve() and progress() are the truth.
  2. Two FeesSwept events share a name, not a topic0: the launch’s (to, amount) per side paid by collectFees(), and the factory’s (quoteToken, to, amount) from sweepFees. At graduation, the launch tries to move its protocol fees to the factory — visible only as an ERC-20 Transfer, and absent if the quote token refused it.
  3. One eth_call per launch (config() on type 1) turns the log stream into a priceable curve. Inside the anti-snipe window, buy fees also depend on openedAt() and the buyer’s exemption.
  4. Attribute launches to creator, fees to creatorFeeRecipient — they can differ.
  5. Handle launch types: the same LaunchCreated stream will carry future implementations. Treat a launch’s ABI as a function of its launchType.