Reference

Onchain events

Events to index launches, trades, and rewards.

Scrible has no offchain indexer. The app builds its feed from factory state and its charts from these events. Use them to build your own views.

Factory events#

EventWhen
TokenLaunched(address indexed token, address indexed creator, string name, string symbol, uint256 creatorBuy)A launch confirms.
TradeExecuted(address indexed token, address indexed trader, address indexed recipient, bool buy, uint256 input, uint256 output)Any buy or sell, including the launch buy.
QuoteApproved(address indexed quote, uint256 virtualQuote)The owner opens a pair for launches.
QuoteRemoved(address indexed quote)The owner closes a pair for new launches.
HookInstalled(address indexed hook)Once, at deployment.

Hook events#

EventWhen
CurveTrade(address indexed token, bool buy, uint256 input, uint256 output, uint256 raised, uint256 tokens)Every trade. raised and tokens are the curve state after the trade.
FeeClaimed(address indexed token, address indexed creator, uint256 amount)Base share claimed or swept.
TaxClaimed(address indexed token, address indexed recipient, uint256 amount)Extra tax claimed or swept.
HolderModeEnabled(address indexed token, address indexed creator)The creator turns on holder mode.
HolderRewardsFunded(address indexed token, uint256 amount)Tax moves into the holder pool.
DistributionSwept(address indexed token, uint256 holderAmount)A sweep completes.
TaxRecipientSet(address indexed token, address indexed recipient)The creator changes the recipient.
TreasuryClaimed(address indexed quote, address indexed treasury, uint256 amount)The treasury share is paid.

In holder mode, FeeClaimed and TaxClaimed use the token address as the second argument, because the funds went to the pool.

Token events#

EventWhen
Transfer, ApprovalStandard ERC-20.
RewardsDistributed(uint256 amount, uint256 rewardsPerShare)The pool receives rewards.
RewardsClaimed(address indexed account, uint256 amount)A holder claims.
ContractURIUpdated()Once, at deployment (ERC-7572).
EventContract
ChunkStored(address indexed pointer, bytes32 indexed digest, uint256 size)MediaStore. One per chunk.
LinksSet(address indexed token, address indexed setter, string website, string x, string telegram)Links registry.

Building a price history#

  1. Find the right contracts

    Use the token's factory and that factory's hook. See Previous factories.

  2. Pull the logs

    Filter CurveTrade on the hook by the token topic, starting at the factory's deployment block.

  3. Compute the price

    For each event: price = (virtualQuote + raised) / tokens. Read virtualQuote once from curves(token).

  4. Add volume

    Volume is input on buys and output on sells, in the pair asset.

Older factories may emit different event shapes. Check their ABI before you decode. VERIFY

esc