How to Build a Prediction-Market Watcher on the Elgon API

Build a read-only prediction-market watcher on the Elgon REST /predictions endpoint: poll simulated snapshots, flag probability moves, and log alerts. Elgon serves data only and cannot trade.

Dark futuristic banner for “How to Build a Prediction-Market Watcher on the Elgon API,” showing a friendly robot using a laptop above a colorful chart.

A prediction-market bot, done responsibly, is a watcher: it polls market data on a schedule, checks each market's implied probability against a rule you define, and alerts you when something moves. It does not place trades. That framing is not just good hygiene — it is a hard constraint of the tool this guide uses. Elgon is a read-only market-data API. It returns data; it has no endpoint to place, route, or cancel an order.

Two things to be clear about before any code. First, Elgon cannot trade — any execution happens in your own venue account, by you. Second, Elgon's /predictions data is simulated sandbox data, tagged "source":"sandbox". It is perfect for building and testing a watcher end to end, but the numbers are sample values, not real market odds. Treat this as a working skeleton you can point at a real feed later.

What the watcher does

The loop is simple: fetch the current markets, compare each one's yesPrice to the last value you saw, and if it moved more than a threshold, log an alert. No orders, no positions, no money at risk. Just a signal you can act on yourself.

Step 1: Fetch the markets

Every Elgon endpoint is a plain HTTP GET. Query /predictions with a search term and the public sandbox key:

import requests

BASE = "https://elgonrpc.xyz/api/v1"
KEY = "elgon_sandbox_pub"

def predictions(q):
    resp = requests.get(f"{BASE}/predictions", params={"q": q, "key": KEY})
    resp.raise_for_status()
    return resp.json()["data"] # [{ id, question, yesPrice, noPrice, volume, closesAt }]

Step 2: Detect a probability move

Keep the last price you saw per market id, and compare on each poll:

MOVE_THRESHOLD = 0.05 # 5 probability points
last = {}

def check(markets):
    alerts = []
    for m in markets:
        prev = last.get(m["id"])
        now = m["yesPrice"]
        if prev is not None and abs(now - prev) >= MOVE_THRESHOLD:
            alerts.append((m["question"], prev, now))
        last[m["id"]] = now
    return alerts

Step 3: Poll and log (no trading)

Put it on an interval that respects the rate limit (60 requests/min on the free tier), and log the alerts. This is where the bot ends — it notifies you; it never executes:

import time

while True:
    markets = predictions("fed")
    for question, prev, now in check(markets):
        print(f"ALERT: {question} YES {prev:.0%} -> {now:.0%}")
        # Notify yourself: email, Slack, a webhook you own.
        # Elgon does not and cannot place trades.
    time.sleep(60) # 1 request/min — well under the free limit

Because the whole thing is read-only, you can leave it running with zero risk of it moving money. When you are ready to trade on a signal, you do it deliberately, in your venue account.

Rate limits and honesty

The free tier allows 60 requests per minute; Growth is $350/month for 600/min via Stripe. There is no WebSocket or subscription API — polling is the model. And the data is sandbox-simulated: build and validate your logic against it, but wire in a real venue feed before you act on live money.

FAQ

Can this bot place trades through Elgon?

No. Elgon is a read-only data API with no order endpoint. The bot watches and alerts; execution is entirely separate and up to you.

Is the market data real?

No. Elgon's /predictions data is simulated sandbox data. Use it to build the watcher; do not trade on it as if it were real odds.

How do I get faster updates?

Poll more frequently within your rate limit. There is no streaming API; Elgon serves data over plain HTTP GET only.

Ready to build? Get your API key and read the API docs.