Crypto Portfolio Tracker API
Verfolge Kryptowährungs-Portfolios mit Echtzeit-Preisen und Gewinn-und-Verlust-Berechnungen.
Installation
npm install crypto-portfolio-tracker-api
Verwendung
const { PortfolioTracker } = require('crypto-portfolio-tracker-api');
const tracker = new PortfolioTracker();
// Aktuellen Preis abrufen
const btc = await tracker.getPrice('BTC');
// Mehrere Preise abrufen
const prices = await tracker.getPrices(['BTC', 'ETH', 'SOL']);
// Portfolio mit G&V verfolgen
const portfolio = await tracker.trackPortfolio([
{ symbol: 'BTC', amount: 0.5, costBasis: 30000 },
{ symbol: 'ETH', amount: 10, costBasis: 2000 }
]);
console.log(`Gesamtwert: $${portfolio.totalValue}`);
console.log(`G&V: $${portfolio.totalPnL}`);
CLI
# Preis abrufen
npx crypto-portfolio-tracker-api price BTC
# Portfolio aus Datei verfolgen
npx crypto-portfolio-tracker-api track portfolio.json
API-Methoden
getPrice(symbol)– Einzelnen Token-Preis abrufengetPrices(symbols)– Mehrere Preise abrufentrackPortfolio(holdings)– Portfolio-Wert und G&V berechnen
Datenquelle
Bereitgestellt durch PRISM API