Skip to content

Fix Gamma API validation error and test alternative parameters#20

Open
berlinbra wants to merge 1 commit into
debug-gamma-apifrom
fix-gamma-api-params
Open

Fix Gamma API validation error and test alternative parameters#20
berlinbra wants to merge 1 commit into
debug-gamma-apifrom
fix-gamma-api-params

Conversation

@berlinbra
Copy link
Copy Markdown
Owner

This PR fixes the Gamma API parameter validation error and attempts to find working parameters to get current markets.

What Your Logs Revealed

  1. The order parameter causes a 422 validation error: "order fields are not valid"
  2. The API works without the order parameter (returns 200 OK)
  3. BUT it still returns old markets from 2020-2021 even with archived=false

What This PR Does

1. Removes the Invalid order Parameter

  • The Gamma API doesn't accept the order parameter
  • Removed it from both the tool schema and the request params

2. Tests Multiple Parameter Combinations

When the standard parameters don't work, the code now tries:

  • Without archived parameter
  • With just limit
  • With live=true parameter
  • With other potential parameters like status, resolved, enable_order_book

3. Enhanced Connectivity Test

The startup test now:

  • Tests if archived=false actually filters old markets
  • Tries different parameter combinations to find what returns current markets
  • Reports which parameters successfully return 2024/2025 markets

4. Better Logging

  • Warns when API returns old data despite archived=false
  • Shows which parameter combinations are being tested
  • Indicates when alternative parameters find current markets

Next Steps

Run this version to see:

  1. If any parameter combination returns current markets
  2. Whether the Gamma API is actually serving current data
  3. If we need to use a different endpoint or API

The enhanced logging will show exactly what's happening and help us find the right solution.

…ters

- Remove 'order' parameter which causes 422 validation error
- Test multiple parameter combinations to find what works
- Try 'live', 'status', 'resolved', and 'enable_order_book' parameters
- Enhanced connectivity test to discover working parameters
- Better handling when API returns old data despite archived=false
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