Skip to main content
Glama

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:

  1. Curve StableSwap-NG pool (pool_address): TokenExchange, AddLiquidity, RemoveLiquidity

  2. 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

TableJSON Schema
NameRequiredDescriptionDefault
chainYesThe blockchain network
pool_addressNoThe Curve pool contract address (0x...). Fetches swap and liquidity events. At least one of pool_address or pt_address is required.
pt_addressNoThe Spectra PrincipalToken contract address (0x...). Fetches Mint, Redeem, and YieldClaimed vault events. At least one of pool_address or pt_address is required.
rpc_urlNoRPC 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_blockNoStart block number. If omitted, calculated from lookback_hours.
to_blockNoEnd block number. If omitted, uses the latest block.
lookback_hoursNoHours 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.
addressNoFilter events to a specific address (matches buyer/provider in events).
type_filterNoFilter by activity type. Default: all.all
limitNoMaximum number of events to return (default 50, max 200).
token_decimalsNoToken decimals for formatting amounts (default 18). Use spectra_get_pt_details to find actual decimals — USDC=6, WBTC=8, most IBTs/PTs=18.
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Comprehensively discloses behavioral traits: returns raw token amounts (no USD), block range strategies, parallel fetching, contract types, limitations (max 500k blocks, public RPC rate limits), and RPC override behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with bullet points and sections; each sentence adds value. Slightly lengthy but appropriate given the complexity; could be trimmed slightly without loss.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Covers all necessary aspects including contract types, events, parallel fetching, block ranges, limitations, and alternative tool reference. No output schema, but return values (raw token amounts) are clearly stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Despite 100% schema coverage, the description adds significant context beyond schema: explains event types for each contract, behavior when both addresses provided, block range logic, RPC fallback, and hints for token_decimals.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool fetches historical on-chain activity via eth_getLogs and distinguishes itself from the sibling tool spectra_get_pool_activity by focusing on historical data beyond the API's retention window.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use this tool (when spectra_get_pool_activity returns empty/incomplete data) and when to use the alternative, providing clear comparison and context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Finanzgoblin/spectra-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server