Skip non-Tradovate firms until their trading logic exists

The master's catalog now labels each firm with a platform (TopstepX being
the first non-Tradovate one). Sync accepts the field, defaulting anything
missing or unrecognized to tradovate so an older master still validates,
and getTradableFirms only hands Tradovate firms to the client.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Brandon Li
2026-09-02 11:24:24 -05:00
co-authored by Claude Fable 5
parent 3ce14d4928
commit 8350601cf0
2 changed files with 12 additions and 0 deletions
+8
View File
@@ -104,6 +104,10 @@ export function getCatalogMeta(): {
export function getTradableFirms(): (CatalogFirm & { username: string; password: string })[] {
const result: (CatalogFirm & { username: string; password: string })[] = [];
for (const firm of getCachedCatalog()) {
// Only Tradovate has a client. A TopstepX firm in the catalog is
// config-only for now; handing it to the Tradovate login would just
// burn attempts against the wrong platform.
if (firm.platform !== 'tradovate') continue;
const creds = getCredentials(firm.id);
if (creds) result.push({ ...firm, ...creds });
}
@@ -156,6 +160,10 @@ function validatePayload(raw: unknown): FirmCatalogPayload {
return {
id: firm.id,
name: firm.name,
// Lenient on purpose: a master from before the platform field (or
// with a platform this build doesn't know) must not fail the whole
// sync, and 'tradovate' is what every firm was until then.
platform: firm.platform === 'topstepx' ? 'topstepx' : 'tradovate',
bannedSymbols: Array.isArray(firm.bannedSymbols) ? (firm.bannedSymbols as string[]) : [],
accountTypes,
updatedAt: typeof firm.updatedAt === 'string' ? firm.updatedAt : new Date(0).toISOString(),