003-skills/.claude/skills/nixtla-polymarket-analyst/SKILL.md
Analyze and forecast Polymarket contracts using TimeGPT with confidence intervals. Use when predicting contract prices. Trigger with 'Polymarket analysis' or 'forecast prediction market'.
npx skillsauth add intent-solutions-io/plugins-nixtla nixtla-polymarket-analystInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyzes and forecasts Polymarket prediction market contract prices using historical data and TimeGPT forecasting models.
This skill fetches Polymarket contract data via API, transforms it into Nixtla time series format, and generates probabilistic forecasts using TimeGPT. The agent produces price forecasts with confidence intervals, trend analysis, and trading signals. Useful for traders and analysts seeking data-driven insights on prediction markets. Outputs include CSV forecasts, visualizations, and analysis reports with risk disclaimers.
Required Tools: Read, Write, Bash, Glob, Grep, WebFetch
Environment Variables:
NIXTLA_TIMEGPT_API_KEY - Required for TimeGPT forecasting (get at https://dashboard.nixtla.io)Python Packages:
pip install nixtla pandas requests matplotlib
Script Files: All Python scripts are located in {baseDir}/scripts/:
fetch_contract.py - Fetches contract data from Polymarket APItransform_data.py - Transforms data to Nixtla format (unique_id, ds, y)forecast_contract.py - Generates TimeGPT forecasts with confidence intervalsanalyze_polymarket.py - Complete end-to-end analysis pipelineThe agent should follow this workflow when analyzing Polymarket contracts:
Check that the TimeGPT API key is configured:
echo $NIXTLA_TIMEGPT_API_KEY
If not set, instruct the user to export their API key.
Use the fetch script to retrieve contract metadata and historical prices:
python {baseDir}/scripts/fetch_contract.py <condition_id> --days 30
This creates contract_{id}_data.json with the contract question, description, volume, liquidity, and hourly price history.
Convert raw Polymarket data to Nixtla format (unique_id, ds, y columns):
python {baseDir}/scripts/transform_data.py contract_{id}_data.json
Output: contract_{id}_nixtla.csv ready for forecasting. The script validates data quality and warns about insufficient data points.
Run TimeGPT forecasting with specified horizon and frequency:
python {baseDir}/scripts/forecast_contract.py contract_{id}_nixtla.csv \
--horizon 48 \
--freq H \
--output forecast_results
Generates:
forecast_results_forecast.csv - Predicted prices with confidence intervals (80%, 90%, 95%)forecast_results_plot.png - Visualization of historical vs forecastforecast_results_metadata.json - Analysis with trend, signal, and metadataFor end-to-end analysis in one command:
python {baseDir}/scripts/analyze_polymarket.py <condition_id> \
--horizon 48 \
--days 30 \
--output-dir ./results
This runs all steps automatically and produces complete analysis outputs.
The agent should interpret forecast results as follows:
Trend Classification:
Confidence Intervals: 95% CI shows the range where the true price is likely to fall. Wide intervals indicate higher uncertainty.
Risk Factors: Consider market liquidity, trading volume, time until contract resolution, and external events that may affect outcomes.
The agent generates these artifacts:
polymarket_{id}_historical.csv) - Nixtla-formatted time seriespolymarket_{id}_forecast.csv) - Predictions with confidence intervalspolymarket_{id}_plot.png) - Chart showing historical prices, forecast, and confidence bandspolymarket_{id}_analysis.json) - Complete metadata including:
Error: Invalid contract ID
Error: NIXTLA_TIMEGPT_API_KEY not set
export NIXTLA_TIMEGPT_API_KEY='your-key-here'Error: Insufficient data
--days parameter or wait for more trading history. Minimum 10-20 data points recommended.Error: API rate limit exceeded
Error: Connection timeout
User Request: "Analyze the 2024 election contract 0x1234abcd with 48-hour forecast"
Agent Actions:
python {baseDir}/scripts/analyze_polymarket.py 0x1234abcd --horizon 48 --days 60
Expected Output:
Contract: "Will candidate X win the 2024 election?"
Current Price: $0.4500
Forecast Price: $0.5200
Expected Change: +15.56%
Signal: BUY (BULLISH)
95% CI: [0.4800, 0.5600]
Interpretation: The model predicts a 15.56% increase in the "yes" price, suggesting growing confidence in the outcome. The tight confidence interval indicates reasonable certainty.
User Request: "What's the forecast for the ETH price contract?"
Agent Actions:
python {baseDir}/scripts/analyze_polymarket.py 0xdef456 --horizon 24 --days 14
Expected Output:
Contract: "Will ETH be above $3000 on Dec 31?"
Current Price: $0.6800
Forecast Price: $0.6500
Expected Change: -4.41%
Signal: HOLD (NEUTRAL)
95% CI: [0.6000, 0.7000]
Interpretation: The model predicts a slight decrease, but within the neutral range. Wide confidence interval suggests uncertainty. No strong trading signal.
Risk Disclaimer: Forecasts are probabilistic estimates, not guarantees. Past performance does not indicate future results. This is not financial advice. Always verify data before making trading decisions.
testing
This skill enables Claude to manage isolated test environments using Docker Compose, Testcontainers, and environment variables. It is used to create consistent, reproducible testing environments for software projects. Claude should use this skill when the user needs to set up a test environment with specific configurations, manage Docker Compose files for test infrastructure, set up programmatic container management with Testcontainers, manage environment variables for tests, or ensure cleanup after tests. Trigger terms include "test environment", "docker compose", "testcontainers", "environment variables", "isolated environment", "env-setup", and "test setup".
tools
This skill uses the test-doubles-generator plugin to automatically create mocks, stubs, spies, and fakes for unit testing. It analyzes dependencies in the code and generates appropriate test doubles based on the chosen testing framework, such as Jest, Sinon, or others. Use this skill when you need to generate test doubles, mocks, stubs, spies, or fakes to isolate units of code during testing. Trigger this skill by requesting test double generation or using the `/gen-doubles` or `/gd` command.
tools
This skill enables Claude to generate realistic test data for software development. It uses the test-data-generator plugin to create users, products, orders, and custom schemas for comprehensive testing. Use this skill when you need to populate databases, simulate user behavior, or create fixtures for automated tests. Trigger phrases include "generate test data", "create fake users", "populate database", "generate product data", "create test orders", or "generate data based on schema". This skill is especially useful for populating testing environments or creating sample data for demonstrations.
development
This skill analyzes code coverage metrics to identify untested code and generate comprehensive coverage reports. It is triggered when the user requests analysis of code coverage, identification of coverage gaps, or generation of coverage reports. The skill is best used to improve code quality by ensuring adequate test coverage and identifying areas for improvement. Use trigger terms like "analyze coverage", "code coverage report", "untested code", or the shortcut "cov".