Skip to content

[Kalshi] Optimization: Implement server-side search/sort #1

@realfishsam

Description

@realfishsam

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:

  1. Sequentially fetch multiple pages of data.
  2. Flatten the nested event/market structure.
  3. 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:

  • Track Kalshi API documentation for any updates to search/sort capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightwontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions