Rank market holders by net outcome exposure with per-token pagination

This commit is contained in:
2026-12-03 05:31:52 +08:00
parent 02f0c224e0
commit 160c3890ff
10 changed files with 296 additions and 2 deletions
+1
View File
@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS positions (
account TEXT REFERENCES accounts, market TEXT REFERENCES markets, outcome TEXT,
quantity INTEGER NOT NULL CHECK(quantity >= 0), PRIMARY KEY(account,market,outcome)
);
CREATE INDEX IF NOT EXISTS positions_by_market ON positions(market,account,outcome);
CREATE TABLE IF NOT EXISTS orders (
seq INTEGER PRIMARY KEY, account TEXT REFERENCES accounts, market TEXT REFERENCES markets,
outcome TEXT NOT NULL, side TEXT NOT NULL, price INTEGER NOT NULL, quantity INTEGER NOT NULL,