Refactor: hardcode series ticker, keep dynamic

This commit is contained in:
2026-03-15 14:42:51 -07:00
parent b95430e863
commit 51177b5b8a

View File

@@ -1,5 +1,6 @@
import { signRequest, KALSHI_API_BASE } from './auth.js';
const SERIES_TICKER = 'KXBTC15M';
const OPEN_EVENT_STATUSES = new Set(['open', 'active', 'initialized', 'trading']);
async function kalshiFetch(method, path, body = null) {
@@ -68,8 +69,7 @@ async function fetchEvents(series, query) {
* Returns the currently active event + its markets.
*/
export async function getActiveBTCEvent() {
const configuredSeries = process.env.KALSHI_SERIES_TICKER || 'KXBTC15M';
const seriesCandidates = [...new Set([configuredSeries, configuredSeries.toUpperCase(), configuredSeries.toLowerCase()])];
const seriesCandidates = [...new Set([SERIES_TICKER, SERIES_TICKER.toLowerCase()])];
const eventMap = new Map();
for (const series of seriesCandidates) {