SolStats API

A comprehensive API that provides detailed analytics and metrics for any Solana wallet address.

Overview

The SolStats API enables developers to access comprehensive analytics about any Solana wallet address. This API integrates with blockchain data sources to compute various metrics including portfolio value, ROI, trading patterns, risk assessment, and more.

The API is designed to be simple to use while providing detailed insights that can be integrated into portfolio tracking applications, trading platforms, or analytics dashboards.

Base URL

https://api.solstats.co/

Authentication

The SolStats API is currently publicly accessible and does not require authentication. However, it's subject to rate limiting to ensure fair usage and service stability.

Rate Limits

To ensure service stability and prevent abuse, the API enforces the following rate limits:

Endpoint Rate Limit
Index (/) 60 requests per minute
Wallet Metrics (/api/wallet-metrics) 20 requests per minute
Test Rate Limit (/test-rate-limit) 5 requests per minute
Default (all endpoints) 200 requests per day, 50 requests per hour

When a rate limit is exceeded, the API returns a 429 Too Many Requests status code with details about the limit that was exceeded.

{ "error": "Rate limit exceeded", "message": "20 per 1 minute" }

Wallet Metrics Endpoint

GET /api/wallet-metrics
⚠️ Rate limited to 20 requests per minute

This endpoint retrieves comprehensive metrics for a specified Solana wallet address.

Parameters

Name Type Description
wallet required string The Solana wallet address to analyze.
sol_price optional number Custom SOL price in USD to use for calculations. If not provided, the current price from CoinGecko is used.

Example Request

GET /api/wallet-metrics?wallet={wallet_address}

Response Fields

The API now returns the metrics directly as a JSON object. Below are some of the key metrics included in the response:

Field Type Description
Wallet_Address string The wallet address that was analyzed
Portfolio_Value_USD number Total value of all assets in the wallet in USD
SOL_Balance number Amount of SOL tokens in the wallet
ROI number Overall return on investment percentage
Trading_Style string Identified trading style based on trading patterns
Risk_Score number Overall risk score (0-100, higher means riskier)
Analysis_Time string Timestamp when the analysis was completed

Interactive Demo

Example Response

Example Response (Success)
200 OK
{ "Analysis_Time": "2025-05-07T01:00:16.233286", "Average_Holding_Time_min": 8049.73, "Avg_Buy_Size": 167.15, "Avg_Loss_Per_Trade_Pct": -28.45, "Avg_MC_Last_10_Tokens": 4832156.76, "Avg_Profit_Per_Trade_Pct": 43.12, "Avg_Risk_Last_10_Tokens": 5.8, "Biggest_Loss_PnL_USD": -15432.75, "Biggest_Loss_ROI_%": -83.7, "Biggest_Loss_Token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Biggest_Loss_Token_Name": "USDC", "Biggest_Win_PnL_USD": 37219.54, "Biggest_Win_ROI_%": 311.64, "Biggest_Win_Token": "Gui9KPUD5C2vXChuJz1MD3WzNsAKXp8Mv1GJWZCv8nfi", "Biggest_Win_Token_Name": "GUI", "Farming_Attempts": 74, "Farming_Ratio_Percentage": 1.03, "Last_Traded_Tokens": [ "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ], "Median_MC_Last_10_Tokens": 1256789.45, "Median_Risk_Last_10_Tokens": 6, "Portfolio_Value_USD": 18025.90, "ROI": 17.08, "ROI_1d": 0.15, "ROI_7d": 2.14, "ROI_30d": 6.54, "Realized_Gains": 279716.60, "Risk_Score": 47.06, "SOL_Balance": 4.32, "Top10_Current_Holdings": [ { "address": "HfNw1rT7LHDeZGUyx9vwHBM4L58VvMQfVMkXaGcmQP4o", "balance": 7222447.24, "name": "BONK pump.fun", "risk_score": 4, "symbol": "BONK", "value_usd": 751.04 }, /* Additional holdings not shown for brevity */ ], "Total_Tokens": 7160, "Trading_Style": "Swing Trader", "Unrealized_Gains": -22.61, "Wallet": "Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH", "Wallet_Address": "Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH", "Win_Rate_1d": 52.6, "Win_Rate_7d": 48.9, "Win_Rate_30d": 50.3, "Winrate": 51.23 }

Test Rate Limit Endpoint

GET /test-rate-limit
⚠️ Rate limited to 5 requests per minute

A simple endpoint for testing rate limiting functionality. It returns a timestamp along with a simple message.

Example Response

{ "message": "Rate limit test endpoint", "timestamp": 1746248572.59 }

API Status Endpoint

GET /
⚠️ Rate limited to 60 requests per minute

Returns basic information about the API and the current Solana price.

Example Response

{ "message": "API is running. Use /api/wallet-metrics endpoint", "endpoints": ["/api/wallet-metrics", "/test-rate-limit", "/docs"], "current_sol_price": 146.79, "price_source": "real-time", "cache_updated": "2025-05-04 00:35:17", "rate_limits": { "default": "200 per day, 50 per hour", "index_endpoint": "60 per minute", "wallet_metrics_endpoint": "20 per minute", "test_rate_limit_endpoint": "5 per minute" } }

Metrics Reference

The API provides a comprehensive set of metrics for wallet analysis. Below is a detailed description of each metric returned in the response.

Portfolio Metrics

Metric Type Description
Portfolio_Value_USD number Total value of all assets in the wallet converted to USD
SOL_Balance number Amount of SOL tokens (including wrapped SOL) in the wallet
Total_Tokens number Total number of unique token types in the wallet
Top10_Current_Holdings array List of the 10 most valuable tokens currently held in the wallet

Performance Metrics

Metric Type Description
ROI number Overall return on investment percentage
ROI_1d number Return on investment percentage over the last 24 hours
ROI_7d number Return on investment percentage over the last 7 days
ROI_30d number Return on investment percentage over the last 30 days
Realized_Gains number Total profit/loss from all closed positions (in USD)
Unrealized_Gains number Estimated profit/loss from currently open positions (in USD)

Trading Metrics

Metric Type Description
Winrate number Percentage of profitable trades out of all trades
Win_Rate_1d number Percentage of profitable trades in the last 24 hours
Win_Rate_7d number Percentage of profitable trades in the last 7 days
Win_Rate_30d number Percentage of profitable trades in the last 30 days
Trading_Style string Identified trading style based on trading patterns (e.g., "Swing Trader", "Day Trader")
Average_Holding_Time_min number Average time (in minutes) tokens are held before selling
Avg_Buy_Size number Average size of buy transactions in USD
Avg_Profit_Per_Trade_Pct number Average percentage profit on winning trades
Avg_Loss_Per_Trade_Pct number Average percentage loss on losing trades

Risk Metrics

Metric Type Description
Risk_Score number Overall risk score based on trading behavior (0-100, higher means riskier)
Farming_Attempts number Number of identified yield farming positions
Farming_Ratio_Percentage number Percentage of trading activity dedicated to yield farming
Biggest_Win_PnL_USD number Largest profit made from a single trade (in USD)
Biggest_Win_ROI_% number Largest percentage return made from a single trade
Biggest_Win_Token string Token address that generated the largest win
Biggest_Win_Token_Name string Name of the token that generated the largest win
Biggest_Loss_PnL_USD number Largest loss made from a single trade (in USD)
Biggest_Loss_ROI_% number Largest percentage loss made from a single trade
Biggest_Loss_Token string Token address that generated the largest loss
Biggest_Loss_Token_Name string Name of the token that generated the largest loss
Avg_Risk_Last_10_Tokens number Average risk score of the last 10 traded tokens (0-10, higher means riskier)
Median_Risk_Last_10_Tokens number Median risk score of the last 10 traded tokens
Avg_MC_Last_10_Tokens number Average market capitalization of the last 10 traded tokens (in USD)
Median_MC_Last_10_Tokens number Median market capitalization of the last 10 traded tokens (in USD)

Token Holdings Data Structure

Each item in the Top10_Current_Holdings array contains the following fields:

Field Type Description
address string The token's contract address
balance number Amount of the token held
name string Token name
risk_score number Risk assessment score for the token (0-10, higher means riskier)
symbol string Token symbol
value_usd number Current value of token holdings in USD

Example Code

cURL

curl "https://api.solstats.co/api/wallet-metrics?wallet={wallet_address}"

Python

import requests response = requests.get( 'https://api.solstats.co/api/wallet-metrics', params={'wallet': '{wallet_address}'} ) data = response.json() print(data)

JavaScript

fetch('https://api.solstats.co/api/wallet-metrics?wallet={wallet_address}') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));