Skip to main content
Allium’s Holdings APIs provide comprehensive real-time and historical USD holdings for wallets, with built-in PnL calculations. Track portfolio performance over time with data aggregated from balance history and price feeds. Supported Networks: Bitcoin and Solana (more chains coming soon)

Key Features

Real-Time & Historical

Latest balances and prices update in real time, with historical holdings available for tracking portfolios over time

Multi-Chain Aggregation

Request aggregated holdings across multiple chains in a single API call

PnL Calculation

Automatic profit and loss calculations using average cost basis methodology

Holdings Aggregation

Holdings data is aggregated at multiple time granularities with corresponding retention periods:
GranularityRetention
15s5 days
5m30 days
1hAll
1dAll
USD holdings for each wallet are aggregated across all tokens held and returned at these set time intervals.

PnL Methodology

PnL calculations are based on the average cost basis method, which takes a weighted average of all token purchases and reweights the average cost during sale events.
  • Latest PnL
  • Historical PnL
  • Calculation Details
Latest PnL represents the current unrealized profit or loss for a wallet’s holdings.Formula:
Latest PnL = Current Balance × (Current Price - Average Cost)
Where:
  • Current Balance = Latest token balance for the address
  • Current Price = Latest token price in USD
  • Average Cost = Weighted average cost of the token

Example Scenario

ActionTokenAmountBalancePriceAverage Cost CalculationPnL
BuySOL5050$210(50 × $210) / 50$0
BuySOL1060$200(50 × 210+10×210 + 10 × 200) / 60-$500
SellSOL1050$220Previous avg cost maintained$583.50
SellSOL248$220Previous avg cost maintained$560.16
Price checkSOL48$23048 × $208.33 / 48$1,040.16
BuySOL755$180(48 × 208.33+7×208.33 + 7 × 180) / 55-$1,359.84
Price checkSOL55$185$204.72-$1,084.60

Supported Chains

Currently supported: Bitcoin and Solana
Support for additional chains and liquidity pool-based pricing is in development. Interested in testing the Holdings API? Contact us to discuss your needs.
I