API Documentation
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 URLhttps://
api.solstats.co/
Authentication
The Solana Wallet Metrics 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:
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
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=Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH
Response Fields
success
boolean
Indicates if the request was successful
wallet
string
The wallet address that was analyzed
sol_price_used
number
The SOL price used for calculations
sol_price_source
string
Source of the SOL price (real-time, cached, or user-provided)
metrics
object
Object containing all computed metrics
Example Response
Example Response (Success)
200 OK
{ "success": true, "wallet": "Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH", "sol_price_used": 148.05, "sol_price_source": "cached", "metrics": { "Portfolio_Value_USD": 18025.90, "SOL_Balance": 4.32, "ROI": 17.08, "ROI_1d": 0.15, "ROI_7d": 2.14, "ROI_30d": 6.54, "Winrate": 51.23, "Risk_Score": 47.06, "Trading_Style": "Swing Trader", "Realized_Gains": 279716.60, "Unrealized_Gains": -22.61, "Average_Holding_Time_min": 8049.73, "Avg_Buy_Size": 167.15, "Farming_Attempts": 74, "Farming_Ratio_Percentage": 1.03, "Total_Tokens": 7160, "Analysis_Time": "2025-05-03T05:12:37.457947", "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 */ ] } }
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
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
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
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
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:
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=Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH"
Python
import requests
response = requests.get( 'https://api.solstats.co/api/wallet-metrics', params={'wallet': 'Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH'} )
data = response.json() print(data)
JavaScript
fetch('https://api.solstats.co/api/wallet-metrics?wallet=Amxbqjznnb7s9sp9UJbUiSfEWTAYWbJmRfjcNeq1RogH') .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error));
Last updated