feat: improve SQL query formatting and add type hints for better clarity
CI / lint-test-build (push) Failing after 53s
CI / lint-test-build (push) Failing after 53s
This commit is contained in:
@@ -13,13 +13,11 @@ 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)
|
||||
|
||||
Reference in New Issue
Block a user