Currently, the Kalshi implementation for fetchMarkets (sorting) and searchMarkets (filtering) is entirely client-side. Because the Kalshi V2 API relies on cursor-based pagination and lacks global sorting/search parameters for the /events endpoint, the library is forced to:
- Sequentially fetch multiple pages of data.
- Flatten the nested event/market structure.
- Perform
.sort() or .filter() in JavaScript.
Impact:
- High latency for search queries compared to Polymarket (which supports server-side sorting via Gamma).
- High number of API requests to fetch a comprehensive list of markets.
Goal:
Currently, the Kalshi implementation for
fetchMarkets(sorting) andsearchMarkets(filtering) is entirely client-side. Because the Kalshi V2 API relies on cursor-based pagination and lacks global sorting/search parameters for the/eventsendpoint, the library is forced to:.sort()or.filter()in JavaScript.Impact:
Goal: