Vest: an account's name ends in the number the Vest app shows
Vest's app shows attempt_index + 1 ("Account 73"), padded below 10
("Account 01"); the name ended in attempt_index, one lower, so the
dashboard's V50K-E-D3-T10-73 was Vest's Account 74. It now ends in the
app's number, and 0 for an account Vest gives no attempt index (its
"Legacy Account"). Account types match on the prefix, and everything saved
locally is keyed by account id, so nothing else moves.
Reports mark a Vest firm vestAppNumbers. The master (634d52f) renames what
it saved under the old numbers on the first such report from a person, and
from then on leaves out a Vest firm reported under the old ones.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8a5b2a64e7
commit
8c863bdc1d
+22
-8
@@ -223,6 +223,7 @@ export interface VestCapitalAccount {
|
||||
/** The current stage: 'eval' or 'funded'. */
|
||||
kind: string;
|
||||
status: number;
|
||||
/** Vest's attempt_index, from 0; -1 when Vest leaves it out. */
|
||||
attemptIndex: number;
|
||||
initialCapital: number;
|
||||
/** The current stage's profit target in dollars (0 = none). */
|
||||
@@ -258,7 +259,7 @@ export function parseCapitalAccount(raw: unknown): VestCapitalAccount | null {
|
||||
blocked: Boolean(a.blocked_at),
|
||||
kind: typeof current.kind === 'string' ? current.kind : '',
|
||||
status: num(a.status) ?? -1,
|
||||
attemptIndex: num(a.attempt_index) ?? 0,
|
||||
attemptIndex: num(a.attempt_index) ?? -1,
|
||||
initialCapital: num(a.initial_capital) ?? 0,
|
||||
profitTarget: num(current.profit_target) ?? 0,
|
||||
targetEquity: num(a.target_equity),
|
||||
@@ -312,23 +313,36 @@ export function awaitingActivation(a: VestCapitalAccount): boolean {
|
||||
|
||||
const pct = (fraction: number) => Math.round(fraction * 1000) / 10;
|
||||
|
||||
/**
|
||||
* The number the Vest app shows for the account: attempt_index + 1, padded
|
||||
* below 10 ("Account 01"). An account without an attempt index (the app's
|
||||
* "Legacy Account") gets 0.
|
||||
*/
|
||||
export function vestAccountNumber(a: VestCapitalAccount): string {
|
||||
if (!(a.attemptIndex >= 0)) return '0';
|
||||
return `${a.attemptIndex < 9 ? '0' : ''}${a.attemptIndex + 1}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* What the dashboard calls the account and what account-type prefixes match
|
||||
* against. Vest itself only says "Account 34", so the name carries the rules
|
||||
* that tell its types apart:
|
||||
* V50K-E-D3-T10-34 evaluation, $50k, 3% daily loss, 10% target, attempt 34
|
||||
* that tell its types apart, ending in that same number:
|
||||
* V50K-E-D3-T10-34 evaluation, $50k, 3% daily loss, 10% target, Account 34
|
||||
* V50K-F-D3-34 the funded stage of an evaluation account
|
||||
* V25K-I-7 instant funded (no daily loss limit, no target)
|
||||
* V25K-I-07 instant funded (no daily loss limit, no target)
|
||||
* D0 = no daily loss limit. The target is the current stage's (a 2-Step's
|
||||
* second stage reads T5).
|
||||
* second stage reads T5). Older builds ended the name in attempt_index, one
|
||||
* lower; the master renames what it saved under those numbers when a report
|
||||
* marks the firm vestAppNumbers.
|
||||
*/
|
||||
export function vestAccountName(a: VestCapitalAccount): string {
|
||||
const size = a.initialCapital >= 1000 ? `${+(a.initialCapital / 1000).toFixed(1)}K` : `${Math.round(a.initialCapital)}`;
|
||||
const dll = `D${pct(a.maxDailyLossPct)}`;
|
||||
if (/instant/i.test(a.productType)) return `V${size}-I-${a.attemptIndex}`;
|
||||
if (a.kind === 'funded') return `V${size}-F-${dll}-${a.attemptIndex}`;
|
||||
const n = vestAccountNumber(a);
|
||||
if (/instant/i.test(a.productType)) return `V${size}-I-${n}`;
|
||||
if (a.kind === 'funded') return `V${size}-F-${dll}-${n}`;
|
||||
const target = a.initialCapital > 0 && a.profitTarget > 0 ? `-T${pct(a.profitTarget / a.initialCapital)}` : '';
|
||||
return `V${size}-E-${dll}${target}-${a.attemptIndex}`;
|
||||
return `V${size}-E-${dll}${target}-${n}`;
|
||||
}
|
||||
|
||||
// ── positions and orders ────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user