Expose account executions with original order, role and fill economics
This commit is contained in:
@@ -93,3 +93,14 @@ CREATE TRIGGER IF NOT EXISTS finish_deadline AFTER UPDATE OF status ON orders
|
||||
WHEN OLD.status='live' AND NEW.status<>'live' BEGIN
|
||||
UPDATE order_deadlines SET pending=0 WHERE seq=NEW.seq;
|
||||
END;
|
||||
|
||||
-- A present row with no taker records an opening auction. Older executions
|
||||
-- have no row and retain an unknown role.
|
||||
CREATE TABLE IF NOT EXISTS execution_context (
|
||||
execution INTEGER PRIMARY KEY, taker_order INTEGER REFERENCES orders(seq)
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS account_orders_history ON orders(account,seq);
|
||||
CREATE INDEX IF NOT EXISTS fills_by_bid ON fills(bid,seq);
|
||||
CREATE INDEX IF NOT EXISTS fills_by_ask ON fills(ask,seq);
|
||||
CREATE INDEX IF NOT EXISTS paired_by_yes ON paired_fills(yes_order,seq);
|
||||
CREATE INDEX IF NOT EXISTS paired_by_no ON paired_fills(no_order,seq);
|
||||
|
||||
Reference in New Issue
Block a user