From 03035b3965142d2b618c1189948bced7ed6d15fd Mon Sep 17 00:00:00 2001 From: Manohar Date: Fri, 8 May 2026 17:13:17 +0000 Subject: [PATCH] fix: recordSnapshot type annotation + datetime quotes --- src/tracker/poll.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tracker/poll.ts b/src/tracker/poll.ts index 86c55c6..e3920f6 100644 --- a/src/tracker/poll.ts +++ b/src/tracker/poll.ts @@ -208,13 +208,13 @@ export async function forcePoll(): Promise { * Record a portfolio-level P&L snapshot after every fetch. * Called by both pollTick (market hours) and forcePoll (manual/startup). */ -function recordSnapshot(positions: import(../angel/types.js).Position[]): void { +function recordSnapshot(positions: Position[]): void { const totalUnrealised = positions.reduce((s, p) => s + p.unrealisedPnl, 0); const totalRealised = positions.reduce((s, p) => s + p.realisedPnl, 0); const totalPnl = totalUnrealised + totalRealised; db.prepare(` INSERT INTO pnl_snapshots (total_unrealised, total_realised, total_pnl, open_positions, recorded_at) - VALUES (?, ?, ?, ?, datetime(now)) + VALUES (?, ?, ?, ?, datetime('now')) `).run(totalUnrealised, totalRealised, totalPnl, positions.length); }