Skip to content

DataFeedOptions (rateLimit/enableCache/cacheTtlMs) is a public core type with no path to either SDK or feed-factory #2203

Description

@realfishsam

Gap

BaseDataFeed's constructor accepts a DataFeedOptions object (rateLimit, enableCache, cacheTtlMs) governing REST throttling and ticker-cache freshness for every feed. It's exported from core's public API (core/src/feeds/index.ts), but feed-factory.ts — the sole place that instantiates feeds for the server — never passes it, and neither feed-routes.ts nor either SDK's FeedClient exposes any way to influence it. This is a distinct axis of configurability from already-filed issue #1977 ("Data-feed WebSocket transport... zero external configurability"), which covers only wsUrl/apiKey/reconnectIntervalMs on BinanceFeedConfig/ChainlinkFeedConfigDataFeedOptions controls REST-side rate limiting and ticker caching on the shared BaseDataFeed class, and is also unrelated to BaseExchange.rateLimit (already covered by #996, a completely separate class).

Core

core/src/feeds/base-feed.ts:9-13:

export interface DataFeedOptions {
    rateLimit?: number;
    enableCache?: boolean;
    cacheTtlMs?: number;
}

core/src/feeds/base-feed.ts:24-34 — constructor stores Required<DataFeedOptions> with defaults (rateLimit: 10, enableCache: true, cacheTtlMs: 1000).

core/src/feeds/binance/binance-feed.ts:41 and core/src/feeds/chainlink/chainlink-feed.ts:61 — both concrete feeds accept options?: DataFeedOptions as a second constructor argument.

core/src/server/feed-factory.ts:17-26 — instantiates feeds with only the venue config object, never a second DataFeedOptions argument:

case 'binance':
    feed = new BinanceFeed({ apiKey: process.env.OBDATA_API_KEY });
    break;
case 'chainlink':
    feed = new ChainlinkFeed({ apiKey: process.env.OBDATA_API_KEY || '' });
    break;

core/src/feeds/index.ts:3export type { DataFeedOptions } from './base-feed'; (public core export).

TypeScript SDK

Missing — sdks/typescript/pmxt/feed-client.ts's FeedClientOptions (lines 61-64) has only pmxtApiKey/baseUrl; no rate-limit/cache knobs, and feed-routes.ts has no query params to carry them even if it did.

Python SDK

Missing — sdks/python/pmxt/feed_client.py's FeedClient.__init__ (lines 87-99) takes only feed_name, pmxt_api_key, base_url.

Evidence

grep -rn "DataFeedOptions\|rateLimit\|enableCache\|cacheTtlMs" sdks/ returns zero matches in either SDK. feed-factory.ts never constructs or forwards a second constructor argument to BinanceFeed/ChainlinkFeed.

Impact

Every hosted/self-hosted FeedClient.fetchTicker() call is silently capped at a 1000ms server-side cache TTL and a 10 req/s throttle, with no way for any SDK caller to request fresher data, a faster poll rate, or disable caching (e.g., for deterministic testing) — even though the underlying feed class was explicitly built to support exactly that.


Found by automated Core-to-SDK surface coverage audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions