Phase 7 live adapter prep layer

This commit is contained in:
Codex
2026-05-06 16:32:48 +08:00
parent c3cb2e944f
commit d7a04975c7
19 changed files with 1032 additions and 1 deletions
@@ -0,0 +1,29 @@
create table if not exists live_operation_audits (
id bigserial primary key,
adapter_name text not null,
operation_type text not null,
status text not null,
execution_ticket_id bigint references execution_tickets(id),
execution_id bigint references trade_executions(id),
signal_id bigint references trade_signals(id),
instrument_id bigint references instruments(id),
requested_by text,
requested_at timestamptz not null,
completed_at timestamptz,
live_trading_enabled boolean not null default false,
explicit_confirmation boolean not null default false,
payload jsonb not null default '{}'::jsonb,
result jsonb not null default '{}'::jsonb,
reason_codes 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_live_operation_audits_requested_desc
on live_operation_audits (requested_at desc);
create index if not exists idx_live_operation_audits_ticket_requested_desc
on live_operation_audits (execution_ticket_id, requested_at desc);
create index if not exists idx_live_operation_audits_execution_requested_desc
on live_operation_audits (execution_id, requested_at desc);