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); }