Serve a public market and event trade feed with taker-side pricing

This commit is contained in:
2026-12-03 05:41:41 +08:00
parent 160c3890ff
commit 38742fbdec
8 changed files with 288 additions and 0 deletions
+2
View File
@@ -95,6 +95,8 @@ CREATE TABLE IF NOT EXISTS paired_fills (
quantity INTEGER NOT NULL CHECK(quantity>0),
at_ms INTEGER NOT NULL DEFAULT (CAST(unixepoch('subsec')*1000 AS INTEGER))
);
CREATE INDEX IF NOT EXISTS public_direct_time ON trade_prices(at_ms,fill);
CREATE INDEX IF NOT EXISTS public_paired_time ON paired_fills(at_ms,seq);
CREATE INDEX IF NOT EXISTS paired_history ON paired_fills(market,at_ms,seq);
CREATE VIEW IF NOT EXISTS next_execution AS
SELECT 1+MAX(COALESCE((SELECT MAX(seq) FROM fills),0),