initial commit — cassandra v0.1
Containerised macro-strategy dashboard: 4-panel web UI (indicators, portfolio, flash news, AI strategic log), MariaDB store, hourly ingestion jobs, OpenRouter-backed AI analysis. Ports the four prototype scripts in the parent dir (market_pulse, flash_news, trading212, strategic_log) into async services backed by a persistent DB and served via FastAPI + Jinja2 + HTMX. APScheduler runs as a separate compose service for crash-safety and easier restarts. Portfolio composition + position names come live from Trading 212; news per-ticker headlines reuse those names. Tone (NOVICE/INTERMEDIATE/ PRO) and analysis style (DRY/SPECULATIVE) are env-configurable and stored on each log row so historical entries show what produced them. Default model is deepseek/deepseek-v4-flash (overridable via env). Light/dark theme toggle, sans-serif for prose surfaces, monospace for data. Bearer-token auth, OpenRouter monthly cost cap, RSS feeds auto- disabled on consecutive failures. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
a10409c02b
61 changed files with 4890 additions and 0 deletions
181
config/default.toml
Normal file
181
config/default.toml
Normal file
|
|
@ -0,0 +1,181 @@
|
|||
# Baseline config — universal data tables consumed by market_pulse.py and
|
||||
# flash_news.py. Edit this file to change what every user/portfolio tracks by
|
||||
# default. User-specific or portfolio-specific overrides go in portfolio.toml,
|
||||
# which is loaded on top of this and wins on key conflicts.
|
||||
#
|
||||
# Symbol prefixes in [groups]:
|
||||
# bare → Yahoo Finance (default)
|
||||
# FRED:SERIES_ID → FRED economic series (needs FRED_API_KEY in .env)
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# market_pulse.py — indicator groups
|
||||
# =============================================================================
|
||||
|
||||
[groups]
|
||||
|
||||
equity = [
|
||||
{symbol="^GSPC", label="S&P 500", note="doc ref 7,501 (ATH)"},
|
||||
{symbol="^IXIC", label="Nasdaq Composite", note="Mag 7 concentration"},
|
||||
{symbol="^NDX", label="Nasdaq 100", note="Mag 7 concentration"},
|
||||
{symbol="^FTSE", label="FTSE 100", note="GBP base"},
|
||||
{symbol="^STOXX50E", label="Euro Stoxx 50", note=""},
|
||||
{symbol="^N225", label="Nikkei 225", note="JPY at multi-decade low → VJPN thesis"},
|
||||
{symbol="^HSI", label="Hang Seng", note="China expression"},
|
||||
{symbol="000300.SS", label="CSI 300", note="broad China A-share"},
|
||||
{symbol="^VIX", label="VIX", note="doc ref 18.0 — 'anomalously calm'"},
|
||||
]
|
||||
|
||||
mag7 = [
|
||||
{symbol="AAPL", label="Apple", note="doc thesis: 'Mag 7 pops' scenario"},
|
||||
{symbol="MSFT", label="Microsoft", note=""},
|
||||
{symbol="GOOGL", label="Alphabet (Class A)", note=""},
|
||||
{symbol="AMZN", label="Amazon", note=""},
|
||||
{symbol="META", label="Meta Platforms", note=""},
|
||||
{symbol="NVDA", label="Nvidia", note="AI capex bellwether"},
|
||||
{symbol="TSLA", label="Tesla", note=""},
|
||||
]
|
||||
|
||||
rates = [
|
||||
{symbol="^IRX", label="US 3-month T-bill", note="%"},
|
||||
{symbol="^FVX", label="US 5y yield", note="%"},
|
||||
{symbol="^TNX", label="US 10y yield", note="% — doc ref 4.45"},
|
||||
{symbol="^TYX", label="US 30y yield", note="%"},
|
||||
{symbol="HYG", label="HYG — HY corp bond ETF", note="HY OAS price proxy"},
|
||||
{symbol="TIP", label="TIP — TIPS ETF", note="inflation expectations proxy"},
|
||||
]
|
||||
|
||||
macro = [
|
||||
{symbol="FRED:DFF", label="Fed Funds (effective)", note="%"},
|
||||
{symbol="FRED:CPIAUCSL", label="US CPI (YoY)", note="% — doc ref 3.8"},
|
||||
{symbol="FRED:CPILFESL", label="US Core CPI (YoY)", note="% — ex food & energy"},
|
||||
{symbol="FRED:BAMLH0A0HYM2", label="US HY OAS", note="% — doc ref 2.79 (279bps)"},
|
||||
{symbol="FRED:T10YIE", label="US 10y breakeven inflation", note="%"},
|
||||
{symbol="FRED:T10Y2Y", label="10y-2y term spread", note="% — recession watch"},
|
||||
{symbol="FRED:UNRATE", label="US unemployment rate", note="%"},
|
||||
{symbol="FRED:WALCL", label="Fed balance sheet", note="$M — QT/QE state"},
|
||||
]
|
||||
|
||||
commodities = [
|
||||
{symbol="BZ=F", label="Brent crude", note="$/bbl — doc ref 109; closure-priced 180-250"},
|
||||
{symbol="CL=F", label="WTI crude", note="$/bbl"},
|
||||
{symbol="NG=F", label="Henry Hub nat-gas", note="$/MMBtu"},
|
||||
{symbol="GC=F", label="Gold futures", note="$/oz — doc ref 4,651"},
|
||||
{symbol="SI=F", label="Silver futures", note="$/oz"},
|
||||
{symbol="HG=F", label="Copper futures", note="$/lb — transition demand"},
|
||||
{symbol="PL=F", label="Platinum futures", note="$/oz"},
|
||||
]
|
||||
|
||||
fx = [
|
||||
{symbol="DX-Y.NYB", label="DXY (USD index)", note="USD-debasement channel"},
|
||||
{symbol="GBPUSD=X", label="GBP/USD", note="household base FX"},
|
||||
{symbol="EURGBP=X", label="EUR/GBP", note="~£400-530k EUR exposure"},
|
||||
{symbol="EURUSD=X", label="EUR/USD", note=""},
|
||||
{symbol="USDJPY=X", label="USD/JPY", note="JPY at multi-decade low"},
|
||||
{symbol="USDCNY=X", label="USD/CNY", note="managed peg, watch deviation"},
|
||||
{symbol="GC=F", label="Gold (USD)", note="anchor for FX read"},
|
||||
]
|
||||
|
||||
tech_ai = [
|
||||
{symbol="XLK", label="XLK — US tech sector", note="broad US tech read"},
|
||||
{symbol="SOXX", label="SOXX — iShares semis", note="AI capex bellwether"},
|
||||
{symbol="TSM", label="TSMC (ADR)", note="foundry monopoly + Taiwan risk"},
|
||||
{symbol="ASML", label="ASML", note="EUV monopoly — China-export friction"},
|
||||
{symbol="AVGO", label="Broadcom", note="AI infra; cyclical risk"},
|
||||
{symbol="AMD", label="AMD", note="Nvidia competitor"},
|
||||
{symbol="ARM", label="ARM Holdings", note="mobile/edge AI"},
|
||||
]
|
||||
|
||||
financials = [
|
||||
{symbol="XLF", label="XLF — US financials sector", note="broad US financials"},
|
||||
{symbol="KBE", label="KBE — US banks", note="bank-only, regional+money centre"},
|
||||
{symbol="KRE", label="KRE — US regional banks", note="post-2023 stress watch"},
|
||||
{symbol="JPM", label="JPMorgan", note="systemically important"},
|
||||
{symbol="GS", label="Goldman Sachs", note="capital markets read"},
|
||||
{symbol="HSBA.L", label="HSBC (LSE)", note="UK + Asia exposure"},
|
||||
{symbol="BARC.L", label="Barclays (LSE)", note="UK clearing bank"},
|
||||
{symbol="BNP.PA", label="BNP Paribas (Paris)", note="EU systemic"},
|
||||
{symbol="DBK.DE", label="Deutsche Bank (Frankfurt)", note="EU stress canary"},
|
||||
{symbol="^FTAS", label="FTSE All-Share", note="UK breadth"},
|
||||
]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# flash_news.py — RSS feed registry, by category
|
||||
# =============================================================================
|
||||
|
||||
[feeds]
|
||||
|
||||
markets = [
|
||||
{name="BBC Business", url="https://feeds.bbci.co.uk/news/business/rss.xml"},
|
||||
{name="Guardian Business", url="https://www.theguardian.com/uk/business/rss"},
|
||||
{name="CNBC Top", url="https://www.cnbc.com/id/100003114/device/rss/rss.html"},
|
||||
{name="MarketWatch Top", url="https://feeds.content.dowjones.io/public/rss/mw_topstories"},
|
||||
{name="FT Markets", url="https://www.ft.com/markets?format=rss"},
|
||||
{name="Yahoo Finance", url="https://finance.yahoo.com/news/rssindex"},
|
||||
]
|
||||
|
||||
world = [
|
||||
{name="BBC World", url="https://feeds.bbci.co.uk/news/world/rss.xml"},
|
||||
{name="Al Jazeera", url="https://www.aljazeera.com/xml/rss/all.xml"},
|
||||
]
|
||||
|
||||
energy = [
|
||||
{name="OilPrice", url="https://oilprice.com/rss/main"},
|
||||
]
|
||||
|
||||
# Pan-Asia coverage: HK/China, Japan, Korea, SE Asia, regional wire.
|
||||
asia = [
|
||||
{name="SCMP", url="https://www.scmp.com/rss/91/feed/"},
|
||||
{name="China Daily", url="http://www.chinadaily.com.cn/rss/world_rss.xml"},
|
||||
{name="Xinhua", url="http://www.xinhuanet.com/english/rss/worldrss.xml"},
|
||||
{name="Japan Times", url="https://www.japantimes.co.jp/feed/"},
|
||||
{name="Nikkei Asia", url="https://asia.nikkei.com/rss/feed/nar"},
|
||||
{name="Yonhap", url="https://en.yna.co.kr/RSS/news.xml"},
|
||||
{name="Straits Times", url="https://www.straitstimes.com/news/world/rss.xml"},
|
||||
{name="Asia Times", url="https://asiatimes.com/feed/"},
|
||||
]
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# flash_news.py — built-in keyword presets for headline filtering
|
||||
# =============================================================================
|
||||
|
||||
[news.presets]
|
||||
|
||||
# Mirrors Family_Wealth_Summary_v2.md §8 macro thesis. Swap freely if the
|
||||
# portfolio's thesis changes (e.g. crypto, biotech, deep value).
|
||||
thesis = [
|
||||
"hormuz", "iran", "opec", "brent", "wti", "crude", "oil", "gas", "lng",
|
||||
"china", "taiwan", "yuan", "beijing", "xi",
|
||||
"fed ", "powell", "ecb", "lagarde", "boe ", "boj", "bailey",
|
||||
"inflation", "cpi", "rate cut", "rate hike", "yield",
|
||||
"gold", "silver", "dollar", "yen",
|
||||
"sanction", "tariff", "trade war",
|
||||
"saudi", "russia", "ukraine", "israel", "nato",
|
||||
"defence", "defense", "rearmament",
|
||||
]
|
||||
|
||||
# Tech / AI sector — semis, hyperscaler capex, model labs, chip-export controls.
|
||||
tech = [
|
||||
" ai ", "ai ", " ai,", "artificial intelligence",
|
||||
"nvidia", "openai", "anthropic", "deepmind", "gemini", "chatgpt",
|
||||
"semiconductor", "chip", "foundry", "tsmc", "asml", "samsung",
|
||||
"lithography", "euv", "wafer",
|
||||
"data centre", "data center", "hyperscaler", "capex",
|
||||
"broadcom", "amd ", "arm holdings", "intel ",
|
||||
"apple", "microsoft", "alphabet", "google", "meta ", "tesla",
|
||||
"cloud", "saas", "compute",
|
||||
]
|
||||
|
||||
# Financials — banks, credit, central banks, market plumbing.
|
||||
finance = [
|
||||
"bank", "banking", "lender", "lending",
|
||||
"jpmorgan", "goldman", "morgan stanley", "wells fargo", "citigroup",
|
||||
"hsbc", "barclays", "lloyds", "natwest", "santander",
|
||||
"bnp paribas", "deutsche bank", "credit suisse", "ubs",
|
||||
"federal reserve", "rate cut", "rate hike", "basel",
|
||||
"credit spread", "default", "junk bond", "high yield",
|
||||
"private credit", "shadow banking",
|
||||
"earnings", "buyback", "dividend",
|
||||
]
|
||||
18
config/portfolio.toml
Normal file
18
config/portfolio.toml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Portfolio config — optional user-specific overrides on top of default.toml.
|
||||
#
|
||||
# As of v0.2 the portfolio composition (the "pie") is sourced live from the
|
||||
# Trading 212 /equity/portfolio endpoint, not from this file. The portfolio_job
|
||||
# also calls /equity/metadata/instruments to attach human-readable names. Once
|
||||
# portfolio_job has run, the dashboard's Portfolio panel shows the live
|
||||
# composition and the news_job uses those tickers for per-ticker headlines.
|
||||
#
|
||||
# This file is still loaded — anything you add here overlays default.toml.
|
||||
# Use it for:
|
||||
# - extra indicator groups (e.g. a "crypto" or "watchlist" group):
|
||||
# [groups]
|
||||
# crypto = [
|
||||
# {symbol="BTC-USD", label="Bitcoin", note=""},
|
||||
# {symbol="ETH-USD", label="Ethereum", note=""},
|
||||
# ]
|
||||
# - replacing universal groups from default.toml (same key wins)
|
||||
# - adding portfolio-specific RSS feeds or keyword presets
|
||||
Loading…
Add table
Add a link
Reference in a new issue