Package Logo
peridot-spl-token
peridot-spl-token@v0.2.2
Total Downloads
2
Published
20 hours ago
Publisher
User Avatar joshschcom

Readme

peridot Substreams modules

This package was initialized via substreams init, using the sol-minimal template, and has been extended to include mappers for SPL Token, Wormhole, and Metaplex Token Metadata events.

Usage

substreams build
substreams auth
substreams gui       			  # Get streaming!

Optionally, you can publish your Substreams to the Substreams Registry.

substreams registry login         # Login to substreams.dev
substreams registry publish       # Publish your Substreams to substreams.dev

Modules

This Substream is designed to extract and structure data related to SPL Tokens, Wormhole bridge interactions, and Metaplex Token Metadata from the Solana blockchain.

Filter Modules (Inputs)

Several modules are used to pre-filter transactions based on program IDs:

  • map_filtered_transactions: Retrieves Solana transactions filtered for the SPL Token Program ID (TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA). This serves as input for map_spl_mint_burn.
  • map_filtered_wormhole_transactions: Retrieves Solana transactions filtered for the Wormhole Program ID (e.g., 3u8hJhpWcB8GfnpnLCuRztPD6qgqbtT6NBKMLVMqYc6N on Devnet). This serves as input for map_wormhole_events.
  • map_filtered_metaplex_transactions: Retrieves Solana transactions filtered for the Metaplex Token Metadata Program ID (metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s). This serves as input for map_metaplex_events.

These modules utilize the solana:transactions_by_programid_without_votes Substream imported as solana. Transactions containing voting instructions are excluded.

Data Mapping Modules

  • map_spl_mint_burn

    • Input: map_filtered_transactions
    • Output: proto:spl_token.v1.MintOrBurnEvents
    • Description: This module processes transactions from the SPL Token program, specifically identifying and decoding MintTo and Burn instructions. It extracts details like mint account, token account, authority, and amount.
  • map_wormhole_events

    • Input: map_filtered_wormhole_transactions
    • Output: proto:wormhole.v1.WormholeEvents
    • Description: This module focuses on interactions with the Wormhole bridge program. It decodes instructions like PostMessage and PostVAA, extracting data such as emitter, payload, consistency level, and VAA details.
  • map_metaplex_events

    • Input: map_filtered_metaplex_transactions
    • Output: proto:peridot.metaplex.v1.MetaplexEvents
    • Description: This module processes transactions interacting with the Metaplex Token Metadata program. It identifies and decodes instructions for creating (CreateMetadataAccountV3) and updating (UpdateMetadataAccountV2) token metadata. It extracts metadata details like name, symbol, URI, creators, collection information, and mutability status.

Documentation

Modules

Maps icon
Maps

map
map_filtered_transactions

11b51c51e86ff61689faa9e6f6a9f95de9bcf956
map map_filtered_transactions (
paramsstring
solana:v030:blocks_without_votessf.solana.type.v1.Block
)  -> sf.substreams.solana.v1.Transactions
Default param : program:metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
substreams gui peridot-spl-token@v0.2.2 map_filtered_transactions

map
map_spl_mint_burn

343d3c28e8524e1cb35798554e914d5a191bf7fe
substreams gui peridot-spl-token@v0.2.2 map_spl_mint_burn

map
map_filtered_wormhole_transactions

11b51c51e86ff61689faa9e6f6a9f95de9bcf956
Default param : program:metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
substreams gui peridot-spl-token@v0.2.2 map_filtered_wormhole_transactions

map
map_wormhole_events

92bb38906a9b23daebeb9125d3bd3675188a2c17
substreams gui peridot-spl-token@v0.2.2 map_wormhole_events

map
map_filtered_metaplex_transactions

11b51c51e86ff61689faa9e6f6a9f95de9bcf956
Default param : program:metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s
substreams gui peridot-spl-token@v0.2.2 map_filtered_metaplex_transactions

map
map_metaplex_events

1603d8ad5ca3cc3625bba0d7f344e61c2b105f84
substreams gui peridot-spl-token@v0.2.2 map_metaplex_events

map
solana:v030:blocks_without_votes

0be93a73c65aa8ec2de4b1a47209edeea493ff29
map solana:v030:blocks_without_votes (
)  -> sf.solana.type.v1.Block
substreams gui peridot-spl-token@v0.2.2 solana:v030:blocks_without_votes

map
solana:v030:v020:blocks_without_votes

0be93a73c65aa8ec2de4b1a47209edeea493ff29
map solana:v030:v020:blocks_without_votes (
)  -> sf.solana.type.v1.Block

blocks_without_votes allows you to consume a full Solana Block without Vote instructions (Vote111111111111111111111111111111111111111). If you consume it on HISTORICAL data (+1000 blocks from HEAD), you will be reading from the StreamingFast cache, thus saving costs on the amount of TB read.

substreams gui peridot-spl-token@v0.2.2 solana:v030:v020:blocks_without_votes
Block Indexes icon
Block Indexes

blockIndex
solana:v030:program_ids_without_votes

811466d12743a8b02be8ba6649cfa9a24aa1af62
blockIndex solana:v030:program_ids_without_votes (
)  -> sf.substreams.index.v1.Keys
substreams gui peridot-spl-token@v0.2.2 solana:v030:program_ids_without_votes
Protobuf

Protobuf Docs Explorer

wormhole.v1
peridot.metaplex.v1
spl_token.v1
sol.instructions.v1
sol.transactions.v1
sf.solana.type.v1