Skip to content

Feed capability map (IDataFeed.has) is computed by every feed but never exposed through any route or SDK #1686

Description

@realfishsam

Gap

Every data feed (Chainlink, Binance) computes a capability map analogous to BaseExchange.has, but scoped to feeds (IDataFeed.has). It's used internally by the server to gate unsupported methods, but there is no route or SDK method that lets a consumer introspect it before calling — this is a completely separate type/code path from the exchange-level has gaps already filed.

Core

core/src/feeds/interfaces.ts:7-27 declares DataFeedCapability/DataFeedCapabilities and IDataFeed.has?: DataFeedCapabilities. core/src/feeds/binance/binance-feed.ts:21-28 populates { fetchOHLCV: false, fetchOrderBook: false }; core/src/feeds/chainlink/chainlink-feed.ts:36-46 populates { fetchOHLCV: false, fetchOrderBook: false, fetchOracleRound: true, fetchOracleHistory: true, fetchHistoricalPrices: true }. core/src/server/feed-routes.ts:169-174 (sendUnsupportedIfNeeded) reads feed.has?.[method] server-side to return 501, but no route returns .has itself — not even root GET /api/feeds/ (feed-routes.ts:12-14), which only returns AVAILABLE_FEEDS (a bare array of names).

TypeScript SDK

Missing — sdks/typescript/pmxt/feed-client.ts has no has property or method (full file: only listFeeds, loadMarkets, fetchTicker(s), fetchOHLCV, fetchOracleRound, fetchOracleHistory, fetchHistoricalPrices).

Python SDK

Missing — sdks/python/pmxt/feed_client.py has no has/capability-introspection equivalent (same method set, snake_case).

Evidence

grep -rln "DataFeedCapabilities\|DataFeedCapability" core/src sdks returns only feed-routes.ts and interfaces.ts — never referenced in either SDK or any other server route. Cross-checked the existing backlog: distinct from ExchangeHas/BaseExchange.has issues already filed (those cover trading exchanges, a completely separate type with no shared code path).

Impact

SDK users have no way to discover, per feed, which methods are actually supported before calling them — e.g. that Chainlink supports oracle methods but not fetchOHLCV, or that Binance supports neither fetchOHLCV nor fetchOrderBook. Calling an unsupported method is the only way to find out, via a runtime 501.


Found by automated Core-to-SDK surface coverage audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions