Analytics Tools
. These tools provide advanced analytics capabilities for analyzing blockchain data, transaction volumes, and holder distributions on the Somnia network.
get_transaction_volume
Section titled “get_transaction_volume”Calculates the total transaction volume in SST for a given block range.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)fromBlock
: Starting block numbertoBlock
: Ending block number
Example:
{ "network": "Somnia Testnet", "fromBlock": 1000000, "toBlock": 1001000}
Response: Returns total volume in wei and SST format, transaction count, and processing statistics.
Example Prompt:
Calculate the total SST transaction volume between blocks 1000000 and 1001000.
get_erc20_transaction_volume
Section titled “get_erc20_transaction_volume”Calculates the total ERC20 token transaction volume for a given block range.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)tokenAddress
: The ERC20 token contract addressfromBlock
: Starting block numbertoBlock
: Ending block number
Example:
{ "network": "Somnia Testnet", "tokenAddress": "0xabcdef1234567890abcdef1234567890abcdef12", "fromBlock": 1000000, "toBlock": 1001000}
Response: Returns token volume information with formatted values, transfer count, and token metadata.
Example Prompt:
Get the transaction volume for ERC20 token 0xabcdef1234567890abcdef1234567890abcdef12 between blocks 1000000 and 1001000.
get_top_holders
Section titled “get_top_holders”Gets the top holders of native tokens (SST/SOMI) by analyzing recent transactions.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)limit
(optional): Maximum number of top holders to return (1-50, defaults to 10)fromBlock
(optional): Starting block numbertoBlock
(optional): Ending block number
Example:
{ "network": "Somnia Testnet", "limit": 20, "fromBlock": 1000000, "toBlock": 1001000}
Response: Returns top holders with balances, total holder count, and analysis metadata.
Example Prompt:
Get the top 20 SST holders based on transactions between blocks 1000000 and 1001000.
get_erc20_top_holders
Section titled “get_erc20_top_holders”Gets the top holders of an ERC20 token by analyzing Transfer events.
Parameters:
network
(optional): Network name or chain ID (defaults to Somnia testnet)tokenAddress
: The ERC20 token contract addresslimit
(optional): Maximum number of top holders to return (1-100, defaults to 10)fromBlock
(optional): Starting block numbertoBlock
(optional): Ending block number
Example:
{ "network": "Somnia Testnet", "tokenAddress": "0xabcdef1234567890abcdef1234567890abcdef12", "limit": 25, "fromBlock": 1000000, "toBlock": 1001000}
Response: Returns top token holders with balances, percentages, token information, and analysis statistics.
Example Prompt:
Get the top 25 holders of ERC20 token 0xabcdef1234567890abcdef1234567890abcdef12 between blocks 1000000 and 1001000.
Usage Notes
Section titled “Usage Notes”Volume Analysis
Section titled “Volume Analysis”- Block Range Limits: Maximum 1000 blocks per request for performance
- Native Token Volume: Analyzes all SST/SOMI transfers in the specified range
- ERC20 Volume: Focuses on Transfer events for specific token contracts
- Performance: Large ranges may take time to process
Holder Analysis
Section titled “Holder Analysis”- Native Tokens: Analyzes transaction history to calculate balances
- ERC20 Tokens: Uses Transfer events for accurate balance tracking
- Balance Calculation: Accounts for both incoming and outgoing transfers
- Percentage Calculation: Shows holder percentage of total supply (ERC20 only)
Data Accuracy
Section titled “Data Accuracy”- Real-time Data: Uses on-chain data for most accurate results
- Historical Analysis: Processes past transactions and events
- Performance Trade-offs: Larger ranges provide more comprehensive data but take longer
Error Handling
Section titled “Error Handling”Analytics tools may return errors if:
- Block range exceeds limits (1000 blocks max)
- Invalid block numbers or ranges
- Network connection issues during data processing
- Token contract not found or invalid
- Insufficient data in specified block range