Convert NO positions and conserve collateral across fixed negative-risk groups
This commit is contained in:
@@ -189,3 +189,14 @@ CREATE TABLE IF NOT EXISTS budget_buys (
|
||||
amount_cents INTEGER NOT NULL CHECK(amount_cents>0),
|
||||
spent_cents INTEGER NOT NULL CHECK(spent_cents BETWEEN 0 AND amount_cents)
|
||||
);
|
||||
|
||||
-- Each conversion adds an equal YES-minus-NO supply to every member.
|
||||
-- This reserve covers that excess at the single winning member.
|
||||
CREATE TABLE IF NOT EXISTS neg_risk_groups (
|
||||
id TEXT PRIMARY KEY, reserve_cents INTEGER NOT NULL DEFAULT 0 CHECK(reserve_cents>=0),
|
||||
winner TEXT REFERENCES markets
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS neg_risk_members (
|
||||
market TEXT PRIMARY KEY REFERENCES markets, group_id TEXT NOT NULL REFERENCES neg_risk_groups,
|
||||
ordinal INTEGER NOT NULL, UNIQUE(group_id,ordinal)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user