spectra_get_onchain_activity
Fetch historical on-chain activity from Curve pool and Spectra PrincipalToken event logs. Use when API-based data is empty or incomplete.
Instructions
Fetch historical on-chain activity directly from event logs via eth_getLogs. Use this when the API-based spectra_get_pool_activity returns empty or incomplete data (the API only stores a limited time window of recent transactions).
Supports TWO contract types:
Curve StableSwap-NG pool (pool_address): TokenExchange, AddLiquidity, RemoveLiquidity
Spectra PrincipalToken vault (pt_address): Mint (deposit→PT+YT), Redeem (burn PT→IBT), YieldClaimed
Provide pool_address, pt_address, or both. When both are provided, events from both contracts are fetched in parallel, merged, and sorted by block number.
Returns raw token amounts (not USD values — USD conversion is not available from on-chain data alone).
The rpc_url parameter lets you supply an RPC endpoint for any chain, including chains without hardcoded RPCs (e.g., Katana, Monad). If omitted, falls back to the server's default public RPC for the chain (if available).
Block range strategy:
Specify from_block/to_block for exact ranges
Or specify lookback_hours to scan the last N hours (converted to blocks using estimated block times — approximate, not exact)
Default: last ~24 hours if no range is specified
Limitations:
No USD values (only raw token amounts in native decimals)
Block timestamps are fetched for first/last block only (time range display)
Public RPCs may rate-limit large scans; use a premium RPC for deep history
Maximum 500,000 blocks per request (to prevent timeout)
Use spectra_get_pool_activity for recent data with USD values and rich analysis. Use this tool for historical data beyond the API's retention window.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chain | Yes | The blockchain network | |
| pool_address | No | The Curve pool contract address (0x...). Fetches swap and liquidity events. At least one of pool_address or pt_address is required. | |
| pt_address | No | The Spectra PrincipalToken contract address (0x...). Fetches Mint, Redeem, and YieldClaimed vault events. At least one of pool_address or pt_address is required. | |
| rpc_url | No | RPC endpoint URL. Overrides the default public RPC for this chain. Required for chains without default RPCs (katana, monad). Use a premium RPC (Alchemy, Infura) for better reliability on large scans. | |
| from_block | No | Start block number. If omitted, calculated from lookback_hours. | |
| to_block | No | End block number. If omitted, uses the latest block. | |
| lookback_hours | No | Hours to look back from current block (default 24, max 720 = 30 days). Ignored if from_block is provided. Converted to blocks using estimated block times. | |
| address | No | Filter events to a specific address (matches buyer/provider in events). | |
| type_filter | No | Filter by activity type. Default: all. | all |
| limit | No | Maximum number of events to return (default 50, max 200). | |
| token_decimals | No | Token decimals for formatting amounts (default 18). Use spectra_get_pt_details to find actual decimals — USDC=6, WBTC=8, most IBTs/PTs=18. |