fix: use correct Gamma API parameter for filtering open markets#3
Open
pennycott wants to merge 1 commit intocaiovicentino:mainfrom
Open
fix: use correct Gamma API parameter for filtering open markets#3pennycott wants to merge 1 commit intocaiovicentino:mainfrom
pennycott wants to merge 1 commit intocaiovicentino:mainfrom
Conversation
df2a93d to
00ed3d3
Compare
The Gamma API requires `closed: "false"` to filter for open/active markets, not `active: "true"` which was being used. This caused all market discovery tools to return only closed markets from 2020 instead of current active markets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
00ed3d3 to
fa71420
Compare
|
This works! I ran into the same issue and re-did the changes on a local version. Now it shows recent markets. |
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.
📋 Description
The Gamma API requires
closed: "false"to filter for open/active markets, notactive: "true"which was being used. This caused all market discovery tools (trending, categories, featured, etc.) to return only closed markets from 2020 instead of current active markets.🎯 Type of Change
🔗 Related Issues
Markets discovery tools return closed markets from 2020 instead of current open markets when using demo mode (or any mode).
🧪 Testing
Test Configuration
Tests Performed
pytest)Test Results
📸 Screenshots / Examples
Before fix - returns 2020 closed markets:
After fix - returns current open markets:
✅ Checklist
🔒 Security
Does this PR introduce breaking changes?
💬 Additional Notes
Changed all 6 affected functions in
src/polymarket_mcp/tools/market_discovery.py:get_trending_markets()- line 137filter_markets_by_category()- line 185get_featured_markets()- line 249get_closing_soon_markets()- line 285get_sports_markets()- line 335get_crypto_markets()- line 374The fix simply changes the API parameter from
{"active": "true"}to{"closed": "false"}which is what the Gamma API actually expects. This can be verified intest_real_data.pywhich already uses the correct parameter.🤖 Generated with Claude Code