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

Package ref
x402-solana-pulse@v1.1.0Run package
CLI
Run db_out from the command line.
substreams run x402-solana-pulse@v1.1.0 db_out -e solanasubstreams auth or directly on thegraph.market (see docs).README
Real-time payment protocol analytics for Coinbase x402 on Solana
Track every x402 payment settlement on Solana. This Substreams detects when facilitators sponsor SPL Token TransferChecked settlements for HTTP 402 payments, extracting payer, recipient, mint, amount, facilitator, and memo from each transaction.
Companion to x402-base-pulse — same model, Solana native.
The x402 protocol enables internet-native payments using the HTTP 402 status code. The Solana settlement path is defined by the SVM exact scheme:
TransferChecked to the resource server's ATA, signs it, and returns the partially-signed txfeePayer signature, and submits it to SolanaTransferChecked + SPL Memo instructionSolana has no on-chain FacilitatorRegistry. Instead, x402 settlements are identified by three signals observed together in a transaction:
TransferChecked instructionfee_payer is distinct from the TransferChecked authority — i.e. the facilitator sponsors, the payer signs| Module | Kind | Description |
|---|---|---|
map_x402_settlements | Map | Detects x402 settlements in each Solana block and extracts payer / recipient / mint / amount / facilitator / memo |
store_payer_volume | Store | Accumulates total amount spent per payer pubkey |
store_payer_count | Store | Counts payments per payer |
store_recipient_volume | Store | Accumulates total received per resource server (ATA owner) |
store_recipient_count | Store | Counts payments per recipient |
store_facilitator_volume | Store | Accumulates volume settled per facilitator |
store_facilitator_count | Store | Counts settlements per facilitator |
store_facilitator_fees | Store | Accumulates tx fees (lamports) paid per facilitator |
store_first_seen | Store | Records first-seen block timestamp per payer / recipient / facilitator |
map_payer_stats | Map | Computes payer leaderboards and averages |
map_recipient_stats | Map | Computes resource server revenue stats |
map_facilitator_stats | Map | Computes facilitator economics (volume, fees, counts) |
db_out | Map | Outputs DatabaseChanges for the PostgreSQL sink |
| Program | Pubkey |
|---|---|
| SPL Token | TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA |
| SPL Token-2022 | TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb |
| SPL Memo v2 | MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr |
| SPL Memo v1 | Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo |
# Stream settlements
substreams run x402-solana-pulse map_x402_settlements \
-e mainnet.sol.streamingfast.io:443 \
-s 280000000 -t +1000
# GUI mode
substreams gui x402-solana-pulse map_x402_settlements \
-e mainnet.sol.streamingfast.io:443 \
-s 280000000
# Sink to PostgreSQL
substreams-sink-sql run "psql://localhost/x402" \
x402-solana-pulse-v1.0.0.spkg \
-e mainnet.sol.streamingfast.io:443
| Table | Key | Description |
|---|---|---|
settlements | signature-instruction_index | Every settlement with payer, recipient, mint, amount, facilitator, fee, memo |
payers | payer_address | Aggregated spend and payment count per payer pubkey |
recipients | recipient_address | Revenue and payment count per resource server |
facilitators | facilitator_address | Volume settled, settlement count, lamport fees per facilitator |
| View | Description |
|---|---|
daily_stats | Daily protocol-wide volume, unique participants, fees |
top_payers | Ranked by total spend |
top_recipients | Ranked by total revenue |
facilitator_economics | Volume settled vs fee cost per facilitator |
whale_payments | Payments ≥ 100 USDC (atomic units) |
recent_settlements | Latest 100 settlements |
cargo build --target wasm32-unknown-unknown --release
substreams pack substreams.yaml
mainnet.sol.streamingfast.io:443Modules
Output
sf.substreams.sink.database.v1.DatabaseChanges
Output
x402.v1.FacilitatorStatsOutput
x402.v1.PayerStatsOutput
x402.v1.RecipientStatsExtracts x402 payment settlements on Solana by detecting the SVM `exact` scheme settlement shape: a transaction that contains an SPL Token (or Token-2022) TransferChecked instruction paired with an SPL Memo instruction, where the transaction fee payer is distinct from the TransferChecked authority (the facilitator sponsors, the payer signs). Per the x402 SVM exact scheme: https://github.com/coinbase/x402/blob/main/specs/schemes/exact/scheme_exact_svm.md
Output
x402.v1.SettlementsInputs
Store value
int64
Update policy
add
Inputs
Accumulates total tx fees (lamports) spent per facilitator. Key: {facilitator_pubkey}
Store value
bigint
Update policy
add
Inputs
Accumulates total volume settled per facilitator. Key: {facilitator_pubkey}
Store value
bigint
Update policy
add
Inputs
Records first-seen block timestamp per entity. Key: payer:{p}, recipient:{r}, facilitator:{f}
Store value
int64
Update policy
set_if_not_exists
Inputs
Store value
int64
Update policy
add
Inputs
Store value
bigint
Update policy
add
Inputs
Store value
int64
Update policy
add
Inputs
Store value
bigint
Update policy
add
Inputs