Overview

Social Price Correlation is an anomaly signal that measures whether social sentiment and price are behaving in an unusually aligned or unusually decoupled way.

The current implementation runs on 1h data for bitcoin, ethereum, solana, dogecoin, xrp, trx, and cardano.

It uses:

Data is aggregated hourly as follows:

The calculation pipeline in the repo is:

  1. Pull extra history before the requested start time so rolling windows and seasonality adjustment are valid.
  2. Merge social and price by dt and asset_id.
  3. Apply log1p to social and log to price.
  4. Adjust social for intraday seasonality by hour of day using hourly median and MAD.
  5. Compute 168h rolling correlation between adjusted social and log price.
  6. Apply Fisher Z transform to stabilize the correlation series.
  7. Compute a rolling median baseline over 1000h.
  8. Compute anomaly score as (current_fisher_z - rolling_median) / sigma, where sigma = 1 / sqrt(168 - 3).
  9. Emit a signal when abs(anomaly_score) > 3.

In practice, this signal is not just checking whether correlation is positive or negative. It checks whether the current social-price relationship is abnormally different from that asset's own recent baseline.