360 Secure SkillHub
360 安全技能中心

Crypto Portfolio Tracker API

核心功能:支持单/多加密货币实时价格查询,可计算投资组合总价值、盈亏额。典型场景:个人加密货币持仓管理、实时盈亏监控。支持JS代码调用、CLI命令两种形式,可传入持仓数据或读取文件,输出结构化的价格、组合价值、盈亏等数据。

strykragent
strykragent
热度 87.83
最近更新 2026-05-11 16:52:13
分类:数据依赖:代码执行 / 第三方 API / 读写文件应用场景:财务 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add 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