Skip to content

feat(gamma): add active filter to MarketsRequest#323

Open
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e:feat/markets-request-active-filter
Open

feat(gamma): add active filter to MarketsRequest#323
skyc1e wants to merge 1 commit intoPolymarket:mainfrom
skyc1e:feat/markets-request-active-filter

Conversation

@skyc1e
Copy link
Copy Markdown

@skyc1e skyc1e commented Apr 8, 2026

Summary

  • Add active: Option<bool> to MarketsRequest
  • Matches the existing pattern used by EventsRequest (same field, same position relative to closed)
  • The Gamma backend already supports ?active= on the markets endpoint; this exposes it natively so consumers don't need client-side filtering

Changes

  • src/gamma/types/request.rs: one field added to MarketsRequest
  • tests/gamma.rs: active(true) added to markets_request_all_params, plus three focused tests (active=true, active=false, omitted when unset)

Builder method is auto-generated by bon::Builder. Serialization handled by existing #[skip_serializing_none]. No behavior change for callers that don't set active.

Closes #267


Note

Low Risk
Low risk: adds an optional boolean query parameter to MarketsRequest and extends serialization tests; no behavior change unless callers set active.

Overview
Adds an active: Option<bool> filter to MarketsRequest, allowing callers to send ?active=true|false when listing markets.

Updates query-string unit tests to cover active serialization (true/false) and verify it is omitted when unset, and includes active in the all-params markets request test.

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

Add `active: Option<bool>` to `MarketsRequest`, matching the existing
pattern used by `EventsRequest`. The Gamma backend already supports
the `active` query parameter for markets — this exposes it natively
so consumers no longer need to filter client-side.

Closes Polymarket#267
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.54%. Comparing base (77264a4) to head (6afff53).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #323   +/-   ##
=======================================
  Coverage   85.54%   85.54%           
=======================================
  Files          32       32           
  Lines        5167     5167           
=======================================
  Hits         4420     4420           
  Misses        747      747           
Flag Coverage Δ
rust 85.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

gamma MarketsRequest: add native active filter support

1 participant