home / skills / openclaw / skills / crypto-portfolio-tracker-api
This skill helps you monitor crypto portfolios with real-time prices and P&L, providing allocation insights for BTC, ETH, SOL and 10,000+ tokens.
npx playbooks add skill openclaw/skills --skill crypto-portfolio-tracker-apiReview the files below or copy the command above to add this skill to your agents.
---
name: crypto-portfolio-tracker-api
description: Track cryptocurrency portfolios with real-time prices, P&L calculations, and allocation analysis. Query Bitcoin, Ethereum, Solana and 10,000+ token holdings.
---
# Crypto Portfolio Tracker API
Track cryptocurrency portfolios with real-time prices and P&L calculations.
## Installation
```bash
npm install crypto-portfolio-tracker-api
```
## Usage
```javascript
const { PortfolioTracker } = require('crypto-portfolio-tracker-api');
const tracker = new PortfolioTracker();
// Get current price
const btc = await tracker.getPrice('BTC');
// Get multiple prices
const prices = await tracker.getPrices(['BTC', 'ETH', 'SOL']);
// Track portfolio with P&L
const portfolio = await tracker.trackPortfolio([
{ symbol: 'BTC', amount: 0.5, costBasis: 30000 },
{ symbol: 'ETH', amount: 10, costBasis: 2000 }
]);
console.log(`Total: $${portfolio.totalValue}`);
console.log(`P&L: $${portfolio.totalPnL}`);
```
## CLI
```bash
# Get price
npx crypto-portfolio-tracker-api price BTC
# Track portfolio from file
npx crypto-portfolio-tracker-api track portfolio.json
```
## API Methods
- `getPrice(symbol)` - Get single token price
- `getPrices(symbols)` - Get multiple prices
- `trackPortfolio(holdings)` - Calculate portfolio value and P&L
## Data Source
Powered by [PRISM API](https://prismapi.ai)
This skill provides an API to track cryptocurrency portfolios with live prices, allocation breakdowns, and profit & loss calculations. It supports Bitcoin, Ethereum, Solana and over 10,000 tokens. Use it to fetch single or batch prices, compute portfolio value, and generate P&L and allocation summaries quickly.
The tracker queries a live market data source to return current spot prices for requested symbols. It accepts a holdings list with symbol, amount, and cost basis to calculate total value, unrealized P&L, and percentage allocations. Methods include single-price lookup, batch price retrieval, and a portfolio tracker that aggregates holdings into a concise report.
Which tokens are supported?
The skill supports Bitcoin, Ethereum, Solana and over 10,000 additional tokens via its market data provider. Confirm symbol mapping for less common assets.
How is P&L calculated?
P&L is calculated per holding as (currentPrice - costBasis) * amount. The portfolio P&L is the sum of individual holding P&Ls and includes allocation percentages based on current market value.