Polymarket Bot Tutorial · Chapter 14 of 32
Polymarket पर News arbitrage: headlines, source feeds (RSS/Twitter/AP), latency budgets, false-positive filters, और कब news edge market price में खत्म हो जाती है - इस पर market को कैसे beat करें।
यह chapter क्या कवर करता है
News arbitrage public information पर market के उसे repricing करने से पहले trade करने की strategy है। Edge असली है लेकिन बहुत narrow - ज़्यादातर "news" human के पढ़ने तक पहले ही price में शामिल हो चुकी होती है। यह chapter बताता है कि कौन-से sources सच में market को beat करते हैं, वह latency budget क्या है जो इस strategy को define करता है, और वह false-positive filter कौन-सा है जिसके बिना bot हर retweet पर trade करने लगता है।
- Information edge कैसा दिखता है
- News sources: RSS, Twitter, AP, official feeds
- Latency budget: 2 seconds से कम में read-to-trade
- False-positive filters
- कब news edge खत्म हो जाती है
- Code: news feed poll करना और relevant markets पर FOK place करना
- Risk: half-truths और walked-back headlines
Information edge कैसा दिखता है
News arbitrage का मतलब है public information पर market के उसे repricing करने से तेज trade करना। Edge एक संकीर्ण window में होती है - आमतौर पर 30-300 seconds - जब कोई fact public बनता है और Polymarket उसे reflect करता है।
Edge के असली होने के लिए तीन बातें सही होनी चाहिए। पहली, news source median Polymarket trader से तेज होनी चाहिए (Twitter mainstream press से तेज है; AP wire Twitter से तेज है)। दूसरी, news unambiguous होनी चाहिए (जैसे injury announcement, court ruling) - interpretation latency खा जाती है। तीसरी, market इतना wide होना चाहिए कि price move spread tax के लायक हो।
इस edge को target करने वाले bots दो camps में बंटते हैं: वे जो direct sources subscribe करके parse करते हैं, और वे जो Polymarket पर unusual price move देखते हैं और infer करते हैं कि news हुई है। दोनों valid हैं; पहला lead करता है, दूसरा follow करता है।
News sources: RSS, Twitter, AP, official feeds
Sources को public-information-status तक latency के हिसाब से rank किया गया है, fastest first.
- Direct primary sources: court filings, government press releases, central-bank announcements. अक्सर public RSS या API मिलता है. सबसे तेज, सबसे कम false-positive rate.
- AP wire / Reuters Eikon (paid). Traditional traders यही wire use करते हैं. Consumer Twitter पर ~5-30 second lead.
- Twitter (X, paid API). Verified accounts की lists: official org accounts, beat reporters. Free APIs पर rate limits बहुत सख्त होते हैं; Pro tier के लिए pay करें या relay service use करें.
- Specialized newsletters / Discord: paid Substacks, embargoed industry feeds. Niche markets (crypto, esports) के लिए useful.
- Mainstream press websites: news-arb edge के लिए बहुत slow.
जहाँ RSS उपलब्ध हो, वहाँ RSS use करें - यह free है, polling intervals reliable होते हैं. बाकी के लिए Twitter. Production-serious news desks के लिए AP.
Latency budget: 2 seconds से कम में read-to-trade
Bot को ingest, classify, decide, और order place करने का कुल समय 1-2 seconds के भीतर रखना होगा. Budget:
- Ingest: 50-300ms (websocket feed, RSS poll, Twitter stream).
- Classify: 50-200ms (regex / keyword match, optionally LLM अगर prompt cache किया हो).
- Decide: 50ms (rules table lookup; news tag से market slug mapping).
- Place: 200-500ms (CLOB पर FOK signed order).
सबसे बड़ा budget eater LLM classification है। 500-token GPT-4 call 1-3 seconds जोड़ सकती है; और यहीं पूरा arb window खत्म हो जाता है। Production में keyword rules से classify करें; LLM को सिर्फ keyword set की offline calibration के लिए use करें।
False-positive filters
जो news-arb bots false positives filter नहीं करते, वे हर retweet पर trade करते हैं और spread tax से bleed करते हैं। तीन filters.
- Source whitelist: केवल pre-approved list के accounts/feeds पर act करें. List छोटी रखें (10-30 sources).
- Keyword + confirmation pair: एक single keyword match noise है; 30s के भीतर दो independent sources में match signal है.
- Market-state guard: ऐसे markets skip करें जो पिछले 60 seconds में पहले ही > 5% move कर चुके हों - कोई और पहले news पकड़ चुका है, edge खत्म हो गई है.
अच्छी तरह tuned filters का false-positive rate: लगभग 1 in 5-10. 90% false-positive rate strategy को नष्ट कर देती है; 50% rate छोटे position sizes के साथ workable है.
कब news edge खत्म हो जाती है
"news public" से लेकर "price reflects news" तक का window हर साल और तेज़ी से बंद हो रहा है। 2020 में mid-priced political markets को headline absorb करने में minutes लगते थे। 2026 में वही headlines price के fully move होने से पहले 30-90 seconds में compress हो जाती हैं।
Edge के खत्म होने के संकेत: flagged trades पर per-trade PnL +3c से 30-trade window में flat हो जाए; false positives की rate, जो बाद में पहले से priced-in निकलती हैं, 70% से ऊपर चली जाए; market 200ms के भीतर आपका FOK ask hit कर दे क्योंकि कोई और पहले पहुँच गया।
जब edge खत्म हो जाए, तो honest pivot यह है: slower, more interpretive news की ओर जाएँ (court rulings, central bank meeting minutes), जहाँ meaning parse करने में latency race से ज़्यादा समय लगता है। या strategy चलाना बंद कर दें।
Code: news feed poll करना और relevant markets पर FOK place करना
Production skeleton: एक news source poll करें, rule matches run करें, hits पर FOK orders fire करें.
import feedparser, time, re
from py_clob_client.client import ClobClient
RULES = [
{"regex": re.compile(r"out for season|torn ACL", re.I), "tag":"injury-fade"},
{"regex": re.compile(r"federal reserve.*(rate cut|rate hike)", re.I), "tag":"fed-move"},
]
seen = set()
while True:
feed = feedparser.parse("https://example.com/news.rss")
for entry in feed.entries[:20]:
if entry.id in seen: continue
seen.add(entry.id)
for rule in RULES:
if rule["regex"].search(entry.title + " " + entry.summary):
# Look up relevant Polymarket markets, place FOK
fire(rule["tag"], entry)
break
time.sleep(15)
Polling intervals: RSS के लिए 5-15 seconds. जहाँ उपलब्ध हो, WebSocket (Twitter, AP wire). हमेशा source-provided ID से dedup करें; कभी यह assume न करें कि polling exactly-once है।
Risk: half-truths और walked-back headlines
News-arb bot के लिए सबसे खराब दिन वह होता है जब headline गलत निकलती है। उदाहरण: Reuters tweet कहता है "Trump fires Yellen," market 8 cents ऊपर जाता है, 12 minutes बाद tweet delete और correct हो जाता है. 8c पर खरीदने वाला bot अब -3c inventory के साथ फँस जाता है और कोई remedy नहीं होती।
Defenses:
- Two-source confirmation: कभी भी single tweet पर trade न करें; 60-180 seconds के भीतर दूसरे independent source से corroborating signal चाहिए.
- Position size scaled to source confidence: AP wire = full size; verified beat reporter का Twitter = 50%; rumor source = 25%.
- Auto-exit on retraction signal: अगर आपने जिस source का उपयोग किया था वह 30 minutes के भीतर correction issue करे, PnL की परवाह किए बिना market पर exit करें.
Walk-back problem news-arb position sizing पर एक hard ceiling है। प्रति signal $50 trade करना 30% false-positive rate में भी survive करने देता है; $500 trade करना नहीं।





