Analysis methods

Analysis methods for sigstar. Collect market, on-chain, news and macro data, and explain, forecast and alert on crypto price moves from every angle.

Explain. For the asset and day: the close-to-close return, its z-score and its rank in the last 30 days. Then every feature's z-score that day and the day before, ranked by size (|z| ≥ 2 is marked unusual), with the raw value and the 30-day median. News readings carry that day's headlines (feed items first, then GDELT's relevance order) with links, and up to three of the asset's headlines that day are listed as context either way. Other assets' moves the same day show co-movement. Notes say which angles had no data. Intraday range and volume move with price by construction, so read them as describing the move rather than explaining it.

Relationships. Pearson correlations of daily returns (full window and last 30 days); OLS betas against BTC; lead/lag correlations of funding, open interest change, news volume, news tone and Fear & Greed change against returns and absolute returns for lags -3 to +3 days; Granger F-tests (lags 1-3) with Bonferroni-adjusted p-values over all tests run; two-state Markov-switching volatility regimes on daily returns (switching variance), falling back to a median split of 7-day realised volatility if the model fails.

Anomalies. For every feature, the dbt z-score and a robust z (median and MAD of the previous 60 days, scaled by 1.4826); either at or above 3 counts.

Forecasts. Targets: daily close, 7-day realised volatility and daily volume (price and volume on the log scale). Models: naive (no change, with an empirical interval from the series' own past k-day changes), ETS (additive errors, no trend or damped trend, chosen by AIC) and ARIMA (orders (0,1,1), (1,1,0), (1,0,0), (1,0,1), chosen by AIC). Each is scored by a rolling-origin backtest over the last 20 days, horizons 1-7: MAE, MAPE and MAE relative to naive. A model is preferred only if it beats naive's MAE by at least 2%; otherwise the naive forecast is shown and the output says so. Intervals are 80%.

Alerts. Rules in sigstar-rules.yml:

lookback_days: 90
rules:
  - name: eth_funding_hot_news_negative
    description: ETH funding above its 95th percentile while its news tone is unusually negative
    assets: [ETH]                 # or ["*"] for every asset
    all:                          # or any:
      - {feature: funding_rate, above: p95}   # percentile of the asset's own history
      - {feature: news_tone_z, below: -2}     # a number
      - {feature: ret_1d_z, abs_above: 3}     # size either way

Rules are checked on each asset's latest closed day (or --date). A missing value never satisfies a condition. Each alert lists every condition with its value and threshold, and carries the not-financial-advice notice. New alerts (once per rule, asset and day) are printed, appended to alerts.jsonl and alerts.csv, and POSTed as JSON ({"text": ..., "alert": {...}}) to SIGSTAR_ALERT_WEBHOOK_URL when set; a webhook failure is a warning, and the URL is never printed.