Polymarket Bot ट्यूटोरियल · अध्याय 21 of 32
Polymarket binary Yes/No market bot strategies: standard event contracts, hard-capped 1x leverage, scale via portfolio breadth, common mistakes (chasing 0.99), and code skeleton.
यह अध्याय क्या कवर करता है
Binary (Yes/No) markets Polymarket की foundation हैं। ज़्यादातर strategies यहीं रहती हैं। यह अध्याय leverage cap, 0.99-price trap, जो नए builders को पकड़ लेता है, और breadth-not-size pattern, जिस पर production bots converge करते हैं, को कवर करता है।
- Binary markets क्या cover करते हैं
- 1x leverage cap (और उसके आसपास scale कैसे करें)
- Common mistake: 0.99 prices का पीछा करना
- Effective leverage के रूप में portfolio breadth
- Per market vs portfolio risk
- Code: binary markets scan करना और sized buys place करना
Binary markets क्या cover करते हैं
Binary markets Polymarket की foundation हैं: एक single yes/no question, जिसमें दो outcome tokens होते हैं। "Will Trump win the 2024 election?" binary है; "Who will win the 2024 election?" जिसमें 5 candidates हैं, वह NegRisk है (chapter 11)।
एक binary market पर दो outcome tokens (YES और NO) 1.0 minus एक छोटे spread tax के बराबर sum करते हैं। आप किसी भी side को buy कर सकते हैं; दोनों sides के अपने order book हैं। Pricing symmetric होती है - YES को 0.40 पर खरीदना expected payoff में NO को 0.60 पर sell करने के बराबर है।
Polymarket पर ज़्यादातर non-tournament markets binary होते हैं: weather questions, single-event political outcomes, individual sports games, single price-target crypto questions। Bot pattern इनमें से ज़्यादातर में similar है।
1x leverage cap और उसके आसपास scale कैसे करें
Polymarket binaries 1x leverage हैं: आप 0.40 पर 100 shares खरीदने के लिए $40 spend करते हैं; maximum payout $100 है। यहाँ margin नहीं है और liquidation भी नहीं। Capital efficiency perp futures (chapter 24) की तुलना में कम है, जहाँ 2-25x available है।
1x cap के आसपास scale करने का मतलब है या तो: (1) markets में ज़्यादा capital deploy करना - leverage करने के बजाय diversify करें, (2) resolving markets के through capital cycle करना - हर resolution पर capital free होता है और next market में rotate हो जाता है, (3) NegRisk markets का उपयोग करना, जहाँ sum-to-1 arb effective synthetic leverage produce कर सकता है।
Binary strategy के लिए सही framing: low-leverage, high-breadth। 50 markets में 50 छोटे positions mature bot का typical profile है, 5 markets में 5 बड़े positions नहीं।
Common mistake: 0.99 prices का पीछा करना
सबसे common binary-bot failure: resolution के करीब एक heavy favorite को 0.99 पर खरीदना, इस उम्मीद में कि YES पर settle होने पर easy 1c payout मिलेगा।
Math: 0.99 पर आप 1c जीतने के लिए 99c pay करते हैं। 1% failure rate (100 markets में 1), जहाँ हर failure आपको 99c cost करता है, 99 successful 1c wins को wipe out कर देता है। Extreme पर risk-reward ratio brutal है।
Capacity भी एक problem है। 0.99 पर book thin होता है; meaningful size लगाने पर price 0.995 या उससे ऊपर तक walk हो जाती है, जिससे पहले से ही thin edge और erode हो जाता है।
0.92 से ऊपर priced markets से बाहर रहें, जब तक कि आपके पास tail-yield arb profile के लिए डिज़ाइन की गई specific strategy न हो। ज़्यादातर binary bots को 0.85 से ऊपर कभी buy नहीं करना चाहिए।
Effective leverage के रूप में portfolio breadth
आप individual positions को leverage नहीं कर सकते, लेकिन एक साथ कई uncorrelated bets hold करके portfolio की variance characteristics को leverage कर सकते हैं।
$20 each के 50 positions = $1,000 in play। अगर win rate +3c/-4c economics पर 55% है, तो expected daily PnL है (0.55 × 3 − 0.45 × 4) × 50 × $0.20 = $1.50 expected, bounded variance के साथ। Single $1,000 position की तुलना में same expected return, बहुत कम drawdown।
Constraint: positions सचमुच uncorrelated होने चाहिए। एक ही weekend में 50 NFL favorites 50 independent bets नहीं हैं; वे काफी हद तक games में weather-and-favorite bet correlated होते हैं। Sport, event type, time horizon across diversify करें।
Per market vs portfolio risk
दो risk caps, दोनों ज़रूरी हैं।
- Per-market: edge की परवाह किए बिना प्रति market अधिकतम $X। यह catastrophic single-market loss को cap करता है। Common value: प्रति market $25-100।
- Portfolio: किसी भी समय deploy की गई total capital की अधिकतम सीमा। यह uncorrelated bad days में total drawdown को cap करता है। Common value: wallet balance का 50-70%।
Per-market cap ज़्यादा महत्वपूर्ण है क्योंकि यह किसी भी single bug या edge-disappears event के blast radius को bound करता है। Portfolio cap एक sanity check है; 50+ positions के साथ, law of large numbers आमतौर पर आपको bounds के भीतर रखता है, इसके बिना भी।
दोनों caps code में enforce होने चाहिए, दिमाग में नहीं। Enforced caps के बिना bot eventually वह configuration ढूँढ ही लेगा जिसमें वह capital का 90% single market में deploy कर दे और उसे खो दे।
Code: binary markets scan करना और sized buys place करना
Reference: top-volume binary markets scan करें, valid setups filter करें, sized FOK buys place करें।
def scan_and_buy():
events = gamma_top_events(limit=50, active=True, closed=False)
for ev in events:
for m in ev.get("markets", []):
if m.get("negRisk"): continue # binaries only
outs = json.loads(m["outcomes"])
prices = [float(p) for p in json.loads(m["outcomePrices"])]
for i, out_name in enumerate(outs):
if not setup_qualifies(m, i, prices[i]): continue
tok = json.loads(m["clobTokenIds"])[i]
size = compute_size(m, prices[i])
if size < 5: continue
place_fok(tok, "BUY", prices[i] + 0.02, size, neg_risk=False)
def setup_qualifies(m, idx, price):
return 0.10 <= price <= 0.85 # avoid extremes
setup_qualifies function वह जगह है जहाँ आपकी strategy रहती है। Wrapper सिर्फ plumbing है।





