
Real-time payment protocol analytics for Coinbase x402 on Base
Track every x402 payment settlement on Base. This Substreams detects when facilitators call transferWithAuthorization on USDC to settle HTTP 402 payments, extracting payer, recipient, amount, and facilitator data from each settlement.
v3.0.0 — Now gates EIP-3009 settlements through the on-chain FacilitatorRegistry, matching the x402-subgraph. Facilitator names, URLs, and active status are resolved from registry events.
The x402 protocol enables internet-native payments using the HTTP 402 status code. When a client wants to access a paid resource:
transferWithAuthorization on USDC to settle payment on-chainAuthorizationUsed + Transfer events| Module | Kind | Description |
|---|---|---|
map_facilitator_registry_events |
Map | Extracts FacilitatorAdded / FacilitatorRemoved events from the on-chain registry |
store_facilitator_registry |
Store | Maintains the set of registered facilitators with names and URLs |
map_x402_settlements |
Map | Pairs AuthorizationUsed + Transfer events, gated by facilitator registry |
store_payer_volume |
Store | Accumulates total USDC spent per payer |
store_payer_count |
Store | Counts payments per payer |
store_recipient_volume |
Store | Accumulates total USDC received per resource server |
store_recipient_count |
Store | Counts payments per recipient |
store_facilitator_volume |
Store | Accumulates total USDC volume per facilitator |
store_facilitator_count |
Store | Counts settlements per facilitator |
store_facilitator_gas |
Store | Tracks gas costs per facilitator |
store_first_seen |
Store | Records first-seen timestamp per payer, recipient, and 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 with name, URL, and active status from registry |
db_out |
Map | Outputs DatabaseChanges for PostgreSQL sink |
| Contract | Address | Events |
|---|---|---|
| USDC (Base) | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
AuthorizationUsed, Transfer |
| FacilitatorRegistry | 0x67C75c4FD5BbbF5f6286A1874fe2d7dF0024Ebe8 |
FacilitatorAdded, FacilitatorRemoved |
| x402ExactPermit2Proxy | 0x4020615294c913F045dc10f0a5cdEbd86c280001 |
Settled, SettledWithPermit |
| x402UptoPermit2Proxy | 0x4020633461b2895a48930Ff97eE8fCdE8E520002 |
Settled, SettledWithPermit |
# Stream settlements
substreams run x402-base-pulse map_x402_settlements \
-e base-mainnet.streamingfast.io:443 \
-s 29000000 -t +1000
# GUI mode
substreams gui x402-base-pulse map_x402_settlements \
-e base-mainnet.streamingfast.io:443 \
-s 29000000
# Sink to PostgreSQL
substreams-sink-sql run "psql://localhost/x402" \
x402-base-pulse-v3.0.0.spkg \
-e base-mainnet.streamingfast.io:443
| Table | Key | Description |
|---|---|---|
settlements |
tx_hash-log_index |
Every settlement with payer, recipient, amount, facilitator, gas |
payers |
payer_address |
Aggregated spend and payment count per payer |
recipients |
recipient_address |
Revenue and payment count per resource server |
facilitators |
facilitator_address |
Name, URL, active status, volume settled, settlement count, total gas spent |
| View | Description |
|---|---|
daily_stats |
Daily protocol-wide volume, unique participants, gas |
top_payers |
Ranked by total USDC spent |
top_recipients |
Ranked by total USDC received |
facilitator_economics |
Name, active status, volume settled vs gas cost per facilitator |
whale_payments |
Payments > $100 USDC |
recent_settlements |
Latest 100 settlements |
cargo build --target wasm32-unknown-unknown --release
substreams pack substreams.yaml
base-mainnet.streamingfast.io:443Extracts FacilitatorAdded and FacilitatorRemoved events from the on-chain FacilitatorRegistry contract. These events define which addresses are authorized x402 facilitators.
substreams gui x402-base-pulse@v3.0.0 map_facilitator_registry_eventsExtracts x402 payment settlements on Base by detecting EIP-3009 AuthorizationUsed events on the USDC contract. Filters EIP-3009 settlements to only include transactions where tx.from is a registered facilitator in the on-chain FacilitatorRegistry. Permit2 proxy settlements are self-identifying and not gated.
substreams gui x402-base-pulse@v3.0.0 map_x402_settlementsComputes real-time payer statistics by combining settlement data with accumulated store values.
substreams gui x402-base-pulse@v3.0.0 map_payer_statsComputes real-time recipient (resource server) revenue statistics.
substreams gui x402-base-pulse@v3.0.0 map_recipient_statsComputes facilitator economics: volume processed, gas spent, settlement count. Enriches with name and active status from the FacilitatorRegistry.
substreams gui x402-base-pulse@v3.0.0 map_facilitator_statsOutputs database changes for PostgreSQL sink. Tables: settlements, payers, recipients, facilitators
substreams gui x402-base-pulse@v3.0.0 db_outall_events gives you all the events in a block (from successful transactions), with basic block hash/number/timestamp and transaction hash
substreams gui x402-base-pulse@v3.0.0 ethcommon:all_eventsMaintains the set of registered facilitators with their names. Key: facilitator address (lowercase). Value: "name|url" or empty if removed. Uses set policy — FacilitatorRemoved overwrites with empty string.
substreams gui x402-base-pulse@v3.0.0 store_facilitator_registryAccumulates total payment volume per payer address. Key: {payer_address}
substreams gui x402-base-pulse@v3.0.0 store_payer_volumeCounts total payments per payer address. Key: {payer_address}
substreams gui x402-base-pulse@v3.0.0 store_payer_countAccumulates total revenue per recipient (resource server). Key: {recipient_address}
substreams gui x402-base-pulse@v3.0.0 store_recipient_volumeCounts total payments per recipient. Key: {recipient_address}
substreams gui x402-base-pulse@v3.0.0 store_recipient_countAccumulates total volume settled per facilitator. Key: {facilitator_address}
substreams gui x402-base-pulse@v3.0.0 store_facilitator_volumeCounts total settlements per facilitator. Key: {facilitator_address}
substreams gui x402-base-pulse@v3.0.0 store_facilitator_countAccumulates total gas spent per facilitator. Key: {facilitator_address}
substreams gui x402-base-pulse@v3.0.0 store_facilitator_gasRecords first-seen block timestamp per entity. Key: payer:{addr}, recipient:{addr}, facilitator:{addr}
substreams gui x402-base-pulse@v3.0.0 store_first_seenindex_events sets the following keys on the block:
substreams gui x402-base-pulse@v3.0.0 ethcommon:index_events