- BalanceUpdates (DWD) — per-event balance changes for a wallet
- TokenHolders (DWS) — current holder snapshots for a token
- WalletTokenPnL (DWS) — per-token profit & loss for a wallet
All examples below use
network: sol (Solana). Replace with eth, bsc, or polygon for other supported chains.How do I get a wallet’s token balances?
Get current token balances for a wallet. This query returns the latest balance update event for each token the wallet holds.Key fields
Key fields
| Field | Description |
|---|---|
BalanceUpdate.Currency.MintAddress | Token address |
BalanceUpdate.Account.Owner | Wallet owner address |
BalanceUpdate.PostBalance | Token balance after the update |
BalanceUpdate.PostBalanceInUSD | Balance value in USD |
Block.Time | Timestamp of the balance update |
Customization tips
Customization tips
- Increase limit: Set
count: 200to retrieve more tokens (wallets with many holdings) - Filter by value: Add
where: {BalanceUpdate: {PostBalanceInUSD: {gt: 1}}}to exclude dust balances
How do I get balance change history?
Track how a wallet’s balance for a specific token changes over time.Key fields
Key fields
| Field | Description |
|---|---|
BalanceUpdate.PreBalance | Balance before the event |
BalanceUpdate.PostBalance | Balance after the event |
BalanceUpdate.PostBalanceInUSD | Post-balance value in USD |
Block.Time | When the balance changed |
Transaction.Hash | Transaction that caused the change |
Customization tips
Customization tips
- Detect accumulation: Compare
PreBalanceandPostBalance— whenPostBalance > PreBalance, the wallet is accumulating - Time range: Add
where: {Block: {Time: {since: "2025-03-01T00:00:00Z"}}}to scope to a specific period - Larger history: Increase
countto up to10000for comprehensive balance history
The difference between
PostBalance and PreBalance shows the net change per event. A positive delta means tokens flowed in; a negative delta means tokens flowed out.How do I get a token’s top holders?
Get the top holders for a token, ranked by balance.Key fields
Key fields
| Field | Description |
|---|---|
Token.Address | Token address |
Holder.Address | Holder wallet address |
LatestBalance | Current token balance |
LatestBalanceUSD | Current balance in USD |
FirstSeen | When this holder first acquired the token |
LastSeen | Most recent transaction involving this token |
Customization tips
Customization tips
- Whale threshold: Add
where: {LatestBalanceUSD: {gt: 10000}}to only show large holders - Active holders: Add
where: {LastSeen: {after: "2025-03-01T00:00:00Z"}}to filter to recently active holders - Holder count: Use
countmetric to get the total number of holders
How do I get wallet profit and loss?
Get per-token profit and loss data for a wallet, including buy/sell volumes and trade counts.Key fields
Key fields
| Field | Description |
|---|---|
Wallet.Address | Wallet address |
Token.Address | Token address |
BuyVolumeUSDState | Total USD spent buying this token |
SellVolumeUSDState | Total USD received selling this token |
BuyCountState | Number of buy trades |
SellCountState | Number of sell trades |
FirstTradeState | Timestamp of the first trade |
LastTradeState | Timestamp of the most recent trade |
Customization tips
Customization tips
- Calculate PnL:
SellVolumeUSDState - BuyVolumeUSDStategives the realized PnL for each token - Active positions: Filter for tokens where
SellCountState < BuyCountStateto find tokens the wallet is still holding - High-activity tokens: Sort by
BuyCountStateorSellCountStateto find the most frequently traded tokens
The WalletTokenPnL Cube uses the
walletAddress selector (not ownerAddress). It provides cumulative trading metrics — ideal for portfolio analysis and performance leaderboards.Multi-Chain Examples
- Solana
- Ethereum
- BSC
- Polygon
Next Steps
DEX Trades
Query DEX trading data — token trades, wallet activity, and top traders.
Transfers
Track on-chain token transfers between wallets.
Pools & Liquidity
Explore DEX pool and liquidity data.
OHLC & Statistics
Fetch candlestick data, trade stats, TokenSupplyUpdates, and token metadata.

