Skip to content

feat: expose index_price, margin_borrow, liquidation.stats SDK methods (#126)#127

Merged
martinkersner merged 4 commits into
mainfrom
issue-126-expose-registry-endpoints
Jul 1, 2026
Merged

feat: expose index_price, margin_borrow, liquidation.stats SDK methods (#126)#127
martinkersner merged 4 commits into
mainfrom
issue-126-expose-registry-endpoints

Conversation

@martinkersner

Copy link
Copy Markdown
Member

Closes #126

Follow-up to #123/#125. The registry-param coverage audit surfaced 4 endpoints in _endpoints.py with no SDK exposure. Per maintainer decisions, this exposes 3 of them and intentionally excludes the 4th.

Exposed surfaces

  • liquidation.stats()GET /api/v1/liquidation/stats. New Liquidation.stats(window="1h", exchange=None, min_volume_usd=None); validates window ∈ {1h,4h,24h}.
  • margin_borrowGET /api/v1/margin-borrow. New top-level callable client MarginBorrow, reached via maxi.margin_borrow(asset="BTC").
  • index_priceGET /api/v1/index-price. New top-level callable client IndexPrice, reached via maxi.index_price(asset="BTC", from_=..., to=..., interval="5m"). from_/to follow the existing **{"from": ...} splat convention (open_interest).

All dispatch via request_endpoint(op_id, ...); no hand-built URLs.

Intentionally excluded

  • listings_historical — NOT surfaced (not in the public data-api). Its _ALLOWLIST entry is kept with an updated rationale, and the audit block comment no longer claims all four are pending.

Docs

  • New docs/margin-borrow.md, docs/index-price.md (+ nav in mkdocs.yml).
  • docs/liquidation.md updated with a stats() usage snippet + note.

Test plan

  • black --check datamaxi tests — clean (51 files unchanged).
  • flake8 datamaxi tests — no findings.
  • python -m pytest -m "not integration" — 134 passed, 11 skipped, 107 deselected.
  • Audit test_endpoint_param_coverage.py now asserts the 3 exposed endpoints' params are forwarded (allowlist entries removed); passes.

@martinkersner martinkersner self-assigned this Jul 1, 2026
@martinkersner martinkersner merged commit 0024416 into main Jul 1, 2026
7 checks passed
@martinkersner martinkersner deleted the issue-126-expose-registry-endpoints branch July 1, 2026 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add client methods for 4 registry endpoints with no SDK exposure (index_price, margin_borrow, liquidation_stats, listings_historical)

1 participant