Vest: the payout projection runs on Vest's day, and stages count each payout

projectPerfectPath takes the raw trade date (default: the Central one):
the reporter passes its tradeDateFor day and the account page the one
/api/state now gives each account. From 5 PM CT to 20:00 ET it took
tomorrow as today while every input was Vest's, so the day's claim moved
a day late, the next day's stage-1 payout dropped, and an open Vest-day
row counted twice.

Without same-day stages, the stage comes from the client's payout list
(payoutDays, one per payout) when it has read one, not the negative fund
rows: Vest books a day's two claims as one row, so the engine, claimDue,
the stage label and the projection stayed a stage behind the report.
StageInputs.payouts carries the count; a client with no list counts rows
as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-10-27 15:37:44 -05:00
co-authored by Claude Opus 5.5
parent 032ba1ca9c
commit 4a8e027056
7 changed files with 130 additions and 20 deletions
+6 -1
View File
@@ -84,6 +84,9 @@ export interface AccountState {
active: boolean;
amount: number;
realizedPnL: number;
/** The firm's raw trade date (tradeDateFor): Vest's turns at 20:00 ET,
* every other firm's at 5 PM CT. */
tradeDate: string;
daysTraded: number;
positionDirection: 'long' | 'short' | null;
/** Balance floor from Tradovate's auto-liquidation profile (0 = not set) */
@@ -99,7 +102,9 @@ export interface AccountState {
* consistency and minimum days all met (cycleCompletion 'today'). Only
* the final day; the firm may lock or remove the account afterwards. */
completed: boolean;
/** Current stage = 1 + number of withdrawals (negative fund transactions). Stage 1 = fresh account. */
/** Current stage = 1 + number of withdrawals (negative fund transactions,
* or the platform's own list where a row holds several; today's for a
* type whose stages reset each day). Stage 1 = fresh account. */
stage: number;
/** True when the current stage is a drain stage (spam-withdraw mode). */
stageDrain: boolean;