Trades: honor an explicit 'outside' mark on trades from before marking began

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-10-26 19:33:29 -05:00
co-authored by Claude Opus 5.5
parent a0e7c5b7c2
commit c109aff3e5
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -582,7 +582,9 @@ export function wipeAccountData(accountId: number): void {
// Every position a platform's history shows — the bot's and anyone else's
// (Vest: GET /v3/positions). The platform can't tell an API order from a
// click, so opened_by / closed_by record what this instance did itself:
// 'bot' when its own order opened or closed the position, NULL otherwise.
// 'bot' when its own order opened or closed the position, NULL otherwise —
// or 'outside', set by hand for a trade from before marking began whose
// origin the bot's own log settles.
// A wipe leaves these alone: they're refetched, but the marks aren't.
db.exec(`