Use Case
You want to stream only USDC transfers on Base Mainnet into Postgres, with amounts converted from raw units to human-readable values. This is useful for compliance monitoring, whale watching, or building token-specific analytics.Pipeline Configuration
Create a new pipeline
In the GoldRush Platform, navigate to Manage Pipelines and click Create Pipeline. Name it
usdc-whale-watch.Select your source
Choose Base Mainnet as the chain and Transfers as the data type. This streams every token and native transfer on Base.
Add a SQL transform
Filter to USDC transfers only and convert the raw amount to a human-readable decimal value. USDC on Base has 6 decimals:
How the Transform Works
The SQL transform runs inside the pipeline, before data reaches your database:- WHERE clause filters to only transfers where the
contract_addressmatches USDC on Base - CAST and arithmetic converts the raw
amount(stored as a string of the integer value in smallest units) to aDOUBLEdivided by 10^6 - SELECT projects only the columns you need, reducing storage
Verify Data
Extending to Multiple Tokens
To track multiple tokens, expand the WHERE clause with an IN filter:Production Tips
- Batch size: A smaller batch size (500) is appropriate here because the SQL transform filters out most records, resulting in lower write throughput to the destination.
- Indexing: Add indexes on
from_address,to_address, andamount_usdcfor common query patterns. - Alerting: Combine this pipeline with a simple cron job or application query to trigger alerts when
amount_usdcexceeds a threshold.