A high-performance asset price monitoring system built with Bun that tracks cryptocurrency, stock, metal, and fiat currency prices across multiple exchanges and exports metrics in OpenMetrics format for Prometheus.
- 🚀 Blazing Fast - Built with Bun for optimal performance
- 📊 Multi-Exchange Support - Crypto, Stock, Metals, and Fiat currencies
- 🌍 Multi-Currency Portfolio - Automatic currency conversion with real-time forex rates
- 🎯 OpenMetrics Export - Prometheus-compatible metrics endpoint
- 🔄 Real-time Updates - Price updates every ~30 seconds
- 👥 Multi-Owner Support - Track assets for multiple portfolio owners
- 🐳 Docker Ready - Easy deployment with Docker and Docker Compose
- 🔐 Bearer Authentication - Optional token-based API security
- 📈 Portfolio Analytics - Value breakdowns, currency distribution, and asset percentages
- Fiat - Forex currency conversion rates
- Metal - Metal market data
- Crypto - Crypto market data
- Stock - Stock market data
Docker and Docker Compose
Create a config.json file:
{ "server": { "host": "0.0.0.0", "port": 3000, "token": null }, "logger": { "level": 3 }, "assets": [ { "symbol": "EUR", "quantity": 1500, "exchange": "fiat", "currency": "USD", "owner": "default" }, { "symbol": "EUR", "quantity": 430, "exchange": "fiat", "currency": "EUR", "owner": "ziga" }, { "symbol": "GOLD", "quantity": 100, "exchange": "metal", "currency": "EUR", "owner": "ziga" }, { "symbol": "SILVER", "quantity": 500, "exchange": "metal", "currency": "EUR", "owner": "default" }, { "symbol": "UBNT", "quantity": 3.624, "exchange": "stock", "currency": "EUR", "owner": "default" }, { "symbol": "UBNT", "quantity": 1.31, "exchange": "stock", "currency": "EUR", "owner": "ziga" }, { "symbol": "NET", "quantity": 4.5, "exchange": "stock", "currency": "EUR", "owner": "default" }, { "symbol": "WISEl", "quantity": 4, "exchange": "stock", "currency": "EUR", "owner": "default" }, { "symbol": "BTC", "quantity": 0.043212, "exchange": "crypto", "currency": "USD", "owner": "default" }, { "symbol": "BTC", "quantity": 0.0003167, "exchange": "crypto", "currency": "USD", "owner": "ziga" }, { "symbol": "ETH", "quantity": 0.64232, "exchange": "crypto", "currency": "USD", "owner": "default" }, { "symbol": "SOL", "quantity": 0.16, "exchange": "crypto", "currency": "USD", "owner": "default" }, { "symbol": "XMR", "quantity": 2.54, "exchange": "crypto", "currency": "USD", "owner": "default" } ] }Create docker-compose.yml file:
services: rabbitassets: image: rabbitcompany/rabbitassets:latest container_name: rabbitassets restart: unless-stopped ports: - "3000:3000" volumes: - ./config.json:/usr/src/app/config.json healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/health"] interval: 10s timeout: 3s retries: 3 start_period: 5sStart the project with:
docker-compose up -ddocker run -d \ --name rabbitassets \ -p 3000:3000 \ -v $(pwd)/config.json:/usr/src/app/config.json \ rabbitcompany/rabbitassets:latestAPI endpoint for checking project health
OpenMetrics format endpoint for Prometheus scraping.
JSON API endpoint returning all asset metrics.
Example response:
[ { "symbol": "BTC", "quantity": 0.043212, "currentPrice": 45000.5, "value": 1944.56, "currency": "USD", "exchange": "crypto", "owner": "default" }, { "symbol": "ETH", "quantity": 0.64232, "currentPrice": 2500.75, "value": 1605.48, "currency": "USD", "exchange": "crypto", "owner": "default" } ]Pre-made Grafana dashboard can be downloaded from here: https://grafana.com/grafana/dashboards/24333
Pre-made TRMNL recipe can be installed from here: https://usetrmnl.com/recipes/181797/install

