Skip to content

feat!: remove legacy AMM and upstream-removed fields from gamma models - #286

Open
kartojal wants to merge 2 commits into
mainfrom
feature/gamma-remove-legacy-fields
Open

kartojal wants to merge 2 commits into
mainfrom
feature/gamma-remove-legacy-fields

Conversation

@kartojal

@kartojal kartojal commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Why

Gamma is cleaning the consumer-facing event and market models to improve data transfer speed:

  • market.marketMakerAddress will be omitted from responses (still returned for historical AMM markets)
  • market.pagerDutyNotificationEnabled is removed from responses
  • (event, market, series, tags).requiresTranslation is removed from responses
  • event.eventMetadata context keys move to GET events/{id}/insights (no SDK impact: parsed as an open dict)

Unlike the TypeScript SDK, no py-sdk model could fail validation here (extra="ignore", all affected fields optional). This PR removes the dead public surface so consumers stop reading fields that will never carry data again. Companion to ts-sdk#334.

What changed

  • EventState.requires_translation, TagReference.requires_translation (inherited by Tag), and SeriesReference.requires_translation (inherited by Series) removed
  • MarketMetrics.volume_amm and EventMetrics.liquidity_amm removed
  • list_markets: removed the market_maker_addresses filter from all four clients and the internal spec builder (the market_maker_address query param is being dropped)
  • Test fixtures no longer carry marketMakerAddress

Compatibility

Responses that still carry any of the removed fields keep parsing; pydantic ignores them silently. A regression test covers this (test_market_ignores_legacy_fields_still_present_in_responses).

Test plan

  • uv run ruff check . and uv run ruff format --check . clean
  • uv run pyright: 0 errors
  • uv run pytest -m "not integration": 2310 passed

🤖 Generated with Claude Code


Note

Medium Risk
Breaking SDK surface (removed kwargs and model attributes) may break callers; runtime parsing of API responses remains tolerant via extra-field ignoring.

Overview
Breaking change aligning Gamma models and list_markets with upstream field and query-param removals (companion to ts-sdk#334).

Public API: Drops market_maker_addresses from list_markets on all sync/async public and secure clients and from the internal list_markets_spec builder (market_maker_address is no longer sent).

Models: Removes legacy AMM and translation fields from the typed surface—MarketMetrics.volume_amm, EventMetrics.liquidity_amm, and requires_translation on event/tag/series reference types—plus matching parse_response mappings.

Compatibility: Pydantic still ignores extra JSON keys; a new unit test asserts markets parse when legacy keys (e.g. marketMakerAddress, volumeAmm, requiresTranslation) remain in responses. Test fixtures no longer depend on those fields.

Reviewed by Cursor Bugbot for commit 2eef232. Bugbot is set up for automated code reviews on this repo. Configure here.

kartojal and others added 2 commits August 31, 2026 13:06
The markets API stopped returning these consumer-facing fields:

- requires_translation from event, series, and tag models
- volume_amm from MarketMetrics and liquidity_amm from EventMetrics
- the market_maker_addresses filter from list_markets (the
  market_maker_address query param is being dropped upstream)

Responses that still carry any of these fields keep parsing; the values
are ignored. A regression test covers the rollout window.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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