This package was initialized via substreams init, using the evm-events-calls template.
substreams build
substreams auth
substreams gui # Get streaming!
substreams registry login # Login to substreams.dev
substreams registry publish # Publish your Substreams to substreams.dev
All of these modules produce data filtered by these contracts:
store_pairsThis module listens for MemeTokenCreated events emitted by the factory contract and stores the addresses of the created token pairs. These stored pair addresses are later used to filter buy and sell events.
Output: Stores pair addresses in a persistent store.
map_tokens_createdThis module captures all MemeTokenCreated events from the factory contract. It extracts details about the created tokens, such as their address, name, symbol, image URL, and description.
Output:
token_addresspair_addresscreatornamesymbolimage_urldescriptionmap_buy_sell_eventsThis module processes buy and sell events (TokensPurchased and TokensSold) from the token pairs created by the factory. It matches events to the tracked pairs and classifies them as "buy" or "sell" transactions.
Output:
event_type: "buy" or "sell"user: Address of the buyer or sellereth_amount: ETH spent or receivedtoken_amount: Tokens purchased or soldcurrent_price: Current token pricetotal_supply: Total token supplycirculating_supply: Circulating token supplyeth_reserve: ETH reserve in the poolmap_king_of_the_hillThis module identifies the token with the highest market cap from the processed TokensPurchased events. Market cap is calculated as:
Market Cap = current_price * circulating_supply
Output:
king_bonding_pair: Address of the top token's pairmarket_cap: Highest market cap valuemap_price_barsThis module generates OHLC (Open, High, Low, Close) price data, also known as "price bars," from the token buy and sell events. It aggregates price and volume data over specified intervals (default is 1 minute).
Output:
mint: Token identifiertimestamp: Time of the price baropen: Opening pricehigh: Highest price during the intervallow: Lowest price during the intervalclose: Closing pricevolume: Total traded volumeslot: Block slot numberis_1_min: Indicates if the interval is 1 minuteis_5_min: Indicates if the interval is 5 minutesWe implemented the Event trait for the following Ethereum events:
MemeTokenCreatedTokensPurchasedTokensSoldThese events are processed by the modules to extract, store, and analyze data for meme tokens and related transactions.
To run the Substreams starting from the latest block or a specific block (without backprocessing), use the following commands:
# Run from the module's initial block
substreams run ./realfun-token-stream-v0.1.0.spkg map_tokens_created \
--start-block=21711925
# Run from the latest block (if supported)
substreams run ./realfun-token-stream-v0.1.0.spkg map_tokens_created \
--start-block=now
# Run the buy/sell events module
substreams run ./realfun-token-stream-v0.1.0.spkg map_buy_sell_events \
--start-block=21711925
# Run the King of the Hill module
substreams run ./realfun-token-stream-v0.1.0.spkg map_king_of_the_hill \
--start-block=21711925
# Run the price bars module
substreams run ./realfun-token-stream-v0.1.0.spkg map_price_bars \
--start-block=21711925
To visualize and interact with the data via GUI:
substreams gui --start-block=21711925
Ensure you have authenticated and configured your .substreams.env with the correct SUBSTREAMS_API_TOKEN before running these commands.
substreams gui realfun-token-stream@v0.5.0 map_tokens_createdsubstreams gui realfun-token-stream@v0.5.0 map_buy_sell_eventssubstreams gui realfun-token-stream@v0.5.0 map_king_of_the_hillsubstreams gui realfun-token-stream@v0.5.0 map_price_barssubstreams gui realfun-token-stream@v0.5.0 debug_stored_pairsall_events gives you all the events in a block (from successful transactions), with basic block hash/number/timestamp and transaction hash
substreams gui realfun-token-stream@v0.5.0 ethcommon:all_eventsall_calls gives you all the calls in a block (including internal calls), with basic block hash/number/timestamp and transaction hash
substreams gui realfun-token-stream@v0.5.0 ethcommon:all_callsfiltered_events reads from all_events and applies a filter on the event addresses and signatures.
Supported operators are: logical or ||, logical and && and parenthesis: ()
Addresses to match must be written as 0x-prefixed hexadecimal, lowercase, prefixed by evt_addr: and signatures by evt_sig:.
Example: (evt_addr:0x1234... || evt_addr:0x5678...) && evt_sig:0xdeadbeef...
substreams gui realfun-token-stream@v0.5.0 ethcommon:filtered_eventsfiltered_calls reads from all_calls and applies a filter on the called contract, the caller and the method 4-bytes signature
Supported operators are: logical or ||, logical and && and parenthesis: ()
Addresses to match must be written as 0x-prefixed hexadecimal, lowercase, prefixed by call_to: or call_from:, methods by call_method:.
Example: (call_to:0x1234... || call_from:0x1234...) && call_method:0xdeadbeef...
substreams gui realfun-token-stream@v0.5.0 ethcommon:filtered_callsfiltered_transactions reads from ethereum blocks and applies a filter on the events (addresses and signatures) as well as calls (from, to and method).
Supported operators are: logical or ||, logical and && and parenthesis: ()
Addresses and signatures to match must be written as 0x-prefixed hexadecimal, lowercase, prefixed by evt_addr:, evt_sig:, call_to:, call_from: or call_method:.
Example: ((evt_addr:0x1234... || evt_addr:0x5678...) && evt_sig:0xdeadbeef...) || call_to:0x01010101...
substreams gui realfun-token-stream@v0.5.0 ethcommon:filtered_transactionsfiltered_events_and_calls reads from all_calls and all_events, then applies a filter to extract the items that interest you, based on called contract, caller, call method, event address and event signature.
Supported operators are: logical or ||, logical and && and parenthesis: ()
Addresses and signatures to match must be written as 0x-prefixed hexadecimal, lowercase, prefixed by evt_addr:, evt_sig:, call_to:, call_from: or call_method:.
Example: evt_sig:0x9bb8f83800000000000000000000000000000000000000000000000000000000 || (call_method:0xa9059cbb && call_to:0xdac17f958d2ee523a2206206994597c13d831ec7)
substreams gui realfun-token-stream@v0.5.0 ethcommon:filtered_events_and_callssubstreams gui realfun-token-stream@v0.5.0 store_pairsindex_events sets the following keys on the block:
substreams gui realfun-token-stream@v0.5.0 ethcommon:index_eventsindex_calls sets the following keys on the block:
substreams gui realfun-token-stream@v0.5.0 ethcommon:index_callsindex_events_and_calls sets the following keys on the block:
substreams gui realfun-token-stream@v0.5.0 ethcommon:index_events_and_calls