VIOLET V1a: dolphin_violet DDL set + statement-wise applier (applied + verified)
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>
This commit is contained in:
55
prod/clickhouse/violet/01_policy_events.sql
Normal file
55
prod/clickhouse/violet/01_policy_events.sql
Normal file
@@ -0,0 +1,55 @@
|
||||
-- dolphin_violet DDL — consolidated from the LIVE dolphin_pink schema
|
||||
-- (post-ALTER: includes maras_tp + provenance columns). Generated 2026-06-12.
|
||||
-- Apply via apply_violet_ddl.py (one statement per HTTP POST).
|
||||
|
||||
CREATE TABLE IF NOT EXISTS dolphin_violet.policy_events
|
||||
(
|
||||
`ts` DateTime64(6, 'UTC'),
|
||||
`ts_day` Date MATERIALIZED toDate(ts),
|
||||
`strategy` LowCardinality(String),
|
||||
`runtime_namespace` LowCardinality(String) DEFAULT '',
|
||||
`strategy_namespace` LowCardinality(String) DEFAULT '',
|
||||
`event_namespace` LowCardinality(String) DEFAULT '',
|
||||
`actor_name` LowCardinality(String) DEFAULT '',
|
||||
`exec_venue` LowCardinality(String) DEFAULT '',
|
||||
`data_venue` LowCardinality(String) DEFAULT '',
|
||||
`source` LowCardinality(String),
|
||||
`trade_id` String,
|
||||
`asset` LowCardinality(String),
|
||||
`side` LowCardinality(String),
|
||||
`entry_price` Float64,
|
||||
`current_price` Float64,
|
||||
`quantity` Float64,
|
||||
`notional` Float64,
|
||||
`leverage` Float32,
|
||||
`bar_idx` UInt32,
|
||||
`decision_seq` UInt32,
|
||||
`bars_held` UInt16,
|
||||
`action` LowCardinality(String),
|
||||
`reason` LowCardinality(String),
|
||||
`pnl_pct` Float32,
|
||||
`mfe` Float32,
|
||||
`mae` Float32,
|
||||
`mfe_risk` Float32,
|
||||
`mae_risk` Float32,
|
||||
`exit_pressure` Float32,
|
||||
`rv_comp` Float32,
|
||||
`mae_thresh1` Float32,
|
||||
`bounce_score` Float32,
|
||||
`bounce_risk` Float32,
|
||||
`ob_imbalance` Float32,
|
||||
`vel_div_entry` Float32,
|
||||
`vel_div_now` Float32,
|
||||
`v50_vel` Float32,
|
||||
`v750_vel` Float32,
|
||||
`exf_funding` Float32,
|
||||
`exf_dvol` Float32,
|
||||
`exf_fear_greed` Float32,
|
||||
`exf_taker` Float32,
|
||||
`posture` LowCardinality(String)
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
PARTITION BY toYYYYMM(ts)
|
||||
ORDER BY (ts_day, trade_id, decision_seq, ts)
|
||||
TTL ts_day + toIntervalDay(180)
|
||||
SETTINGS index_granularity = 8192;
|
||||
Reference in New Issue
Block a user