From a857338846c62f6d3b9088a573b1c0e920b5d1ce Mon Sep 17 00:00:00 2001 From: Samuel Tinnerholm Date: Fri, 19 Jun 2026 06:38:53 +0000 Subject: [PATCH] fix(core): register Rain defaults in sidecar --- core/src/server/app.ts | 33 ++++++++++++-------- core/test/pipeline/default-exchanges.test.ts | 11 +++++++ 2 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 core/test/pipeline/default-exchanges.test.ts diff --git a/core/src/server/app.ts b/core/src/server/app.ts index 2ef866f7..d2ce1ebe 100644 --- a/core/src/server/app.ts +++ b/core/src/server/app.ts @@ -243,19 +243,26 @@ function normalizeDispatchArgs(methodName: string, args: unknown[], exchange?: s } // Singleton instances for local usage (when no credentials provided) -const defaultExchanges: Record = { - polymarket: null, - limitless: null, - kalshi: null, - "kalshi-demo": null, - probable: null, - baozi: null, - myriad: null, - opinion: null, - metaculus: null, - smarkets: null, - mock: null, -}; +export const DEFAULT_EXCHANGE_NAMES = [ + "polymarket", + "limitless", + "kalshi", + "kalshi-demo", + "probable", + "baozi", + "myriad", + "opinion", + "metaculus", + "smarkets", + "rain", + "gemini-titan", + "hyperliquid", + "mock", +] as const; + +const defaultExchanges: Record = Object.fromEntries( + DEFAULT_EXCHANGE_NAMES.map((exchangeName) => [exchangeName, null]), +); function getDefaultExchange(exchangeName: string): any { if (!defaultExchanges[exchangeName]) { diff --git a/core/test/pipeline/default-exchanges.test.ts b/core/test/pipeline/default-exchanges.test.ts new file mode 100644 index 00000000..8cd687c6 --- /dev/null +++ b/core/test/pipeline/default-exchanges.test.ts @@ -0,0 +1,11 @@ +import { DEFAULT_EXCHANGE_NAMES } from '../../src/server/app'; + +describe('sidecar default exchange registry', () => { + test('includes unauthenticated singleton entries for public Rain, Gemini Titan, and Hyperliquid reads', () => { + expect(DEFAULT_EXCHANGE_NAMES).toEqual(expect.arrayContaining([ + 'rain', + 'gemini-titan', + 'hyperliquid', + ])); + }); +});