14 tables consolidated from the LIVE post-ALTER dolphin_pink schema (maras_tp + provenance folded into base CREATEs — a fresh DB never replays ALTER chains) + violet_feed_divergence (scan-vs-venue divergence metric, session_id + plane seqs + mono_ns). apply_violet_ddl.py posts ONE statement per HTTP request (multi-statement posts fail — proven on pink 08), is idempotent (all IF NOT EXISTS, double-apply tested live), and verifies the expected table set. Applied to live CH: verify all 14 present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21 lines
733 B
SQL
21 lines
733 B
SQL
-- VIOLET V1: scan-vs-venue price divergence metric (the FET 0.2176-vs-0.1878
|
|
-- detector). One row per (scan, asset-with-fresh-venue-mid). session_id is a
|
|
-- boot-time UUID — mono_ns is meaningless across restarts without it.
|
|
-- Apply via apply_violet_ddl.py (one statement per HTTP POST).
|
|
|
|
CREATE TABLE IF NOT EXISTS dolphin_violet.violet_feed_divergence
|
|
(
|
|
`ts` DateTime64(3, 'UTC'),
|
|
`session_id` String,
|
|
`asset` LowCardinality(String),
|
|
`scan_price` Float64,
|
|
`venue_mid` Float64,
|
|
`divergence_bps` Float64,
|
|
`scan_seq` UInt64,
|
|
`venue_seq` UInt64,
|
|
`mono_ns` UInt64
|
|
)
|
|
ENGINE = MergeTree
|
|
ORDER BY (asset, ts)
|
|
TTL toDate(ts) + toIntervalDay(180);
|