Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt

Use this file to discover all available pages before exploring further.

Ninety-eight ways to measure the world. Earthquakes. Ice cream machines. Train delays. The percentage of broken McDonald’s soft-serve dispensers in a city you have never visited. The disruption level of a metro line in a country where you do not live. The number of stars on a GitHub repository written in a language you do not speak. The absurdity is the point. Every number is a market. Every market is a question. Every question has exactly two answers, and one of them is wrong.

The Data Pipeline

Every prediction market on Vision is backed by a real-world data source. The Data Node collects, validates, and serves price feeds from 90+ external APIs. The infrastructure is serious. What it measures is often not.
    ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐  ┌─────────────────┐
    │   USGS API      │  │   CoinGecko     │  │   TFL API       │  │   McBroken      │
    │   Earthquakes   │  │   Crypto Prices │  │   UK Trains     │  │   Ice Cream     │
    └────────┬────────┘  └────────┬────────┘  └────────┬────────┘  └────────┬────────┘
             │                    │                    │                    │
             └────────────────────┼────────────────────┼────────────────────┘
                                  │                    │
                                  ▼                    ▼
                      ┌────────────────────────────────────┐
                      │           DATA NODE (Rust)         │
                      │                                    │
                      │   ┌──────────┐    ┌─────────────┐  │
                      │   │ Collect  │───>│  Validate   │  │
                      │   │ (HTTP)   │    │  (bounds,   │  │
                      │   └──────────┘    │   staleness │  │
                      │                   │   checks)   │  │
                      │                   └──────┬──────┘  │
                      │                          │         │
                      │                   ┌──────▼──────┐  │
                      │                   │   Store     │  │
                      │                   │ (Postgres)  │  │
                      │                   └──────┬──────┘  │
                      │                          │         │
                      │                   ┌──────▼──────┐  │
                      │                   │   Serve     │  │
                      │                   │  (REST API) │  │
                      │                   └─────────────┘  │
                      └────────────────┬───────────────────┘

                            ┌──────────▼──────────┐
                            │     PostgreSQL      │
                            │                     │
                            │  market_prices      │
                            │  market_prices_latest│
                            │  source_meta        │
                            └──────────┬──────────┘

                            ┌──────────▼──────────┐
                            │     Vision API      │
                            │                     │
                            │  /api/vision/batches│
                            │  /api/vision/ticks  │
                            │  /api/vision/state  │
                            │  /api/vision/history│
                            └──────────┬──────────┘

                            ┌──────────▼──────────┐
                            │      Frontend       │
                            │                     │
                            │  Live prices, charts│
                            │  Batch creation UI  │
                            │  Market explorer    │
                            └─────────────────────┘

Source Categories at a Glance

Vision sources span 16 categories. Crypto is the least interesting one. The real edge is in the places nobody else is looking — the buoy readings, the nuclear reactor outputs, the disruption scores of transit systems in cities that run on bureaucratic inertia.
  ┌─────────────────────────────────────────────────────────────────────────────┐
  │                        VISION DATA SOURCE MAP                              │
  ├────────────────────┬────────────────────┬───────────────────────────────────┤
  │                    │                    │                                   │
  │   FINANCE (14)     │   ECONOMIC (11)    │   REGULATORY (4)                 │
  │   ~~~~~~~~~~~      │   ~~~~~~~~~~~~     │   ~~~~~~~~~~~~~~                 │
  │   CoinGecko        │   FRED Rates       │   SEC Filings                    │
  │   Pump.fun         │   EIA Energy       │   Congress Votes                 │
  │   DefiLlama        │   US Treasury      │   Federal Courts                 │
  │   Finnhub Stocks   │   ECB Rates        │   NYC 311                        │
  │   Nasdaq           │   World Bank       │                                  │
  │   Zillow           │   BLS              │                                  │
  │   Polymarket       │   Adzuna Jobs      │                                  │
  │   FINRA (x2)       │   USA Spending     │                                  │
  │   Futures          │   IMF              │                                  │
  │   Bitcoin On-Chain │   OPEC             │                                  │
  │   Yahoo Drinks     │   CFTC             │                                  │
  │   TWSE             │                    │                                  │
  │   Best Buy         │                    │                                  │
  │                    │                    │                                  │
  ├────────────────────┼────────────────────┼───────────────────────────────────┤
  │                    │                    │                                   │
  │   TECH (8)         │   ENTERTAINMENT    │   GEOPHYSICAL (15)               │
  │   ~~~~~~~~         │   (14)             │   ~~~~~~~~~~~~~~~~               │
  │   GitHub           │   ~~~~~~~~~~~~~~   │   USGS Earthquakes               │
  │   npm              │   Twitch           │   Volcanoes                      │
  │   PyPI             │   Movies/TV (TMDB) │   NOAA Weather                   │
  │   Crates.io        │   Last.fm Music    │   Weather Alerts                 │
  │   StackOverflow    │   Steam Gaming     │   Open-Meteo                     │
  │   Hacker News      │   AniList Anime    │   Air Quality (AirNow)           │
  │   Cloudflare       │   Reddit           │   USGS Water                     │
  │   IODA Outages     │   Chaturbate       │   NOAA Ocean Met                 │
  │                    │   Board Games      │   NOAA Tides                     │
  │                    │   Backpack.tf      │   NDBC Buoys                     │
  │                    │   4chan             │   River Gauges                   │
  │                    │   Sports           │   NRC Nuclear                    │
  │                    │   Esports          │   Wildfires                      │
  │                    │   Theme Parks      │   Disease Tracking               │
  │                    │   McBroken         │   Power Outages                  │
  │                    │                    │                                  │
  ├────────────────────┼────────────────────┼───────────────────────────────────┤
  │                    │                    │                                   │
  │   TRANSPORT (16)   │   NATURE (4)       │   ACADEMIC (3)    SPACE (3)      │
  │   ~~~~~~~~~~~~~~   │   ~~~~~~~~~~       │   ~~~~~~~~~~~~    ~~~~~~~~~~     │
  │   Global Flights   │   eBird            │   OpenAlex        Space Weather  │
  │   Transit GTFS     │   Wildlife (iNat)  │   Crossref        ISS Tracker   │
  │   CityBikes        │   Animal Migration │   PubMed          Mil Aircraft  │
  │   Parking          │   Animal Shelters  │                                  │
  │   TomTom Traffic   │                    │                                  │
  │   EV Charging      │                    │                                  │
  │   Border Waits     │                    │                                  │
  │   Airport Delays   │                    │                                  │
  │   Deutsche Bahn    │                    │                                  │
  │   NYC Subway       │                    │                                  │
  │   Paris Metro      │                    │                                  │
  │   Ryanair          │                    │                                  │
  │   London Tube      │                    │                                  │
  │   Ship Tracking    │                    │                                  │
  │   Port Data        │                    │                                  │
  │                    │                    │                                  │
  └────────────────────┴────────────────────┴───────────────────────────────────┘

Full Source Directory

Finance

SourcePrefixValue LabelUnitUpdate Freq
CoinGecko Cryptocrypto_PriceUSD~1 min
Pump.fun Tokenspumpfun_PriceUSD~1 min
DefiLlama DeFidefi_TVLUSD~5 min
Finnhub Stocksstock_PriceUSD~1 min
Nasdaq Listingsnasdaq_PriceUSD~1 min
Zillow Real Estatezillow_PriceUSDDaily
Polymarketpoly_Probability%~1 min
FINRA Short Interestfinra_Short VolumesharesDaily
FINRA Short Volumefinra_short_vol_Short VolumesharesDaily
Continuous Futuresfutures_PriceUSD~5 min
Bitcoin On-Chainbchain_Value~10 min
Yahoo Drinksyahoo_drinks_PriceUSD~5 min
Taiwan Stock Exchangetwse_PriceTWDDaily
Best Buy Productsbestbuy_Sale PriceUSD~30 min

Economic

SourcePrefixValue LabelUnitUpdate Freq
FRED Interest Ratesfred_Rate%Daily
EIA Energy Dataeia_ValueWeekly
US Treasury Yieldstreasury_Yield%Daily
ECB Exchange Ratesecb_ValueDaily
World Bank Indicatorsworldbank_ValueMonthly
Bureau of Labor Statsbls_IndexMonthly
Adzuna Jobsadzuna_Avg SalaryDaily
Federal Spendingusa_spending_AmountUSDDaily
IMF Indicatorsimf_ValueMonthly
OPEC Oil Dataopec_Basket PriceUSD/bblDaily
CFTC Commitmentscftc_ContractslotsWeekly

Regulatory

SourcePrefixValue LabelUnitUpdate Freq
SEC Filingssec_edgar_ / sec_efts_ / sec_insider_FilingsDaily
Congress Votescongress_CountDaily
Federal Courtscourt_Filings/dayDaily
NYC 311 Complaintsnyc311_Complaints/24h~15 min

Tech & Developer

SourcePrefixValue LabelUnitUpdate Freq
GitHub Repositoriesgithub_Stars~10 min
npm Packagesnpm_Downloads/wkDaily
PyPI Packagespypi_Downloads/dayDaily
Crates.io Rustcrates_io_DownloadsDaily
StackOverflowstackexchange_Questions/day~30 min
Hacker Newshn_Scorepts~5 min
Cloudflare DNScloudflare_RankDaily
Internet Outages (IODA)ioda_Connectivity%~5 min

Entertainment

SourcePrefixValue LabelUnitUpdate Freq
Twitch Streamingtwitch_Viewerslive~2 min
Movies & TV (TMDB)tmdb_Popularityscore~30 min
Last.fm Musiclastfm_Listeners~10 min
Steam Gamingsteam_Playersonline~5 min
AniList Animeanilist_PopularityscoreDaily
Reddit Communitiesreddit_Subscribers~10 min
Chaturbate Livecb_model_Viewerslive~2 min
Board Games (BGG)bgg_Hotness#~30 min
Backpack.tf Tradingbackpacktf_PriceUSD~10 min
4chan Boardsfourchan_Activity~5 min
Sports Statssport_ScoreptsLive
Esports (PandaScore)esport_ScoreLive
Theme Park Waitsqueue_times_Avg Waitmin~5 min
McBroken Ice Creammcbroken_% Broken%~10 min

Geophysical & Environment

SourcePrefixValue LabelUnitUpdate Freq
USGS Earthquakesearthquake_MagnitudeM~1 min
Volcano Activityvolcano_Alert Level0-4~30 min
NOAA Weatherweather_TemperatureF~15 min
Weather Alertsweather_alert_Countalerts~5 min
Open-Meteoopenmeteo_TemperatureC~15 min
Air Quality (AirNow)airnow_AQI0-500~30 min
USGS Waterusgs_water_Dischargeft3/s~15 min
NOAA Ocean Metnoaa_met_TempF~30 min
NOAA Tidesnoaa_tide_Water Levelft~6 min
NDBC Ocean Buoysndbc_Wave Heightm~30 min
River Gaugesnwps_Stage Heightft~15 min
NRC Nuclearnrc_Power%Daily
Wildfire Trackingwildfire_Hotspotsfires~15 min
Disease Trackingepidemic_CasesDaily
US Power Outagespower_outages_Affectedcustomers~15 min

Transport

SourcePrefixValue LabelUnitUpdate Freq
Global Flightsflights_Flightsactive~5 min
Transit Realtime (GTFS)gtfs_Delaymin~1 min
CityBikescitybikes_Availablebikes~5 min
Parking Availabilityparking_Free Spaces~5 min
TomTom Traffictomtom_traffic_Congestionratio~5 min
EV Chargingtomtom_evcharge_Availableconnectors~10 min
Border Wait Timescbp_border_Wait Timemin~15 min
Airport Delays (FAA)faa_delays_Delay0/1~5 min
Deutsche Bahndb_trains_Avg Delaymin~5 min
NYC Subway (MTA)mta_subway_Disruption0-5~2 min
Paris Metro (RATP)paris_metro_Disruption0-4~2 min
Ryanair Delaysryanair_Avg Delaymin~10 min
London Undergroundtfl_tube_Disruption0-8~2 min
Ship Tracking (AIS)aisstream_Vessels~5 min
Port Datamaritime_Ships~10 min

Academic

SourcePrefixValue LabelUnitUpdate Freq
OpenAlex Papersopenalex_Papers/dayDaily
Crossref Citationscrossref_DOIsDaily
PubMed Medicalpubmed_ArticlesDaily

Nature

SourcePrefixValue LabelUnitUpdate Freq
eBird Observationsebird_ObservationsDaily
Wildlife Trackinganimals_Observations/24hDaily
Animal Migrationmovebank_LocationsDaily
Animal Sheltersshelter_CountanimalsDaily

Space

SourcePrefixValue LabelUnitUpdate Freq
Space Weatherspaceweather_Kp Index0-9~15 min
ISS Trackeriss_Position~1 min
Military Aircraftmil_aircraft_Count~5 min

How Sources Become Markets

A source produces a numeric value. Any numeric value. The temperature in Fahrenheit, the number of active wildfires, the Kp index of geomagnetic storms. The protocol does not distinguish between the profound and the trivial. It treats them all with the same mechanical impartiality. Players predict whether the value goes UP or DOWN (or stays FLAT) over a tick period.
    ┌──────────────────────────────────────────────────────────────────┐
    │                    SOURCE TO MARKET FLOW                        │
    └──────────────────────────────────────────────────────────────────┘

         Source API                  Data Node                  On-Chain
         ~~~~~~~~~~                  ~~~~~~~~~                  ~~~~~~~~

    ┌──────────────┐
    │  CoinGecko   │
    │  GET /price  │──── BTC = $67,432.10 ────┐
    │  ?ids=btc    │                          │
    └──────────────┘                          ▼
                                   ┌────────────────────┐
                                   │  Validate & Store  │
                                   │                    │
                                   │  asset_id: BTC-USD │
                                   │  price: 67432.10   │
                                   │  ts: 1710403200    │
                                   └─────────┬──────────┘


                                   ┌────────────────────┐
                                   │  Tick N resolves   │
                                   │                    │
                                   │  Start: $67,432.10 │
                                   │  End:   $67,891.55 │
                                   │                    │
                                   │  Delta: +$459.45   │
                                   │  Result: UP        │
                                   └─────────┬──────────┘


                                   ┌────────────────────┐
                                   │  BLS-signed price  │
                                   │  submitted on-chain│
                                   │                    │
                                   │  2/3+ oracles must │
                                   │  agree on the      │
                                   │  price before it   │
                                   │  resolves.         │
                                   └────────────────────┘
The same pattern works for every source — whether the “price” is Bitcoin in USD, an earthquake magnitude, the number of broken McDonald’s ice cream machines in Chicago, or the disruption level on the London Underground. The machinery does not know what it is measuring. It only knows the number went up, or it went down, or it stayed the same. In this, it resembles the universe itself.

Market ID Convention

Every market has a string ID formed from its source prefix and asset name. A naming convention for the measurable world:
    ┌─────────────┬──────────────────┬──────────────────────────────┐
    │   Prefix    │   Asset          │   Full Market ID             │
    ├─────────────┼──────────────────┼──────────────────────────────┤
    │  crypto_    │  BTC-USD         │  crypto_BTC-USD              │
    │  earthquake_│  california      │  earthquake_california       │
    │  tfl_tube_  │  northern        │  tfl_tube_northern           │
    │  mcbroken_  │  chicago         │  mcbroken_chicago            │
    │  steam_     │  counter-strike-2│  steam_counter-strike-2      │
    │  defi_      │  aave            │  defi_aave                   │
    │  db_trains_ │  berlin_hbf      │  db_trains_berlin_hbf        │
    │  nrc_       │  palo-verde-1    │  nrc_palo-verde-1            │
    │  ndbc_      │  41002           │  ndbc_41002                  │
    │  airnow_    │  los-angeles     │  airnow_los-angeles          │
    └─────────────┴──────────────────┴──────────────────────────────┘
The prefix determines which source and category the market belongs to. The frontend uses prefix matching to route markets to the correct display logic (value labels, units, formatting).

Source Implementation

Each source is a Rust module in the Data Node implementing the MarketDataSource trait. Rust was chosen because it does not forgive mistakes, which is appropriate for code that handles other people’s money:
pub trait MarketDataSource: Send + Sync {
    /// Unique source identifier (e.g., "github", "earthquake")
    fn source_id(&self) -> &str;

    /// Fetch latest prices for all tracked assets
    async fn fetch_prices(&self) -> Result<Vec<PriceUpdate>>;

    /// Discover available assets (called periodically)
    async fn discover_assets(&self) -> Result<Vec<AssetEntry>>;
}
Each source has:
  1. A config JSON — static list of tracked assets (e.g., config/github.json, config/ioda.json)
  2. An HTTP client — handles rate limiting, retries, and response parsing
  3. A collection loop — periodically calls the source API and writes to PostgreSQL
    data-node/src/
    ├── config/
    │   ├── github.json          <-- 700 repos to track
    │   ├── ioda.json            <-- 50 countries to monitor
    │   ├── earthquake.json      <-- region definitions
    │   ├── power_outages.json   <-- 50 US states
    │   └── ...                  <-- one JSON per source

    └── market_data/
        └── sources/
            ├── github/
            │   └── client.rs    <-- MarketDataSource impl
            ├── earthquake/
            │   └── client.rs
            ├── ioda/
            │   └── client.rs
            ├── weather/
            │   └── client.rs
            └── ...              <-- one module per source

Rate Limiting

Every source has built-in rate limiting to respect upstream API constraints. The Data Node uses a sliding-window rate limiter that automatically backs off when limits are approached. Even greed has a clock.
    ┌──────────────────────────────────────────────────────────┐
    │                  RATE LIMIT EXAMPLES                     │
    ├────────────────────┬───────────────┬─────────────────────┤
    │  Source            │  Limit        │  Strategy           │
    ├────────────────────┼───────────────┼─────────────────────┤
    │  GitHub (auth)     │  5,000/hr     │  850ms between reqs │
    │  GitHub (no auth)  │  60/hr        │  6.5s between reqs  │
    │  CoinGecko (free)  │  30/min       │  2s between reqs    │
    │  USGS Earthquake   │  No limit     │  Poll every 60s     │
    │  TFL              │  500/min       │  Burst OK            │
    │  IODA             │  No limit      │  Poll every 5 min   │
    │  NOAA Weather     │  No limit      │  Poll every 15 min  │
    └────────────────────┴───────────────┴─────────────────────┘

Adding a New Source

If ninety-eight ways to measure the world are not enough, you can add more. See Adding a Data Source for the full guide. The short version:
  1. Create data-node/src/config/yoursource.json with asset definitions
  2. Implement MarketDataSource in data-node/src/market_data/sources/yoursource/client.rs
  3. Register the source in the Data Node startup
  4. Add a VISION_SOURCES entry in frontend/lib/vision/sources.ts
  5. Add prefix mapping in frontend/lib/vision/market-categories.ts
  6. Add batch deployment in contracts/script/DeployAllVisionBatches.s.sol
    ┌────────────────────────────────────────────────────────────────┐
    │                NEW SOURCE CHECKLIST                            │
    ├────────────────────────────────────────────────────────────────┤
    │                                                                │
    │  [1] config JSON ........... data-node/src/config/             │
    │  [2] Rust client ........... data-node/src/market_data/sources/│
    │  [3] Source registration ... data-node/src/main.rs             │
    │  [4] Frontend source ....... frontend/lib/vision/sources.ts    │
    │  [5] Category mapping ...... frontend/lib/vision/market-cats.ts│
    │  [6] Batch deployment ...... contracts/script/DeployAll...sol  │
    │                                                                │
    │  All 6 files must be updated. Miss one and markets won't       │
    │  show up correctly (or at all) in the UI.                      │
    └────────────────────────────────────────────────────────────────┘