Follow-up to #119 / PR #120, which shipped Step 1 only (camelCase→snake_case wire-key fix). This tracks the deferred Step 2 — upstream-blocked at the time of #119.
Background
premium.__call__ (datamaxi/datamaxi/premium.py) still uses the hand-rolled self.query("/api/v1/premium", params) path rather than request_endpoint, because the codegen registry (datamaxi/_endpoints.py, op premium) is incomplete for premium. Routing through request_endpoint (which rejects any param absent from the registry) would silently drop working filters.
Evidence the gap is a registry omission, not dead params
- min/max asymmetry: registry has
min_sv/min_tv but not max_sv/max_tv. A backend supporting a min bound but ignoring the matching max is implausible.
token_include/token_exclude are known-working (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.
Registry-absent but currently sent: 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.
Work (in order)
- Verify each premium filter param-by-param against the live backend.
- Add the genuinely-supported ones to the upstream OpenAPI spec (
../datamaxi-backend) so codegen re-emits them into the premium registry entry. Confirm token_include/token_exclude and max_sv/max_tv land.
- Re-run codegen (
make python) so datamaxi/_endpoints.py reflects the complete premium contract.
- Convert
premium.__call__ onto request_endpoint with no loss of filter params.
- Update
tests/test_integration.py premium cases (currently call min_pdp/token_include/etc.) so they run without TypeError.
Done when
- Every real premium filter present in
datamaxi/_endpoints.py; token_include/token_exclude confirmed + added.
premium.__call__ routed through request_endpoint with no filter-param loss.
tests/test_integration.py premium cases run without TypeError.
Ref: PR #120
Follow-up to #119 / PR #120, which shipped Step 1 only (camelCase→snake_case wire-key fix). This tracks the deferred Step 2 — upstream-blocked at the time of #119.
Background
premium.__call__(datamaxi/datamaxi/premium.py) still uses the hand-rolledself.query("/api/v1/premium", params)path rather thanrequest_endpoint, because the codegen registry (datamaxi/_endpoints.py, oppremium) is incomplete for premium. Routing throughrequest_endpoint(which rejects any param absent from the registry) would silently drop working filters.Evidence the gap is a registry omission, not dead params
min_sv/min_tvbut notmax_sv/max_tv. A backend supporting aminbound but ignoring the matchingmaxis implausible.token_include/token_excludeare known-working (accept full names likebitcoin, not tickers — confirmed from actual use). Absent from the registry.Registry-absent but currently sent: 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.Work (in order)
../datamaxi-backend) so codegen re-emits them into thepremiumregistry entry. Confirmtoken_include/token_excludeandmax_sv/max_tvland.make python) sodatamaxi/_endpoints.pyreflects the complete premium contract.premium.__call__ontorequest_endpointwith no loss of filter params.tests/test_integration.pypremium cases (currently callmin_pdp/token_include/etc.) so they run withoutTypeError.Done when
datamaxi/_endpoints.py;token_include/token_excludeconfirmed + added.premium.__call__routed throughrequest_endpointwith no filter-param loss.tests/test_integration.pypremium cases run withoutTypeError.Ref: PR #120