Output
sf.substreams.sink.database.v1.DatabaseChanges

Package ref
clanker-substreams@v0.3.0Run package
CLI
Run db_out from the command line.
substreams run clanker-substreams@v0.3.0 db_out -e basesubstreams auth or directly on thegraph.market (see docs).README
High-performance blockchain indexer for Clanker token factory on Base, built with Substreams.
Clanker is a set of audited smart contracts on Base that create token markets rewarding token creators. Tokens are deployed via Farcaster, web interface, SDK, or direct contract interaction.
wasm32-unknown-unknown target# Install Rust wasm target
rustup target add wasm32-unknown-unknown
# Install substreams CLI (macOS)
brew install streamingfast/tap/substreams
# Authenticate
substreams auth
# Generate protobuf code and compile to WASM
substreams build
# Test with a small block range
substreams run -e base map_clanker_events -s 22520000 -t +1000
# Run with JSON output
substreams run -e base map_clanker_events -s 22520000 -t +1000 -o jsonl
# Create the database tables
psql -d your_database -f schema.sql
# Run the SQL sink
substreams-sink-sql run \
base \
"postgresql://user:pass@localhost:5432/clanker?sslmode=disable" \
substreams.yaml \
db_out
| Module | Type | Description |
|---|---|---|
map_clanker_events | Map | Extracts factory, airdrop, and auction events |
store_tokens | Store | Maintains registry of all Clanker tokens |
map_token_transfers | Map | ERC20 transfers for known Clanker tokens |
store_token_volume | Store | Accumulates transfer volume per token (BigInt) |
store_token_transfer_counts | Store | Tracks transfer counts per token |
store_creator_fees | Store | Accumulates fees claimed per creator |
store_creator_token_counts | Store | Counts tokens launched per creator |
store_airdrop_claims_per_token | Store | Tracks airdrop claim counts per token |
store_airdrop_volume_per_token | Store | Accumulates airdrop volume per token |
db_out | Map | Database sink output (PostgreSQL/ClickHouse) |
The Clanker factory address can be configured via params:
substreams run -e base map_clanker_events \
-p map_clanker_events="clanker_factory=0xe85a59c628f7d27878aceb4bf3b35733630083a9" \
-s 22520000 -t +1000
| Contract | Address |
|---|---|
| Clanker Factory (v4) | 0xE85A59c628F7d27878ACeB4bf3b35733630083a9 |
| ClankerAirdropV2 | 0xf652B3610D75D81871bf96DB50825d9af28391E0 |
| ClankerSniperAuctionV2 | 0xebB25BB797D82CB78E1bc70406b13233c0854413 |
clanker-substreams/
├── substreams.yaml # Manifest
├── schema.sql # SQL schema for sink
├── Cargo.toml # Rust dependencies
├── build.rs # ABI code generation
├── clanker.jpeg # Package icon
├── abi/
│ ├── clanker_factory.json # Factory ABI
│ └── clanker_token.json # Token ABI
├── proto/
│ └── clanker.proto # Protobuf schemas
└── src/
├── lib.rs # Module implementations
├── abi/
│ └── mod.rs # Generated ABI bindings
└── pb/ # Generated protobuf code (auto)
SELECT name, symbol, admin, block_timestamp
FROM tokens
WHERE block_timestamp > EXTRACT(EPOCH FROM NOW() - INTERVAL '24 hours')
ORDER BY block_timestamp DESC;
SELECT admin, COUNT(*) as token_count
FROM tokens
GROUP BY admin
ORDER BY token_count DESC
LIMIT 20;
SELECT recipient, amount, block_timestamp
FROM fee_claims
WHERE token = '0x...'
ORDER BY block_timestamp DESC;
MIT
Modules
Output
sf.substreams.sink.database.v1.DatabaseChanges
Output
clanker.v1.ClankerEventsInputs
Store value
int64
Update policy
add
Inputs
Store value
bigint
Update policy
add
Inputs
Store value
bigint
Update policy
add
Inputs
Store value
int64
Update policy
add
Inputs
Store value
int64
Update policy
add
Inputs
Store value
bigint
Update policy
add
Inputs
Store value
proto:clanker.v1.TokenUpdate policy
set
Inputs