360 Secure SkillHub
360 安全技能中心

Crypto Portfolio Tracker API

一个 Node.js 库及配套 CLI,通过 PRISM API 获取 BTC、ETH、SOL 等代币实时价格,支持批量查价、按持仓数量与成本基准计算组合总市值、总盈亏和配置分析,也可从 JSON 文件读取持仓。

分类:数据
strykragent
strykragent
热度 46.18
最近更新 2026-05-11 16:52:13

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add strykragent/crypto-portfolio-tracker-api
兼容性
通用兼容
联网要求
需要联网
数据出网
必须出网
Metadata
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

npm install crypto-portfolio-tracker-api

Usage

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

# 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