Apply per-market taker fees to cash budgets, fills and account activity
This commit is contained in:
@@ -233,3 +233,15 @@ WHEN NEW.phase='resolved' AND OLD.phase<>'resolved' BEGIN
|
||||
INSERT INTO price_settlements(market,winner,at_ms)
|
||||
VALUES(NEW.id,NEW.winner,CAST(unixepoch('subsec')*1000 AS INTEGER));
|
||||
END;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS market_fee_rates (
|
||||
market TEXT PRIMARY KEY REFERENCES markets(id), rate_ppm INTEGER NOT NULL CHECK(rate_ppm BETWEEN 0 AND 1000000)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS cash_remainders (
|
||||
account TEXT PRIMARY KEY REFERENCES accounts(id), micros INTEGER NOT NULL CHECK(micros BETWEEN 0 AND 9999)
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS execution_fees (
|
||||
execution INTEGER PRIMARY KEY REFERENCES execution_context(execution),
|
||||
taker_order INTEGER NOT NULL REFERENCES orders(seq), fee_micros INTEGER NOT NULL CHECK(fee_micros>0)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS fees_by_order ON execution_fees(taker_order);
|
||||
|
||||
Reference in New Issue
Block a user