Your portfolio value, on your schedule
Current value of your crypto or stock holdings
What you will receive
Portfolio Update
just now
Portfolio Value: $45,230.50 Holdings: • BTC: 0.5 ($21,250) • ETH: 4.2 ($8,820) • AAPL: 50 ($9,150) 24h change: +$1,230 (+2.8%)
How it works
- 1Humrun fetches current prices for your holdings
- 2It calculates total value and daily changes
- 3You get a snapshot delivered on your schedule
You configure
BTC:0.5,ETH:4.2,AAPL:50
Comma-separated list of symbol:amount pairs
View Python code
import requests
from state import state
import os
HOLDINGS = os.environ.get("HOLDINGS", "")
# Parse holdings
holdings = {}
for item in HOLDINGS.split(","):
if ":" in item:
symbol, amount = item.strip().split(":")
holdings[symbol.upper()] = float(amount)
if not holdings:
print("No holdings configured. Set HOLDINGS=BTC:0.5,ETH:4.2")
else:
# Fetch crypto prices from CoinGecko (free)
crypto_ids = {"BTC": "bitcoin", "ETH": "ethereum", "SOL": "solana"}
crypto_prices = {}
crypto_symbols = [s for s in holdings if s in crypto_ids]
if crypto_symbols:
ids = ",".join(crypto_ids[s] for s in crypto_symbols)
resp = requests.get(f"https://api.coingecko.com/api/v3/simple/price?ids={ids}&vs_currencies=usd")
data = resp.json()
for symbol in crypto_symbols:
crypto_prices[symbol] = data.get(crypto_ids[symbol], {}).get("usd", 0)
# Calculate total
total_value = 0
print("Portfolio Snapshot\n")
for symbol, amount in holdings.items():
price = crypto_prices.get(symbol, 0)
value = price * amount
total_value += value
print(f"• {symbol}: {amount} ($" + f"{value:,.2f})")
previous_total = state.get("total_value")
state["total_value"] = total_value
print(f"\nTotal: $" + f"{total_value:,.2f}")
if previous_total:
change = total_value - previous_total
change_pct = (change / previous_total) * 100
print(f"Change: {'+' if change >= 0 else ''}{change:,.2f} ({change_pct:+.2f}%)")Humrun tracks your total portfolio value to show changes over time.
Suggested schedule: Every day at 8 AM•Notifications: After every run