Split out of #116 (which converts the 4 non-breaking methods). premium.__call__ was deferred because it is not safely convertible onto request_endpoint yet — the codegen registry (datamaxi/_endpoints.py, op premium) is incomplete for premium, so routing through request_endpoint (which rejects any param absent from the registry) would silently drop working filters.
Two problems, coupled
1. camelCase wire bug (real, live-affecting)
premium.__call__ hand-translates 4 snake_case kwargs into camelCase on the wire, which the snake_case backend ignores:
sourceExchange → should be source_exchange
targetExchange → should be target_exchange
sourceQuote → should be source_quote
targetQuote → should be target_quote
So source/target exchange + quote filtering is currently broken against the live API (params silently dropped). The public Python kwargs are already snake_case; only the wire keys are wrong.
2. registry is missing most premium filters (blocks request_endpoint conversion)
The premium registry entry lacks ~35 params the method sends. Evidence they are a registry gap, not dead params:
- min/max asymmetry: the registry has
min_sv/min_tv but not max_sv/max_tv. A backend supporting a min bound but silently ignoring the matching max is implausible — the registry is simply incomplete.
token_include/token_exclude are known-working (project memory: they accept full names like bitcoin, not tickers — confirmed from actual use). Absent from the registry.
- Premium likely hits the front-api, whose params are not captured by the data-api swaggo→openapi.yaml that feeds codegen — so the gap is expected. See [[codegen-upstream]].
The full set currently sent but registry-absent: every min_/max_ pd/pdp/pdp{24h,4h,1h,30m,15m,5m}/spdp*/dsp/dtp filter, max_sv, max_tv, all _net/_source/_target_funding_rate bounds, source_funding_rate_interval, target_funding_rate_interval, token_include, token_exclude.
Remediation (two steps, in order)
- Now (SDK-side, no upstream dep): fix the 4 camelCase→snake_case wire keys on the existing
self.query("/api/v1/premium", ...) path, keeping all filter params. Update tests/test_premium.py::test_premium_call_param_name_translation to assert source_exchange (not sourceExchange).
- Then (upstream): verify each premium filter param-by-param against the live backend; add the genuinely-supported ones to the OpenAPI spec so codegen re-emits them into the registry. Only after the registry is complete, convert
premium.__call__ onto request_endpoint and update tests/test_integration.py premium cases (currently call min_pdp/token_include/etc.).
Done when
- camelCase→snake_case wire fix shipped (step 1); live source/target filtering works.
- premium registry gap reconciled upstream: every real premium filter present in
datamaxi/_endpoints.py; token_include/token_exclude confirmed + added.
premium.__call__ routed through request_endpoint with no loss of filter params; tests/test_integration.py premium cases run without TypeError.
Context: reviewed during PR #117. The 4 non-breaking methods merged there. Supersedes the premium portion of #118.
Split out of #116 (which converts the 4 non-breaking methods).
premium.__call__was deferred because it is not safely convertible ontorequest_endpointyet — the codegen registry (datamaxi/_endpoints.py, oppremium) is incomplete for premium, so routing throughrequest_endpoint(which rejects any param absent from the registry) would silently drop working filters.Two problems, coupled
1. camelCase wire bug (real, live-affecting)
premium.__call__hand-translates 4 snake_case kwargs into camelCase on the wire, which the snake_case backend ignores:sourceExchange→ should besource_exchangetargetExchange→ should betarget_exchangesourceQuote→ should besource_quotetargetQuote→ should betarget_quoteSo source/target exchange + quote filtering is currently broken against the live API (params silently dropped). The public Python kwargs are already snake_case; only the wire keys are wrong.
2. registry is missing most premium filters (blocks request_endpoint conversion)
The
premiumregistry entry lacks ~35 params the method sends. Evidence they are a registry gap, not dead params:min_sv/min_tvbut notmax_sv/max_tv. A backend supporting aminbound but silently ignoring the matchingmaxis implausible — the registry is simply incomplete.token_include/token_excludeare known-working (project memory: they accept full names likebitcoin, not tickers — confirmed from actual use). Absent from the registry.The full set currently sent but registry-absent: every
min_/max_pd/pdp/pdp{24h,4h,1h,30m,15m,5m}/spdp*/dsp/dtpfilter,max_sv,max_tv, all_net/_source/_target_funding_ratebounds,source_funding_rate_interval,target_funding_rate_interval,token_include,token_exclude.Remediation (two steps, in order)
self.query("/api/v1/premium", ...)path, keeping all filter params. Updatetests/test_premium.py::test_premium_call_param_name_translationto assertsource_exchange(notsourceExchange).premium.__call__ontorequest_endpointand updatetests/test_integration.pypremium cases (currently callmin_pdp/token_include/etc.).Done when
datamaxi/_endpoints.py;token_include/token_excludeconfirmed + added.premium.__call__routed throughrequest_endpointwith no loss of filter params;tests/test_integration.pypremium cases run withoutTypeError.Context: reviewed during PR #117. The 4 non-breaking methods merged there. Supersedes the premium portion of #118.