Polymarket Bot Tutorial · अध्याय 15 of 32

Polymarket पर sports microstructure bots: in-game edge, scoreline-driven mispricing, NBA tag (745) और Tennis tag (864), live data sources, और high-frequency sports markets के लिए execution patterns.

यह अध्याय क्या कवर करता है

Sports markets Polymarket पर सबसे लगातार active non-political segment हैं। जो bots काम करते हैं, वे दो साफ़ buckets में आते हैं: pre-game line-catchers जो line set होने के बाद trade करते हैं, और in-game microstructure bots जो play के दौरान order-book movement पर react करते हैं। यह chapter दोनों को cover करता है, specific tag IDs, data sources, और latency budgets के साथ जो हर एक पर लागू होते हैं।

Sports markets Polymarket पर सबसे busy non-political segment हैं। जो execution pattern काम करता है, वह live-score feed (ESPN, PandaScore) को order-book microstructure signals के साथ combine करता है। यह chapter बताता है कि NFL, NBA, soccer, और tennis के लिए क्या काम करता है, और esports कहाँ अलग है।

  • Sports markets tradeable क्यों हैं
  • Pre-game vs in-game (अलग bots)
  • Verified tag IDs (745 NBA, 864 Tennis)
  • Data sources: ESPN, official APIs, on-screen
  • In-game के लिए latency budget
  • 0.99 / 0.01 trap
  • Code: games book subscribe करें और react करें

Sports markets tradeable क्यों हैं

Sports markets defined timeframes (hours से days) में settle होते हैं, public live data होती है, और games के दौरान continuous order flow attract करते हैं। Tradeable market के लिए ये तीनों ज़रूरी हैं - political markets में "defined timeframe" missing होता है, weather markets में "continuous flow" missing होता है, और obscure tournaments में "public live data" missing होती है।

Sports markets पर trader population भी, मान लीजिए election markets के मुकाबले, ज़्यादा diverse होती है। Casual sports bettors भावनाओं के आधार पर price करते हैं; informed traders game के दौरान fair value की तरफ correct करते हैं। इन दोनों के बीच का gap ही bot edge है।

Volume distribution uneven होती है: NFL Sunday पर Polymarket sports markets में hundreds of millions of dollars rotate हो सकते हैं; Tuesday-night Saudi Pro League fixture शायद $50k से कम कर दे। अपनी strategy को उस जगह के हिसाब से size करें जहाँ action सच में है।

Pre-game vs in-game (अलग bots)

दो fundamentally अलग bot designs.

Pre-game line-catcher: अभी-अभी खुले markets scan करें, अपने model या sharper venue के number के मुकाबले mis-priced lines identify करें, FOK buy place करें। In-play तक hold करें, कभी-कभी resolution तक। Speed: minutes-not-seconds. Edge: model + line-shopping.

In-game microstructure: live game के order book WebSocket को subscribe करें, score events + imbalance signals पर seconds के भीतर react करें। Speed: seconds-not-minutes. Edge: latency + order flow पढ़ना।

दोनों का code लगभग साझा नहीं होता। इनके risk profiles अलग हैं, data sources अलग हैं, exit strategies अलग हैं। जो bot दोनों करने की कोशिश करता है, वह अंत में दोनों को ठीक से नहीं करता; एक चुनें।

Verified tag IDs (745 NBA, 864 Tennis)

Production tag IDs, major sports categories के लिए May 2026 में verified। इन्हें /events calls को efficiently filter करने के लिए use करें।

Sport / LeagueTag IDTag slugNotes
NBA745nbahighest volume Oct-Jun
NFL450nflpeak Sun/Mon Sep-Feb
Tennis (all)864tennisyear-round, tournament cadence
Soccer (general)1059soccercombine with sub-tags below
EPL739epl
UCL2186uefa-champions-league
Esports (all)702esportsLoL+CS2+Valorant+Dota
MLB1245mlbpeak Apr-Oct
NHL823nhlpeak Oct-Jun

Tag IDs साल दर साल stable रहते हैं। नए tags add किए जाते हैं (Saudi Pro League, IPL), लेकिन पुराने tags का renumber नहीं होता।

Data sources: ESPN, official APIs, on-screen

Traditional sports के लिए free ESPN scoreboard API आपकी ज़रूरत की सब चीज़ cover करता है: scores, period/clock, win-probability, और कभी-कभी shot location। कोई key required नहीं; rate limiting सिर्फ IP level पर होती है। Endpoint pattern: https://site.api.espn.com/apis/site/v2/sports/<sport>/<league>/scoreboard.

Esports के लिए ESPN coverage नहीं देता। Options: PandaScore ($30-60/mo, industry standard), HLTV (sirf CS2, scrapeable, कोई API नहीं), Liquipedia (community-maintained, scrapeable, slower update cadence)।

On-screen feeds (TV stream के लिए pay करके scorebug को OCR-reading करना) काम करते हैं, लेकिन operationally heavy हैं। इन्हें केवल तभी recommend किया जाता है जब आपकी strategy को ऐसे sport पर sub-3-second updates चाहिए हों, जहाँ कोई API real time में cover नहीं करती।

In-game के लिए latency budget

In-game reactive bot के लिए end-to-end latency budget.

  • Score event होता है: t=0
  • Source feed reflect करता है: t+3-15s (ESPN: ~10s; PandaScore: ~3s)
  • आपका bot feed read करता है: t+10-16s
  • Bot action decide करता है: +50ms
  • FOK order place होता है: +200-500ms
  • CLOB पर matched होता है: +300-1000ms (network + matching)

Total: 11-17 seconds। सबसे तेज़ professional firms paid premium feeds और co-located VPS के साथ end-to-end 3-5 seconds achieve करती हैं। Standard hosts और free ESPN पर चलने वाले retail bots slower end पर होते हैं।

जिन strategies को sub-5s चाहिए, वे retail के लिए viable नहीं हैं। जिन strategies का 10-17s window में काम बनता है, वे हैं: score के बाद line-catching, overreactions को fade करना, late-game certainty plays।

0.99 / 0.01 trap

सबसे common in-play sports bot failure: one minute left रहते हुए heavy favorite को 0.99 पर खरीदना, और easy +1¢ की उम्मीद करना। यह तीन कारणों से fail होता है।

पहला, underdog की 1% implied probability zero नहीं होती - late comebacks non-trivial frequency से होते हैं। 99.5% certain win, 200 बार खेला जाए, तो full position size पर एक loss देता है।

दूसरा, 0.99/0.01 पर spread का मतलब है कि आप share के लिए 99c pay करते हैं, success पर 1c जीतते हैं, और rare reversal पर 99c lose करते हैं। Risk-reward बहुत brutal है।

तीसरा, GTC sell at 0.999 इस्तेमाल करने वाला bot शायद ही fill होगा - उस price पर buyers नहीं होते। Position resolution तक ride करती है। अगर वह जीतता है, आपको 1c मिला। अगर reversal हुआ, तो आप 99c हार गए।

यह trap असली पैसा खोवाता है उन builders को जिन्होंने math run नहीं किया। 0.95+ priced markets से दूर रहें, जब तक आपकी strategy खास तौर पर redemption-arbitrage profile के लिए built न हो।

Code: games book subscribe करें और react करें

Reference: एक specific NBA game के WebSocket को subscribe करें, book updates log करें, imbalance signal पर FOK fire करें।

import websocket, json
THRESHOLD = 0.5  # imbalance level to trigger

def on_message(ws, message):
    msg = json.loads(message)
    if msg.get("event_type") != "book": return
    bids = msg.get("bids", [])
    asks = msg.get("asks", [])
    bid_depth = sum(float(b["price"]) * float(b["size"]) for b in bids[:5])
    ask_depth = sum(float(a["price"]) * float(a["size"]) for a in asks[:5])
    total = bid_depth + ask_depth
    if total < 100: return  # too illiquid
    imb = (bid_depth - ask_depth) / total
    if abs(imb) > THRESHOLD:
        print(f"signal imb={imb:.2f} bid={bid_depth:.0f} ask={ask_depth:.0f}")
        # fire FOK here

ws = websocket.WebSocketApp(
    "wss://ws-subscriptions-clob.polymarket.com/ws/market",
    on_open=lambda ws: ws.send(json.dumps({"type":"Market","markets":["<CONDITION_ID>"]})),
    on_message=on_message
)
ws.run_forever()

Production additions: fires के बीच cooldown, per-token inventory cap, stale book पर kill (30s में कोई message नहीं)।

अक्सर पूछे जाने वाले प्रश्न

Polymarket पर कौन से sports tags सबसे active हैं?
NBA (tag_id 745), Tennis (tag_id 864), और soccer (competition के हिसाब से अलग-अलग) अपने seasons के दौरान 24h volume में lead करते हैं। NFL regular season और playoffs के दौरान weekly spike करता है। हमने production में NBA और Tennis tag IDs verify किए हैं - बाकी को भरोसा करने से पहले gamma /tags endpoint के जरिए check करना चाहिए।
क्या मैं in-game sports markets में profitably bot चला सकता हूँ?
संभवतः - लेकिन यह मुश्किल है। Edge real है (live scoreline अक्सर 30-90 seconds तक mispriced रहती है) लेकिन दूसरे bots भी देख रहे होते हैं। हमें जो सबसे अच्छे results दिखे हैं, वे fast live-score data source को simple rules ("opponent scored, market hasnt moved yet, buy") के साथ combine करने से आए हैं। Pure stat-arb, data source के बिना, faster competitors से हार जाता है।
मुझे live sports data कहाँ से मिलेगी?
ESPN.com में unofficial JSON endpoints हैं जो live scores return करते हैं - कई strategies के लिए पर्याप्त। Official APIs (NBA Stats API, NFL public endpoints) ज़्यादा reliable हैं लेकिन slower। Beat reporters के Twitter accounts text देते हैं लेकिन उन्हें LLM parsing चाहिए। इनमें से कोई भी HFT-grade नहीं है; सभी retail के लिए "fast enough" हैं।
0.99 / 0.01 trap क्या है?
जब कोई sports market 99 cents YES पर होता है (जीतने की बहुत संभावना), तो upside लगभग बचता नहीं और 1-cent move भी महीनों के expected gain को मिटा सकता है। कई bots 0.99 पर खरीदते समय last cent chase करते हुए फँस जाते हैं और unexpected event आने पर price 0.85 तक गिरने से बुरी तरह चोट खाते हैं। Hard rule: लगभग 0.95 से ऊपर buy न करें, जब तक आपकी expected value math bulletproof न हो।
Polymarket sports, traditional sportsbooks की तुलना में कैसा है?
Spread पर house edge नहीं है (जबकि FanDuel/DraftKings पर लगभग 5-10% vig होता है), लेकिन liquidity पतली होती है और spreads wider हो सकते हैं। Polymarket उन events में बेहतर है जिन्हें traditional books underprice करते हैं - international tournaments, esports, niche markets। Mainstream NFL/NBA के लिए traditional books ज़्यादा liquid हैं, लेकिन vig में ज़्यादा cost आती है।
क्या मेरा bot कई sports markets में एक साथ trade कर सकता है?
हाँ - और आपको ऐसा करना चाहिए। Sports microstructure सबसे अच्छा 5-20 simultaneous games के portfolio के रूप में काम करता है। Per-game position cap (जैसे 50 USD), portfolio cap (जैसे 500 USD), और games के बीच uncorrelated exposure। एक game पर concentrate करने से variance max हो जाती है।