refactor: improve SQL query formatting and enhance readability across multiple files
CI / lint-test-build (push) Failing after 56s

This commit is contained in:
2026-06-04 20:16:58 +02:00
parent 8ceca2a7e4
commit 170f59eb89
10 changed files with 127 additions and 67 deletions
+4 -2
View File
@@ -13,11 +13,13 @@ from arbitrade.storage.db import DuckDBStore
def _python_scan_compute(store: DuckDBStore) -> tuple[float, float | None, float | None]:
with store.connect() as conn:
trade_rows = conn.execute("""
trade_rows = conn.execute(
"""
SELECT started_at, finished_at, realized_pnl
FROM trades
WHERE finished_at IS NOT NULL
""").fetchall()
"""
).fetchall()
opportunity_rows = conn.execute("SELECT detected_at FROM opportunities").fetchall()
realized = sum(float(row[2]) for row in trade_rows if row[2] is not None)