feat!: remove legacy AMM and upstream-removed fields from gamma models - #286
Open
kartojal wants to merge 1 commit into
Open
feat!: remove legacy AMM and upstream-removed fields from gamma models#286kartojal wants to merge 1 commit into
kartojal wants to merge 1 commit into
Conversation
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Gamma is cleaning the consumer-facing event and market models to improve data transfer speed:
market.marketMakerAddresswill be omitted from responses (still returned for historical AMM markets)market.pagerDutyNotificationEnabledis removed from responses(event, market, series, tags).requiresTranslationis removed from responsesevent.eventMetadatacontext keys move toGET 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 byTag), andSeriesReference.requires_translation(inherited bySeries) removedMarketMetrics.volume_ammandEventMetrics.liquidity_ammremovedlist_markets: removed themarket_maker_addressesfilter from all four clients and the internal spec builder (themarket_maker_addressquery param is being dropped)marketMakerAddressCompatibility
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 .anduv run ruff format --check .cleanuv run pyright: 0 errorsuv run pytest -m "not integration": 2310 passed🤖 Generated with Claude Code
Note
Medium Risk
Breaking API for callers using
market_maker_addressesor 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_marketssupport for themarket_maker_addressesfilter (and the internalmarket_maker_addressquery param) across sync/async public and secure clients andlist_markets_spec.Strips optional model fields the API no longer populates:
requires_translationon events/tags/series,volume_ammon markets, andliquidity_ammon events—including the correspondingparse_responsewiring. Parsing still tolerates legacy keys in JSON via Pydanticextra="ignore"; a new unit test asserts that.Test fixtures no longer include
marketMakerAddress, and paginated spec tests no longer expect that filter inbase_params.Reviewed by Cursor Bugbot for commit 267d6b0. Bugbot is set up for automated code reviews on this repo. Configure here.