Skip to content

feat: add funding-conditions and crypto daily open/close endpoints - #7

Draft
chipkent wants to merge 2 commits into
masterfrom
feat/rest-missing-endpoints
Draft

chipkent wants to merge 2 commits into
masterfrom
feat/rest-missing-endpoints

Conversation

@chipkent

@chipkent chipkent commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Preview only. This is a draft in the fork showing the exact text of the PR planned for massive-com/client-python. It will be closed, not merged, once the upstream PR is opened.

Fixes #<issue: F6>

Two documented REST endpoints have no client method. One commit each; nothing existing changes behavior.

  • list_funding_conditions(...) for GET /fed/v1/funding-conditions: a paginated method shaped like list_treasury_yields, with the documented parameters as keyword arguments (date, date_gt, date_gte, date_lt, date_lte, limit, sort) and a FedFundingConditions model with all 22 fields.
    • sort is Optional[str], not Sort, because the endpoint takes column.direction values such as date.desc.
  • get_daily_open_close_crypto(from_, to, date, adjusted=None) for GET /v1/open-close/crypto/{from}/{to}/{date}, with DailyOpenCloseCrypto and DailyOpenCloseCryptoTrade models. The crypto example and Aggs.rst pointed at get_daily_open_close_agg, which calls the stock endpoint; both now use the new method.
for row in client.list_funding_conditions(date_gte="2025-06-01", sort="date.desc"):
    print(row.date, row.effective_fed_funds_rate)

Tests: pook fixtures for both endpoints (pagination, nested trades), and pook params= checks that every parameter is sent under its API name.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chipkent
chipkent force-pushed the feat/rest-missing-endpoints branch 2 times, most recently from e6f8f37 to 8508998 Compare October 24, 2026 04:17
@chipkent chipkent changed the title feat: add funding-conditions and crypto daily open-close endpoints feat: add funding-conditions and crypto daily open/close endpoints Oct 24, 2026
The Fed funding-conditions endpoint is documented in the OpenAPI spec
and on massive.com/docs but had no client method; the economy client
only covered treasury-yields, inflation, inflation-expectations, and
labor-market.

Add EconomyClient.list_funding_conditions, a paginated list method in
the same shape as list_treasury_yields. Its query parameters follow the
documented ones exactly: date, date.gt, date.gte, date.lt, date.lte,
limit, and sort (this endpoint documents no date.any_of or order).

sort is typed Optional[str], as in list_labor_market_indicators, rather
than Union[str, Sort]. The endpoint takes column.direction values such
as "date.desc", so Sort.ASC would send a bare "asc" that it does not
accept.

Add the FedFundingConditions model with all 22 documented result
fields (date plus the fed funds, IORB, SOFR, OBFR, TGCR, repo/reverse
repo, and commercial paper series).

Tests cover a two-page fixture (including a weekend row whose
business-day series are null), check with pook that all seven
parameters are sent under their API names (date.gt rather than
date_gt, and so on), and check that a multi-column sort string is sent
unchanged. Add an example script.
…}/{to}/{date}

The crypto daily open/close endpoint is documented in the OpenAPI spec
and on massive.com/docs but had no client method. The docs and the
crypto example pointed at get_daily_open_close_agg, which calls
/v1/open-close/{ticker}/{date}, a different endpoint whose response
(afterHours, preMarket, high, low, volume) does not match the crypto
one.

Add AggsClient.get_daily_open_close_crypto(from_, to, date, adjusted)
and two models matching the documented response:

- DailyOpenCloseCrypto: symbol, is_utc (isUTC), day, open, close,
  open_trades (openTrades), closing_trades (closingTrades).
- DailyOpenCloseCryptoTrade: conditions (c), id (i), price (p),
  size (s), timestamp (t), exchange (x).

Test against a fixture built from the documented example response.
Give the method its own section in the Aggs docs, move the crypto
docs link there, and point the crypto example at the new method.
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.

1 participant