Skip to content

FeedClient.fetchOHLCV timeframe parameter has default "1h" in Python but no default in TypeScript #177

@realfishsam

Description

@realfishsam

Drift

Python FeedClient.fetch_ohlcv defaults timeframe to "1h" when omitted. TypeScript FeedClient.fetchOHLCV declares timeframe as optional (timeframe?: string) with no default, meaning the server receives an undefined/missing value when the caller omits it.

TypeScript SDK

sdks/typescript/pmxt/feed-client.ts, line 97:

async fetchOHLCV(symbol: string, timeframe?: string, since?: number, limit?: number): Promise<OHLCV[]>

When timeframe is undefined, it is excluded from the query string (see _get private method, line 121–124), so the server receives no timeframe key.

Python SDK

sdks/python/pmxt/feed_client.py, lines 125–128:

def fetch_ohlcv(
    self,
    symbol: str,
    timeframe: str = "1h",   # ← default "1h"
    since: Optional[int] = None,
    limit: Optional[int] = None,
) -> List[OHLCV]:

When timeframe is omitted, the server always receives timeframe=1h.

Expected

Both SDKs should agree on the default. TypeScript should either add timeframe: string = "1h" (apply the default before building the query string) or Python should remove the default, letting the server decide.

Impact

Calling feed.fetchOHLCV("BTC/USD") in TypeScript and feed.fetch_ohlcv("BTC/USD") in Python may return different candle granularities because the server receives different inputs.


Found by automated SDK cross-language drift audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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