Recipes for stablecoin payment analytics on the stablecoins.intelligence schema
These recipes run against the stablecoins.intelligence schema. Where a query is meant for
quick evaluation, it uses the broadly-shared enriched_transfers_last_30d view; swap in the
full enriched_transfers table (gated) for full-history analysis.
Stablecoin volume narrows sharply from raw transfers to real-world payments. The pipeline
exposes each stage so you can measure the drop-off:
Stage
Table
Filter
Raw
enriched_transfers
none
Adjusted
enriched_transfers
is_adjusted_volume
Organic intent
organic_activity_classification
transaction_type
Payment mix
payment_categorization
(real-world payments only)
Most stablecoin volume is trading / investment, not payments — real-world payments are a
minority slice of organic volume. Use is_adjusted_volume and transaction_type = 'Real-World Payment' to isolate genuine payment activity.
SELECT DATE_TRUNC('day', block_timestamp) AS day, SUM(usd_amount) AS adjusted_volumeFROM stablecoins.intelligence.enriched_transfers_last_30dWHERE is_adjusted_volumeGROUP BY 1ORDER BY 1;
SELECT transaction_type, COUNT(*) AS transfers, SUM(usd_amount) AS volume_usd, ROUND(100 * SUM(usd_amount) / SUM(SUM(usd_amount)) OVER (), 1) AS pct_of_volumeFROM stablecoins.intelligence.organic_activity_classificationWHERE activity_date >= CURRENT_DATE - 30GROUP BY 1ORDER BY 3 DESC;
SELECT CASE WHEN core_payment_category IN ('B2B Payment', 'I2B Payment', 'Institutional Payment') THEN 'B2B' WHEN core_payment_category = 'B2C Payment' THEN 'B2C' WHEN core_payment_category = 'C2B Payment' THEN 'C2B' WHEN core_payment_category = 'C2C Payment' THEN 'C2C' END AS bucket, SUM(usd_amount) AS volume_usd, COUNT(DISTINCT transaction_hash) AS paymentsFROM stablecoins.intelligence.payment_categorizationWHERE activity_date >= CURRENT_DATE - 30 AND core_payment_category IN ( 'B2B Payment', 'I2B Payment', 'Institutional Payment', 'B2C Payment', 'C2B Payment', 'C2C Payment' )GROUP BY 1ORDER BY 2 DESC;
SELECT core_payment_category, payment_purpose, COUNT(*) AS payment_count, SUM(usd_amount) AS total_usd, AVG(usd_amount) AS avg_payment_sizeFROM stablecoins.intelligence.payment_categorizationWHERE activity_date >= CURRENT_DATE - 30GROUP BY 1, 2ORDER BY 4 DESC;
SELECT DATE_TRUNC('month', activity_date) AS month, COUNT(*) AS payroll_payments, SUM(usd_amount) AS payroll_usdFROM stablecoins.intelligence.payment_categorizationWHERE payment_purpose = 'Salary/Payroll' AND activity_date >= CURRENT_DATE - 180GROUP BY 1ORDER BY 1;
Wallets accumulating stablecoins rather than spending them:
SELECT chain, COUNT(*) AS transfers, SUM(usd_amount) AS volume_usdFROM stablecoins.intelligence.organic_activity_classificationWHERE transaction_type = 'Store as Value' AND activity_date >= CURRENT_DATE - 30GROUP BY 1ORDER BY 3 DESC;