Skip to content

Expand premium registry upstream + convert premium.__call__ onto request_endpoint (Step 2 of #119) #121

Description

@martinkersner

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)

  1. Verify each premium filter param-by-param against the live backend.
  2. 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.
  3. Re-run codegen (make python) so datamaxi/_endpoints.py reflects the complete premium contract.
  4. Convert premium.__call__ onto request_endpoint with no loss of filter params.
  5. 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

Metadata

Metadata

Assignees

Labels

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