Wallet Batch API

Overview

The Wallet Batch API provides endpoints for analyzing multiple Solana wallet addresses in batch. It offers a comprehensive analysis of trading performance, including metrics like PnL (Profit and Loss), trading patterns, and fee analysis.

Key Features

  • Batch Processing: Analyze up to 5 wallet addresses simultaneously

  • Asynchronous Processing: Since batch processing can be time-consuming, we use asynchronous processing to prevent delays and ensure that requests are handled correctly, avoiding timeouts.

  • Comprehensive Analysis: Detailed metrics including:

    • General trading performance

    • Closed trades analysis

    • Fee analysis

    • Trading venue usage

    • Time-based trading patterns

Available Endpoints

  1. Process Wallet Batch (POST /process_wallet_batch)

    • Initiates analysis for a batch of wallet addresses

    • Returns a task ID for tracking progress

  2. Check Batch Status (GET /batch_status/{task_id})

    • Retrieves the status and results of a batch processing task

    • Provides detailed analysis results when processing is complete

Rate Limits

  • Maximum 5 wallet addresses per batch request

  • Requests limites are based on the API key tier defined below

Process Wallet Batch

Process multiple wallet addresses in a single batch request.

Endpoint

POST /process_wallet_batch

Request Body

Response

When request is accepted:

Check Batch Status

Check the status of a batch processing task.

Endpoint

GET /batch_status/{task_id}

Response

When processing:

When complete with some errors:

When all wallets fail:

When task not found:

Common Error Messages

Error Message
Description

"No swaps found"

The wallet has no swap transactions in the analyzed period

"Invalid wallet address"

The provided address is not a valid Solana address

"Error processing wallet"

Generic error occurred while processing the wallet

Error Responses

  • 400 Bad Request: When more than 5 wallet addresses are provided

  • 500 Internal Server Error: When an error occurs during processing

Summary Fields Documentation

General Performance

These fields provide an overview of the wallet's trading activity:

Field
Type
Description

first_trade_timestamp

ISO datetime

Date and time of the wallet's first trade in the analyzed period

last_trade_timestamp

ISO datetime

Date and time of the wallet's most recent trade

tokens_traded

integer

Total number of unique tokens traded

trades_closed

integer

Number of completed trading positions

trades_open

integer

Number of currently open positions

total_sol_spent

float

Total amount of SOL used for purchases

total_sol_received

float

Total amount of SOL received from sales

net_sol

float

Net profit/loss in SOL (total_sol_received - total_sol_spent)

Closed Trades Overview

These fields analyze the performance of completed trades:

Field
Type
Description

winners

integer

Number of trades that resulted in profit

losses

integer

Number of trades that resulted in loss

win_rate_percent

float

Percentage of winning trades (winners / (winners + losses) * 100)

average_trade_size_sol

float

Average amount of SOL used per trade

mean_pnl_sol

float

Average profit/loss per trade in SOL

mean_pnl_percent

float

Average profit/loss per trade as a percentage

std_pnl_sol

float

Standard deviation of profit/loss in SOL (volatility measure)

std_pnl_percent

float

Standard deviation of profit/loss percentage

min_pnl_sol

float

Largest loss in SOL

min_pnl_percent

float

Largest loss as a percentage

max_pnl_sol

float

Largest profit in SOL

max_pnl_percent

float

Largest profit as a percentage

total_pnl_sol

float

Total profit/loss in SOL

total_pnl_percent

float

Total profit/loss as a percentage

Percentile Metrics

These fields show the distribution of profits/losses:

Field
Type
Description

10th_percentile_pnl_sol

float

10% of trades performed worse than this SOL value

10th_percentile_pnl_percent

float

10% of trades performed worse than this percentage

25th_percentile_pnl_sol

float

25% of trades performed worse than this SOL value

25th_percentile_pnl_percent

float

25% of trades performed worse than this percentage

50th_percentile_pnl_sol

float

Median profit/loss in SOL

50th_percentile_pnl_percent

float

Median profit/loss percentage

75th_percentile_pnl_sol

float

75% of trades performed worse than this SOL value

75th_percentile_pnl_percent

float

75% of trades performed worse than this percentage

90th_percentile_pnl_sol

float

90% of trades performed worse than this SOL value

90th_percentile_pnl_percent

float

90% of trades performed worse than this percentage

Fees

Information about transaction fees:

Field
Type
Description

total_fee_spent_sol

float

Total amount spent on transaction fees in SOL

avg_fee_per_trade_sol

float

Average fee per trade in SOL

Wallet

Wallet identification:

Field
Type
Description

wallet

string

The wallet address being analyzed

Venues

Trading venue information:

Field
Type
Description

venues_list

string

Comma-separated list of trading platforms used (e.g., "Jupiter, Raydium, Orca")

Deltas

Time-based analysis of trading patterns:

Field
Type
Description

overall_mean_delta

integer

Average time between trades in seconds

average_trades_per_token

float

Average number of trades performed per unique token

overall_min_delta

integer

Shortest time between any two trades in seconds

overall_max_delta

integer

Longest time between any two trades in seconds

10th_percentile

integer

10% of trade intervals are shorter than this (seconds)

25th_percentile

integer

25% of trade intervals are shorter than this (seconds)

50th_percentile

integer

Median time between trades in seconds

75th_percentile

integer

75% of trade intervals are shorter than this (seconds)

90th_percentile

integer

90% of trade intervals are shorter than this (seconds)

Notes:

  • All SOL values are rounded to 5 decimal places

  • Percentages are expressed as floating-point numbers (e.g., 75.0 for 75%)

  • Time deltas are in seconds

  • Timestamps are in ISO 8601 format

  • PnL stands for Profit and Loss

Example Usage

Python Example

JavaScript/Node.js Example

cURL Example

Rate Limits and API Keys

Different API key tiers have different rate limits:

Tier
Rate Limit
Daily Limit

Ultimate

5 req/min

100/day

Unlimited

10 req/min

Unlimited

When rate limits are exceeded, the API will return a 429 status code with an error message. It's recommended to implement exponential backoff in your client code to handle rate limiting gracefully.

Error Handling

Common error responses:

Best Practices

  1. Store API Keys Securely: Never expose your API key in client-side code or public repositories.

  2. Handle Rate Limits: Implement proper error handling and backoff strategies for rate limits.

  3. Batch Efficiently: Group wallet addresses into batches of up to 5 to minimize API calls.

  4. Monitor Usage: Keep track of your API usage to stay within your tier's limits.

  5. Use Async Endpoints: The batch processing is asynchronous - always check the task status endpoint for results.

Last updated