ERC20 Token Transfers API
Track and analyze ERC20 token transfers across the Ethereum blockchain in real-time and historically. Monitor token movements, analyze transfer volumes, track wallet activity, and build comprehensive token transfer analytics using Bitquery's ERC20 Token Transfers API.
What are ERC20 Token Transfers?
ERC20 is the most widely adopted token standard on Ethereum, enabling fungible tokens that can be transferred between addresses. ERC20 token transfers represent the movement of tokens from one wallet to another, forming the foundation of DeFi, trading, and token-based applications.
Understanding ERC20 transfers is essential for:
- Portfolio Tracking: Monitor token movements in and out of wallets
- Tax & Accounting: Generate comprehensive transfer reports for crypto tax calculations, cost basis tracking, and token accounting reconciliation
- Compliance & Auditing: Track token flows for regulatory requirements
- DeFi Analytics: Analyze liquidity movements and protocol interactions
- Token Analytics: Understand token distribution and holder behavior
- Security Monitoring: Detect suspicious transfers and wallet activity
🔗 Related APIs
Ethereum APIs
- Ethereum Balance API - Get wallet balances for ERC20, ERC721, and ERC1155 tokens
- Ethereum Transaction Balance Tracker - Track real-time balance changes with reason codes
- Ethereum Token Holders API - Get top token holders and distribution data
- Ethereum Token Supply API - Track total supply and supply changes
- Ethereum DEX Trades API - Monitor DEX trading activity
- Ethereum Transactions API - Get comprehensive transaction data
- Ethereum Events API - Query smart contract events
EVM APIs
- EVM Transfers API - General EVM token transfers documentation
- EVM Balance Updates API - Track balance changes across EVM chains
- EVM DEX Trades API - DEX trading data across EVM chains
NFT & Other Token Standards
- NFT Transfer API - Track ERC721 and ERC1155 NFT transfers
- RWA Token API - Real World Asset token transfers
Solana APIs
- Solana Transfers API - Track SPL token transfers and SOL transfers on Solana
- Solana Balance Updates API - Monitor Solana wallet balance changes
- Solana DEX Trades API - Track Solana DEX trading activity
📋 Table of Contents
- Get Latest ERC20 Token Transfers - Query recent token transfers
- Subscribe to Real-Time Transfers - WebSocket subscriptions for live data
- Filter by Sender or Receiver - Query transfers involving specific addresses
- Transfer Volume Analysis - Calculate sent and received volumes
- Top Transfers - Get largest token transfers
- Earliest Transfer Tracking - Find first transfers to addresses
- Use Cases - Common applications and examples
- API Response Fields - Complete field reference
Get Latest ERC20 Token Transfers
Query the most recent ERC20 token transfers for any token on Ethereum. This example retrieves the latest USDT (Tether) token transfers. The contract address for USDT is 0xdac17f958d2ee523a2206206994597c13d831ec7.
You can run this query here.
{
EVM(dataset: realtime, network: eth) {
Transfers(
where: {
Transfer: {
Currency: {
SmartContract: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }
}
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Transfer {
Amount
Currency {
Name
Symbol
}
Receiver
Sender
Type
}
}
}
}
Common ERC20 Token Addresses (Ethereum):
| Token | Contract Address | Symbol |
|---|---|---|
| USDT | 0xdac17f958d2ee523a2206206994597c13d831ec7 | USDT |
| USDC | 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 | USDC |
| WETH | 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2 | WETH |
| DAI | 0x6b175474e89094c44da98b954eedeac495271d0f | DAI |
| LINK | 0x514910771af9ca656af840dff83e8264ecf986ca | LINK |
Query Multiple Tokens in a Single Query
Query transfers for multiple ERC20 tokens simultaneously using the in operator. This is useful for monitoring multiple tokens at once, building portfolio trackers that track several tokens, or analyzing transfers across a token basket.
The example below queries transfers for USDT, USDC, WETH, and native ETH (0x represents native ETH) in a single request:
{
EVM(dataset: realtime, network: eth) {
Transfers(
where: {
Transfer: {
Currency: {
SmartContract: {
in: [
"0xdac17f958d2ee523a2206206994597c13d831ec7"
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
"0x"
]
}
}
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Transfer {
Amount
Currency {
Name
Symbol
}
Receiver
Sender
Type
}
}
}
}
Use Cases:
- Monitor multiple stablecoins simultaneously (USDT, USDC, DAI)
- Track transfers for a portfolio of tokens
- Analyze token movements across a token basket
- Build multi-token dashboards and analytics
Query Any EVM Network: Change the network parameter to query token transfers on other EVM-compatible blockchains:
eth- Ethereum Mainnetbsc- BNB Smart Chain (BSC)base- Base L2arbitrum- Arbitrum Onematic- Polygon PoSoptimism- Optimism L2
Example for BSC:
{
EVM(dataset: realtime, network: bsc) {
Transfers(
where: {
Transfer: {
Currency: {
SmartContract: {
in: ["0x55d398326f99059fF775485246999027B3197955"] // USDT on BSC
}
}
}
}
limit: { count: 10 }
) {
Transfer {
Amount
Currency { Name Symbol }
Sender
Receiver
}
}
}
}
Solana Token Transfers: For SPL token transfers on Solana, see our Solana Transfers API documentation.
Subscribe to Real-Time ERC20 Token Transfers
Monitor ERC20 token transfers in real-time using GraphQL subscriptions. This is ideal for building live dashboards, alert systems, and real-time analytics applications.
This example subscribes to WETH (Wrapped Ethereum) token transfers. The contract address is 0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.
You can test this subscription here.
subscription {
EVM(network: eth, trigger_on: head) {
Transfers(
where: {
Transfer: {
Currency: {
SmartContract: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }
}
}
}
orderBy: { descending: Block_Time }
) {
Transaction {
Hash
}
Transfer {
Amount
Currency {
Name
Symbol
}
Receiver
Sender
Type
}
}
}
}
For more information on setting up real-time subscriptions, see our GraphQL Subscriptions documentation.
Filter by Sender or Receiver
Query transfers where a specific address is either the sender or receiver. This uses the any filter to implement OR logic, allowing you to find all transfers involving a particular address regardless of direction.
You can find the query here.
query MyQuery {
EVM(dataset: archive, network: eth) {
Transfers(
where: {
any: [
{
Transfer: {
Sender: { is: "0x881d40237659c251811cec9c364ef91dc08d300c" }
}
}
{
Transfer: {
Receiver: { is: "0x881d40237659c251811cec9c364ef91dc08d300c" }
}
}
]
Block: { Number: { eq: "23814227" } }
}
limit: { count: 100 }
orderBy: { descending: Block_Time }
) {
Transfer {
Amount
Sender
Receiver
Currency {
Symbol
Name
}
}
Transaction {
Hash
From
To
Index
}
Block {
Number
Time
}
}
}
}
Addresses That Sent or Received from Multiple Addresses
Find addresses that have interacted with multiple addresses from a given list. This query uses the array_intersect function to identify addresses that have sent or received funds to/from every address in your list.
You can run the query here.
query ($addresses: [String!]) {
EVM(dataset: archive) {
Transfers(
where: {
any: [
{ Transfer: { Sender: { in: $addresses } } }
{ Transfer: { Receiver: { in: $addresses } } }
]
Block: { Date: { after: "2024-04-01" } }
}
) {
array_intersect(
side1: Transfer_Sender
side2: Transfer_Receiver
intersectWith: $addresses
)
}
}
}
Variables:
{
"addresses": [
"0x21743a2efb926033f8c6e0c3554b13a0c669f63f",
"0x107f308d85d5481f5b729cfb1710532500e40217"
]
}
Learn more about the array_intersect function in our Array Intersect documentation.
Transfer Volume Analysis (Sent and Received)
Calculate the total amount of tokens sent and received by a specific address for a particular token over a time period. This is essential for portfolio analysis, tax reporting, and wallet analytics.
You can run this query here.
query MyQuery($address: String, $token: String) {
EVM {
Transfers(
where: {
Block: { Time: { since_relative: { years_ago: 1 } } }
Transfer: {
Currency: { SmartContract: { is: $token } }
any: [
{ Transfer: { Sender: { is: $address } } }
{ Transfer: { Receiver: { is: $address } } }
]
}
}
) {
Sent: sum(
of: Transfer_Amount
if: { Transfer: { Sender: { is: $address } } }
)
Received: sum(
of: Transfer_Amount
if: { Transfer: { Receiver: { is: $address } } }
)
}
}
}
Variables:
{
"address": "0x782c362fbf71f939445e6902a064f7e9384f47e2",
"token": "0x"
}
Use "0x" as the token address to query native ETH transfers. For ERC20 tokens, use the token's contract address.
Top Transfers of a Token
Retrieve the largest token transfers for any ERC20 token. This is useful for identifying whale movements, large transactions, and significant token flows.
Try the query here.
query MyQuery {
EVM(dataset: archive) {
Transfers(
where: {
Transfer: {
Currency: {
SmartContract: { is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2" }
}
}
TransactionStatus: { Success: true }
Block: { Date: { is: "2024-06-29" } }
}
orderBy: { descending: Block_Time }
limit: { count: 10 }
) {
Transfer {
Amount
AmountInUSD
Currency {
Name
Symbol
SmartContract
}
Success
Sender
Receiver
Index
Id
}
Transaction {
To
Hash
Value
Type
GasPrice
Gas
From
Cost
}
Log {
Signature {
Signature
Name
}
SmartContract
}
Call {
From
To
Value
Signature {
Name
}
}
Block {
Number
Time
}
}
}
}
Earliest Transfer to a Wallet
Find the first transfer ever received by a specific wallet address. This is useful for wallet age analysis, first transaction tracking, and onboarding analytics.
query MyQuery {
EVM(network: eth, dataset: archive) {
Transfers(
limit: { count: 1 }
where: {
Transfer: {
Receiver: { is: "0xe37b87598134a2fc0Eda4d71a3a80ad28C751Ed7" }
}
}
) {
Block {
Time(minimum: Block_Number)
}
Transaction {
From
Hash
}
Transfer {
Amount
Currency {
Native
}
}
}
}
}
Use Cases
1. Portfolio Tracking & Analytics
Track all token transfers for a wallet to build comprehensive portfolio dashboards:
- Monitor incoming and outgoing transfers
- Calculate total sent/received volumes
- Track transfer history over time
- Build transaction timelines
Related APIs:
- Ethereum Balance API - Get current wallet balances
- Transaction Balance Tracker - Real-time balance updates
2. Tax & Accounting
Generate comprehensive transfer reports for tax calculations, accounting reconciliation, and financial reporting:
Tax Use Cases:
- Calculate capital gains/losses from token transfers
- Track cost basis for tax reporting (FIFO, LIFO, or specific identification)
- Generate Form 8949 compatible reports
- Calculate realized gains/losses by token and date
- Export transfer history for tax software integration
Accounting Use Cases:
- Reconcile token movements with accounting records
- Track transfer volumes by token and time period
- Generate audit trails for financial statements
- Calculate token balances from transfer history
- Export CSV/JSON reports for accounting systems
Key Features:
- Export all transfers for a wallet with timestamps
- Calculate transfer volumes by token
- Track transfer dates and USD values
- Generate comprehensive CSV/JSON reports
- Filter transfers by date ranges for tax periods
3. DeFi Protocol Analytics
Analyze token flows in and out of DeFi protocols:
- Monitor liquidity movements
- Track protocol token distributions
- Analyze user deposit/withdrawal patterns
- Measure protocol adoption
Related APIs:
- Ethereum DEX Trades API - Track DEX trading activity
- Ethereum Events API - Monitor smart contract events
4. Token Distribution Analysis
Understand how tokens are distributed across addresses:
- Track token holder changes
- Analyze concentration metrics
- Monitor whale movements
- Identify distribution patterns
Related APIs:
- Token Holders API - Get top holders
- Token Supply API - Track supply changes
5. Security & Fraud Detection
Monitor transfers for suspicious activity:
- Detect large unexpected transfers
- Track transfers to known scam addresses
- Monitor wallet activity patterns
- Set up real-time alerts
6. Wallet Analytics
Build comprehensive wallet analysis tools:
- Calculate wallet age (earliest transfer)
- Track transfer frequency
- Analyze token diversity
- Monitor wallet activity levels
API Response Fields
| Field | Description |
|---|---|
Transfer.Amount | Amount of tokens transferred |
Transfer.AmountInUSD | Transfer amount in USD (if available) |
Transfer.Sender | Address that sent the tokens |
Transfer.Receiver | Address that received the tokens |
Transfer.Currency.Name | Token name (e.g., "Tether USD") |
Transfer.Currency.Symbol | Token symbol (e.g., "USDT") |
Transfer.Currency.SmartContract | Token contract address |
Transfer.Success | Whether the transfer was successful |
Transfer.Type | Type of transfer (e.g., "call") |
Transaction.Hash | Transaction hash |
Transaction.From | Transaction sender address |
Transaction.To | Transaction recipient address |
Block.Number | Block number |
Block.Time | Block timestamp |
Best Practices
-
Use Appropriate Datasets:
realtimefor recent data (last 8 hours)archivefor historical datacombinedfor comprehensive queries
-
Filter by Token Contract: Always filter by
SmartContractaddress when querying specific tokens to improve performance. -
Use Limit and OrderBy: Always specify
limitandorderByto control result size and ordering. -
Handle Large Result Sets: For large queries, use pagination or time-based filters to avoid timeouts.
-
Subscribe for Real-Time Data: Use GraphQL subscriptions for live monitoring instead of polling.
-
Combine with Other APIs: Enhance transfer data with balance, transaction, and event APIs for comprehensive analytics.
Getting Started
- Get API Access: Sign up at Bitquery to get your API key
- Try in IDE: Test queries in the Bitquery IDE
- Read Documentation: Explore our Getting Started Guide
- Check Examples: See more examples in Starter Queries
For more information on authentication and API usage, see our Authorization Guide.