Summary
gamma::types::request::MarketsRequest currently has no active field/builder method (at least in polymarket-client-sdk 0.4.2).
Because of this, consumers that expose an --active filter (like polymarket-cli) must fetch pages and apply active filtering client-side.
Why this matters
Without native active filtering in the request object:
- API calls cannot express the full query intent (
active + other filters) server-side.
- Clients may return undersized results for page-limited requests unless they implement backfill/pagination loops.
- Clients perform extra requests/work that should be avoidable if the backend supports
active for markets.
In polymarket-cli, this required additional logic to backfill when --active is set so --limit semantics are preserved.
Current state (SDK)
MarketsRequest includes closed but not active:
polymarket-client-sdk/src/gamma/types/request.rs
Proposal
If the Gamma markets endpoint supports it, add native active support to MarketsRequest:
- add
pub active: Option<bool> to the request type
- expose builder methods (
.active(...) / .maybe_active(...))
- ensure serialization/query mapping aligns with the API parameter name
- document in README/examples for Gamma markets filtering
Consumer impact
This would let downstream clients issue precise server-side queries and avoid client-side backfill loops for active filtering.
Context
Opened from follow-up work in polymarket-cli PR:
Summary
gamma::types::request::MarketsRequestcurrently has noactivefield/builder method (at least inpolymarket-client-sdk0.4.2).Because of this, consumers that expose an
--activefilter (likepolymarket-cli) must fetch pages and applyactivefiltering client-side.Why this matters
Without native
activefiltering in the request object:active+ other filters) server-side.activefor markets.In
polymarket-cli, this required additional logic to backfill when--activeis set so--limitsemantics are preserved.Current state (SDK)
MarketsRequestincludesclosedbut notactive:polymarket-client-sdk/src/gamma/types/request.rsProposal
If the Gamma markets endpoint supports it, add native
activesupport toMarketsRequest:pub active: Option<bool>to the request type.active(...)/.maybe_active(...))Consumer impact
This would let downstream clients issue precise server-side queries and avoid client-side backfill loops for
activefiltering.Context
Opened from follow-up work in
polymarket-cliPR: