Skip to main content
The On-Chain Agent queries a Solana wallet’s token transfer history through the Helius API and filters for transfers that exceed whale thresholds — 100 SOL or 1,000,000 SPL token units by default. It separates inbound from outbound whale transfers and totals each side so you can assess accumulation or distribution pressure at a glance.

Requirements

You need a Helius API key to use this agent. Get one at helius.dev and set it in your environment:
You can also pass the key directly as the api_key parameter. If the key is absent, the agent raises a HeliusAPIError rather than returning partial data.

CLI usage

Pass a Solana wallet address as the only argument:
Example using the default demo wallet:

Python usage

get_whale_activity_summary()

Fetches token transfers for the given wallet via Helius, applies whale threshold filters, and returns a summary with separate inbound and outbound lists and running totals. Signature

Parameters

string
required
Base58-encoded Solana wallet address to inspect.
number
default:"100"
Maximum number of token transfers to fetch from Helius. Clamped to the range 1–100 by the underlying collector.
number
default:"100.0"
Minimum SOL amount (in SOL, not lamports) for a native SOL transfer to be classified as a whale transfer. Transfers below this value are excluded from the results.
number
default:"1000000.0"
Minimum SPL token amount for a non-SOL token transfer to be classified as a whale transfer. The amount is compared against the raw token units returned by Helius.
string
Helius API key. If omitted, the function reads HELIUS_API_KEY from the environment. Raises HeliusAPIError if neither is present.

Threshold logic

Transfers are classified using the mint address to distinguish SOL from SPL tokens:
  • SOL transfers: mint equals So11111111111111111111111111111111111111112 → compared against sol_threshold
  • All other mints → compared against token_threshold

Return value

Returns dict[str, Any].
string
required
The wallet address that was queried.
object[]
required
Combined list of all whale transfers (inbound and outbound), in the order they were encountered. Each entry contains the fields below.
object[]
required
Subset of whale_transfers where direction is "in".
object[]
required
Subset of whale_transfers where direction is "out".
number
required
Sum of all inbound whale transfer amounts, rounded to 4 decimal places.
number
required
Sum of all outbound whale transfer amounts, rounded to 4 decimal places.
number
required
Number of inbound whale transfers found.
number
required
Number of outbound whale transfers found.
number
required
The sol_threshold value used for this query, echoed back for reference.
number
required
The token_threshold value used for this query, echoed back for reference.

Example response

Graceful degradation

If the Helius API key is missing or the quota is exhausted, the agent raises an error. The full pipeline in main.py catches this and substitutes empty defaults so the remaining pipeline stages continue unaffected:
Helius free-tier accounts have usage limits. If you see a "max usage reached" error, upgrade your Helius plan or reduce limit.