Package Logo
clanker_substreams
clanker_substreams@v0.3.0
Total Downloads
6
Published
11 hours ago
Network
base base
Publisher
User Avatar PaulieB14

Readme

Clanker Substreams

High-performance blockchain indexer for Clanker token factory on Base, built with Substreams.

What is Clanker?

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.

What This Indexes

  • Token Launches - All new Clanker tokens with full metadata
  • Fee Claims - Creator and team reward distributions
  • Extensions - Airdrop, presale, and other extension triggers
  • Metadata Updates - Token image and metadata changes
  • Verifications - Token verification events
  • Transfers - ERC20 transfers for all Clanker tokens
  • Airdrop Claims - Individual airdrop claims from ClankerAirdropV2
  • MEV Auctions - Auction wins from ClankerSniperAuctionV2

Prerequisites

Quick Start

1. Install Dependencies

# Install Rust wasm target
rustup target add wasm32-unknown-unknown

# Install substreams CLI (macOS)
brew install streamingfast/tap/substreams

# Authenticate
substreams auth

2. Build

# Generate protobuf code and compile to WASM
substreams build

3. Run

# 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

4. Deploy to SQL Database

# 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

Modules

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)

Configuration

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 Addresses (Base v4)

Contract Address
Clanker Factory (v4) 0xE85A59c628F7d27878ACeB4bf3b35733630083a9
ClankerAirdropV2 0xf652B3610D75D81871bf96DB50825d9af28391E0
ClankerSniperAuctionV2 0xebB25BB797D82CB78E1bc70406b13233c0854413

Project Structure

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)

Example Queries

Get all tokens launched in last 24 hours

SELECT name, symbol, admin, block_timestamp
FROM tokens
WHERE block_timestamp > EXTRACT(EPOCH FROM NOW() - INTERVAL '24 hours')
ORDER BY block_timestamp DESC;

Get top creators by token count

SELECT admin, COUNT(*) as token_count
FROM tokens
GROUP BY admin
ORDER BY token_count DESC
LIMIT 20;

Get fee claims for a token

SELECT recipient, amount, block_timestamp
FROM fee_claims
WHERE token = '0x...'
ORDER BY block_timestamp DESC;

Resources

License

MIT

Documentation

Modules

Maps icon
Maps

map
map_clanker_events

d889398acb2d84005a1b23a779d682ecaa70a0d0
map map_clanker_events (
paramsstring
blocksf.ethereum.type.v2.Block
)  -> clanker.v1.ClankerEvents
Default param : clanker_factory=0xe85a59c628f7d27878aceb4bf3b35733630083a9
substreams gui clanker-substreams@v0.3.0 map_clanker_events

map
map_token_transfers

0e06a932d33f235b6e08b3b6ae2acee06109f832
substreams gui clanker-substreams@v0.3.0 map_token_transfers

map
db_out

99ea238fade221175593197481e24938e3d4598c
substreams gui clanker-substreams@v0.3.0 db_out
Stores icon
Stores

store
store_tokens

9a134fca3efbc891648c909535ea71153858111c
substreams gui clanker-substreams@v0.3.0 store_tokens

store
store_token_volume

8a2a5903efea48ed5ee8b61b96674aeb37cf7ef1
store <add,bigint> store_token_volume (
)
substreams gui clanker-substreams@v0.3.0 store_token_volume

store
store_token_transfer_counts

30da1ccb5f3df5e790d1a804ca1666f0a656308d
store <add,int64> store_token_transfer_counts (
)
substreams gui clanker-substreams@v0.3.0 store_token_transfer_counts

store
store_creator_fees

0c7b90fe22ad2ce72aa31e3cd2dc6d1258039327
store <add,bigint> store_creator_fees (
)
substreams gui clanker-substreams@v0.3.0 store_creator_fees

store
store_creator_token_counts

b8f4b1792f662b0cf1f074a88f0ab98310b1ce18
store <add,int64> store_creator_token_counts (
)
substreams gui clanker-substreams@v0.3.0 store_creator_token_counts

store
store_airdrop_claims_per_token

7552aeac8d885a2bc21410c7f1eb10f916c5b9a3
store <add,int64> store_airdrop_claims_per_token (
)
substreams gui clanker-substreams@v0.3.0 store_airdrop_claims_per_token

store
store_airdrop_volume_per_token

4616b9ac4705bd21c69be0a1d141e598151b318c
store <add,bigint> store_airdrop_volume_per_token (
)
substreams gui clanker-substreams@v0.3.0 store_airdrop_volume_per_token
Protobuf

Protobuf Docs Explorer

sf.ethereum.transform.v1
sf.ethereum.type.v2
sf.ethereum.substreams.v1
clanker.v1