Audit doc alignment trading workbench

This commit is contained in:
Codex
2026-05-06 18:33:13 +08:00
parent 0d6e2e66f0
commit ee222eb40c
17 changed files with 1412 additions and 3 deletions
+19
View File
@@ -0,0 +1,19 @@
create table if not exists market_states (
id bigserial primary key,
instrument_id bigint not null references instruments(id),
snapshot_ts timestamptz not null,
timeframe text not null,
session_code text,
data_freshness text,
candle_age_seconds numeric(18,4),
news_window_state jsonb not null default '{}'::jsonb,
opening_volatility_state jsonb not null default '{}'::jsonb,
account_state jsonb not null default '{}'::jsonb,
position_state jsonb not null default '{}'::jsonb,
meta jsonb not null default '{}'::jsonb,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
create index if not exists idx_market_states_instr_snapshot_desc
on market_states (instrument_id, snapshot_ts desc);