Record committed best-bid and ask changes for resumable quote history

This commit is contained in:
2026-12-03 04:59:47 +08:00
parent e397f21321
commit a77efc6bb8
9 changed files with 258 additions and 10 deletions
+10
View File
@@ -17,6 +17,7 @@ mod market;
mod neg_risk;
mod portfolio;
mod prices_history;
mod quotes;
mod resident;
mod resolution;
use resident::Books;
@@ -43,6 +44,14 @@ impl Exchange {
if !activity_ready {
db.execute_batch(include_str!("activity_schema.sql"))?;
}
let quotes_ready: bool = db.query_row(
"SELECT EXISTS(SELECT 1 FROM sqlite_schema WHERE type='table' AND name='quote_events')",
[],
|row| row.get(0),
)?;
if !quotes_ready {
db.execute_batch(include_str!("quote_schema.sql"))?;
}
let tx = expiry::transaction(&db, TransactionBehavior::Deferred)?;
let books = Books::recover(&tx)?;
tx.commit()?;
@@ -60,6 +69,7 @@ impl Exchange {
| "history"
| "prices_history"
| "quote"
| "quote_history"
| "book"
| "open_orders"
| "positions"