clickhouse: commit exit-leg/reconstruction/maras DDLs + UV/violet DDLs (M1 vendor reconcile, upstream-first)
This commit is contained in:
18
prod/clickhouse/pink/02_create_trade_reconstruction.sql
Normal file
18
prod/clickhouse/pink/02_create_trade_reconstruction.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE IF NOT EXISTS dolphin_pink.trade_reconstruction
|
||||
(
|
||||
`ts` DateTime64(6, 'UTC'),
|
||||
`ts_day` Date MATERIALIZED toDate(ts),
|
||||
`trade_id` String,
|
||||
`event_type` LowCardinality(String),
|
||||
`event_id` String,
|
||||
`payload_json` String,
|
||||
`market_state_bundle_json` String DEFAULT '',
|
||||
`tp_base_pct` Float32 DEFAULT 0,
|
||||
`tp_effective_pct` Float32 DEFAULT 0,
|
||||
`our_leverage` Float32 DEFAULT 0
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
PARTITION BY toYYYYMM(ts)
|
||||
ORDER BY (ts_day, trade_id, event_type, event_id)
|
||||
TTL ts_day + toIntervalDay(180)
|
||||
SETTINGS index_granularity = 8192
|
||||
Reference in New Issue
Block a user