Match complementary binary orders and settle paired issuance or merge

This commit is contained in:
2026-12-03 03:49:42 +08:00
parent 4eb80fa458
commit 47d49cb8c9
10 changed files with 238 additions and 38 deletions
+8 -1
View File
@@ -43,7 +43,14 @@ impl Exchange {
if payload == json!({"op":"state"}) {
let tx = self.db.transaction()?;
let mut state = Map::new();
for table in ["accounts", "markets", "positions", "orders", "fills"] {
for table in [
"accounts",
"markets",
"positions",
"orders",
"fills",
"paired_fills",
] {
let mut stmt = tx.prepare(&format!("SELECT * FROM {table} ORDER BY rowid"))?;
let names: Vec<String> =
stmt.column_names().into_iter().map(str::to_owned).collect();