Back to Articles

Building a Geopolitical Trading Bot with Satellite Data and Claude AI for $0/Month

[ View on GitHub ]

Building a Geopolitical Trading Bot with Satellite Data and Claude AI for $0/Month

Hook

What if you could trade geopolitical events before they hit the news by watching forest fires from space? One developer built exactly that using free APIs and an LLM.

Context

Prediction markets like Polymarket create fascinating arbitrage opportunities for those with access to information faster than the crowd. While traditional traders rely on breaking news and analyst reports, there’s a brief window where real-world events are detectable through public data sources but haven’t yet been priced into markets. Wildfires in strategic regions, unusual aircraft activity near conflict zones, or clusters of seismic events can signal geopolitical shifts hours before media coverage begins.

The challenge is that this data exists in silos—NASA’s FIRMS satellite system tracks thermal anomalies, OpenSky monitors aircraft transponders, USGS catalogs earthquakes—but connecting these dots requires infrastructure most individuals can’t afford. Enter geo-satellite-trader: a Python bot that aggregates 10+ free data sources, uses Claude AI to synthesize patterns, and automatically places trades on Polymarket. The entire system runs on free API tiers with no cloud hosting costs, democratizing a strategy previously limited to well-funded quantitative funds.

Technical Insight

Backtesting

Historical baseline

Statistical context

Test signals

Data Sources

NASA/USGS/OpenSky/Market APIs

15-min Polling Loop

Anomaly Detection

Z-score + FRP weighting

Multi-Source Aggregator

Normalized event structure

Claude AI

Prompt-based signal generation

Kelly Criterion Sizer

Risk-weighted positions

Polymarket Executor

Trade execution

14-day Rolling Data

Telegram Notifications

Historical NASA Data

Replay Engine

System architecture — auto-generated

The architecture centers on a 15-minute polling loop that queries disparate APIs and normalizes their responses into a unified data structure. The core intelligence lives in how it calculates anomaly severity and routes decisions through Claude.

The NASA FIRMS integration is particularly clever. Rather than treating every fire detection as a signal, the system establishes a 14-day rolling baseline for each geographic region, then calculates statistical deviations:

def calculate_fire_anomaly(current_detections, historical_baseline):
    mean_fires = np.mean(historical_baseline)
    std_fires = np.std(historical_baseline)
    
    if std_fires == 0:
        return 0
    
    z_score = (current_detections - mean_fires) / std_fires
    
    # Weight by Fire Radiative Power (FRP)
    frp_multiplier = sum([fire['frp'] for fire in current_detections]) / 100
    
    return max(0, z_score * frp_multiplier)

This z-score approach filters out normal seasonal fire activity (agricultural burns, dry season patterns) and only triggers on genuine anomalies. The Fire Radiative Power multiplier is crucial—a single intense industrial fire generates different implications than scattered brush fires with the same detection count.

The multi-source confirmation logic implements a tiered Kelly criterion for position sizing. A single anomaly caps at 3% of bankroll, but corroborating signals unlock aggressive sizing:

def calculate_position_size(anomalies, bankroll):
    base_kelly = 0.03  # Conservative baseline
    
    # Check for multi-source confirmation
    signals = {
        'fire': anomalies['fire_score'] > 10,
        'vix_spike': anomalies['vix_change'] > 0.15,
        'aircraft': anomalies['flight_deviation'] > 2.5,
        'commodity': anomalies['gold_btc_correlation'] > 0.7
    }
    
    active_signals = sum(signals.values())
    
    if active_signals >= 3:
        kelly_fraction = min(0.40, base_kelly * anomalies['fire_score'])
    elif active_signals == 2:
        kelly_fraction = min(0.15, base_kelly * anomalies['fire_score'] / 2)
    else:
        kelly_fraction = base_kelly
    
    return bankroll * kelly_fraction

The LLM integration is where things get interesting. Rather than hardcoding rules for every geopolitical scenario, the system dumps the entire data snapshot into a structured prompt and asks Claude to assess market impact:

prompt = f"""
You are a geopolitical analyst reviewing real-time data sources.

Current anomalies detected:
- Fire activity in {region}: {fire_score}x baseline ({detection_count} detections, avg FRP {avg_frp})
- Aircraft deviations: {flight_data}
- VIX: {vix_level} ({vix_change}% change)
- Commodity movements: Gold {gold_change}%, BTC {btc_change}%
- Recent earthquakes: {earthquake_summary}

Active Polymarket questions:
{json.dumps(active_markets, indent=2)}

For each relevant market, provide:
1. Probability this event occurs (0-100)
2. Confidence level (low/medium/high)
3. Key reasoning (max 50 words)

Respond in JSON format only.
"""

This prompt engineering approach creates flexibility—when new market types appear or geopolitical contexts shift, the LLM adapts without code changes. The system parses Claude’s JSON response and only executes trades when confidence is “high” and the probability diverges from current market prices by >15%.

The backtesting infrastructure deserves mention. Since Polymarket doesn’t provide historical price APIs, the project includes a replay system that walks through archived NASA FIRMS data and simulates trades based on estimated market reactions. While the claimed 17.6x profit factor is unverifiable (and likely optimistic), the framework itself is valuable for iterating on detection thresholds and position sizing rules without burning real capital.

Gotcha

The Achilles’ heel is latency. NASA’s FIRMS satellite data carries a 4-6 hour delay from detection to API availability. In geopolitical markets, that’s an eternity—news networks, social media, and other traders with ground-level sources will often move prices before satellite confirmation arrives. You’re essentially betting that the market hasn’t fully priced in events that are already partially public knowledge.

The backtesting results are statistically meaningless. Sixteen trades over 15 months is nowhere near enough data to validate a strategy, especially one with this many tunable parameters (anomaly thresholds, Kelly fractions, confirmation rules). The risk of overfitting is severe—those specific thresholds likely work perfectly on historical data because they were optimized for it. Real-world deployment will almost certainly underperform the paper results. Additionally, Polymarket’s geopolitical markets often have thin liquidity. The backtest assumes you can enter and exit positions at specific prices, but actual slippage on a $2,000 position could easily eat 10-20% of theoretical profits. The project also has zero error handling for API failures—if NASA’s servers are down during a critical anomaly window, the bot just skips that cycle.

Verdict

Use if: You’re fascinated by alternative data strategies and want a hands-on education in multi-source signal fusion, Kelly criterion position sizing, and LLM-driven decision systems. This is a phenomenal learning project for understanding how quantitative funds think about event-driven trading, and the zero-cost infrastructure makes experimentation accessible. It’s also worthwhile if you have domain expertise in specific regions and can supplement the satellite data with faster, proprietary signals. Skip if: You need a production-ready trading system or believe the backtest claims at face value. The latency disadvantage is insurmountable for pure satellite-based signals, the sample size is too small to trust the risk parameters, and Polymarket’s liquidity constraints make this unscalable beyond hobby-level capital. You’re better off using the code as inspiration for building something with lower-latency data sources (social media scrapers, OSINT feeds) rather than deploying it as-is.

// ADD TO YOUR README
[![Featured on Starlog](https://starlog.is/api/badge/ai-dev-tools/helicerat-geo-satellite-trader.svg)](https://starlog.is/api/badge-click/ai-dev-tools/helicerat-geo-satellite-trader)