Publish settlement clarifications and atomically clear affected orders
This commit is contained in:
@@ -5,6 +5,13 @@ CREATE TABLE IF NOT EXISTS markets (
|
||||
id TEXT PRIMARY KEY, rules TEXT NOT NULL, phase TEXT NOT NULL,
|
||||
collateral INTEGER NOT NULL DEFAULT 0 CHECK(collateral >= 0), winner TEXT
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS market_clarifications (
|
||||
id INTEGER PRIMARY KEY, market TEXT NOT NULL REFERENCES markets(id),
|
||||
content TEXT NOT NULL CHECK(length(trim(content))>0),
|
||||
clear_book INTEGER NOT NULL CHECK(clear_book IN (0,1)),
|
||||
created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now'))
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS clarifications_by_market ON market_clarifications(market,id);
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user