Skip to content

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

Open
kartojal wants to merge 1 commit into
mainfrom
feature/gamma-remove-legacy-fields
Open

feat!: remove legacy AMM and upstream-removed fields from gamma models#286
kartojal wants to merge 1 commit 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 API for callers using market_maker_addresses or removed model attributes; runtime parsing of responses remains backward-compatible for extra legacy fields.

Overview
Breaking change that aligns the Python SDK with Gamma’s slimmer event/market payloads by dropping dead public surface area.

Removes list_markets support for the market_maker_addresses filter (and the internal market_maker_address query param) across sync/async public and secure clients and list_markets_spec.

Strips optional model fields the API no longer populates: requires_translation on events/tags/series, volume_amm on markets, and liquidity_amm on events—including the corresponding parse_response wiring. Parsing still tolerates legacy keys in JSON via Pydantic extra="ignore"; a new unit test asserts that.

Test fixtures no longer include marketMakerAddress, and paginated spec tests no longer expect that filter in base_params.

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

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