home / skills / openclaw / skills / crypto-portfolio-tracker-api

crypto-portfolio-tracker-api skill

/skills/strykragent/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-api

Review the files below or copy the command above to add this skill to your agents.

Files (8)
SKILL.md
1.3 KB
---
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)

Overview

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.

How this skill works

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.

When to use it

  • Monitor real-time portfolio value across spot holdings
  • Calculate unrealized P&L for tax or performance reviews
  • Build dashboards showing allocations and top-weighted positions
  • Fetch batch prices for trading bots or rebalancing logic
  • Validate token price feeds before executing orders

Best practices

  • Provide accurate cost basis per holding to get correct P&L figures
  • Normalize token symbols (e.g., BTC, ETH, SOL) to avoid lookup errors
  • Rate-limit requests and cache prices for dashboards to reduce API calls
  • Validate amounts and handle zero or negative quantities explicitly
  • Include token id mapping when using wrapped or cross-chain variants

Example use cases

  • Dashboard integration: display total portfolio value and allocation slices in a UI
  • Rebalancing tool: compute current weights and suggest target trades to reach desired allocations
  • Performance report: generate daily or monthly P&L summaries for investors or tax records
  • Price alerting: poll batch prices and trigger notifications when holdings move beyond thresholds
  • CLI workflows: use the provided command-line tool to quickly check prices or track portfolios from a file

FAQ

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.