Polymarket Bot Tutorial · Chapter 16 of 32

Polymarket-এ statistical arbitrage: cross-market pairs (correlated events), Polymarket-vs-Kalshi spreads, mean reversion, এবং বাজার শেষ পর্যন্ত resolve হলে stat-arb positions কীভাবে size করতে হয়।

এই chapter-এ কী covered আছে

Polymarket-এ statistical arbitrage correlated markets-এর মধ্যে transient mispricing কাজে লাগায় - একই event Polymarket বনাম Kalshi-তে, অথবা Polymarket-এর ভেতরে সম্পর্কিত markets-এ। edges ছোট (সাধারণত 1-3 cents) এবং operationally fragile। এই chapter-এ কী কাজ করে, কী কাজ করে না, আর multi-leg execution risk যা বেশিরভাগ attempt-কে ধ্বংস করে - সবকিছুর honest breakdown আছে।

Cross-market statistical arbitrage Polymarket এবং Kalshi, Polymarket এবং Manifold, বা Polymarket-এর ভেতরে correlated markets-এর মধ্যে transient pricing inconsistencies কাজে লাগায়। edges ছোট (সাধারণত 1-3 cents) এবং দুই leg-এ দ্রুত execution দরকার। এই chapter-এ operational complexity-সহ honest playbook আছে, যা বেশিরভাগ attempt-কে ব্যর্থ করে।

  • prediction markets-এ stat-arb কী বোঝায়
  • Polymarket-vs-Kalshi spread-এর examples
  • Polymarket-এর ভেতরে pairs (correlated events)
  • Mean reversion বনাম trend continuation
  • Resolving (not perpetual) markets-এর জন্য sizing
  • Risk: resolution-এর পরেও divergence
  • Code: pairs monitor এবং threshold-trigger

prediction markets-এ stat-arb কী বোঝায়

Prediction markets-এ statistical arbitrage মানে এমন দুইটি market-এর spread trade করা, যেগুলো consistently priced হওয়া উচিত। Polymarket-এ তিনটি flavor সাধারণ।

  • Cross-venue: Polymarket এবং Kalshi-তে একই event (অথবা Manifold, PredictIt)। Pricing converge করা উচিত; বাস্তবে 2-5 cents drift করে।
  • Same-event-pair: NegRisk multi-outcome markets-এ parent বনাম legs-এর যোগফল। Sum-to-1 invariant legs-এর যোগ 1.0-এর নিচে হলে arb করার সুযোগ দেয়।
  • Correlated-event-pair: সম্পর্কিত outcome-সম্পন্ন দুইটি market (যেমন, "Trump president on Jan 1" বনাম "Trump president on Mar 1")। একে অপরের 2-3 cents-এর মধ্যে price হওয়ার কথা।

edges ছোট। operational complexity বাস্তব। বেশিরভাগ attempt theory-তে নয়, execution-এ মারা যায়।

Polymarket-vs-Kalshi spread-এর examples

2025-26-এর observation অনুযায়ী, Polymarket এবং Kalshi একই major US event list করে কিন্তু steady basis-এ 1-4 cents apart price করে। এই gap structural কারণে থাকে, আর যেকোনো arb-এ আপনাকে এটা model করতে হবে।

Structural drivers:

  • Fee asymmetry: Kalshi winning trades-এ 4-7% নেয় (market ভেদে পরিবর্তিত হয়); Polymarket-এর taker fee 0। arb math-এ Kalshi-এর bite net out করতে হবে।
  • Settlement risk premium: কোনো market-এর resolution ambiguous হলে, এক venue-এর UMA অন্যটির judges-এর তুলনায় আলাদা ভাবে resolve করতে পারে। বাজার এটা price-in করে।
  • Trader population: Polymarket তুলনামূলকভাবে younger এবং বেশি crypto-native; Kalshi professional / hedge trend করে। একই event-এ তারা systematicভাবে disagree করে।

Gap structural premium এবং fees-এর চেয়ে বড় হলে arb কাজ করে। যেখানে structural premium 1c এবং combined fees 1c, সেখানে 5-cent gap মানে 3c-এর real edge।

Polymarket-এর ভেতরে pairs (correlated events)

Polymarket-এর ভেতরে correlated-event pair cross-venue-এর তুলনায় arb করা সহজ। একই fee structure, same wallet, atomic execution সম্ভব।

যেসব example ধারাবাহিকভাবে inconsistently price হয়:

  • Trump president on date A বনাম Trump president on date B (যেখানে B, A-এর চেয়ে 90 দিনের কম পরের)।
  • Will Bitcoin hit $100k by July 31 বনাম $100k by August 31।
  • একই binary market-এ Yes বনাম No leg (sum = 1.0 হওয়া উচিত; thin books-এ কখনও 1.04 পর্যন্ত drift করে)।

Yes+No=1 arb সবচেয়ে clean: same market-এর দুই leg পড়ুন, sum 0.97-এর নিচে নামলে দুটিতেই FOK fire করুন (spread tax ধরার জন্য)। Capital required প্রায় দুই leg-এ সমান; উভয় fill একই response-এ এলে execution atomic হয়।

Mean reversion বনাম trend continuation

Stat-arb-এর দুইটি regime। Mean reversion: pair noise-এর কারণে আলাদা হয়ে গেছে; আপনি convergence-এ bet করছেন। Trend continuation: নতুন information এসেছে বলে pair diverge করতে শুরু করেছে; আপনি আরও divergence-এ bet করছেন।

এগুলো আলাদা করা কঠিন। Heuristic: divergence যদি visible volume-এ ঘটে থাকে (একটা whale এক leg-এর book সরিয়ে দিয়েছে), তাহলে সেটা news - আপনার model থাকলে তবেই fade করুন। ধীরে ধীরে low volume-এ drift করলে সেটা noise - confidence নিয়ে reversion trade করুন।

নতুন builder-দের জন্য: শুধু mean reversion trade করুন, এমন pair-এ যেখানে divergence historical drift-এর 1 standard deviation-এর কম। Trend continuation-এর জন্য এমন model দরকার যা news ধরতে পারে; সেটা না থাকলে আপনি informed flow-এর বিপক্ষে trade করছেন।

Resolving (not perpetual) markets-এর জন্য sizing

Prediction markets resolve হয়। Crypto pair-এ তা নয়। এটা math বদলে দেয়।

Polymarket-এ pair-arb position-এর payout schedule fixed: যখন দুটো market resolve হয়, predicted spread আর actual spread-এর পার্থক্য lock হয়ে যায়। এখানে rolling নেই, infinite holding-ও নেই।

Sizing implication: আপনি সর্বোচ্চ যত hold করতে পারবেন, তা time-to-resolution দ্বারা bounded, কারণ capital ততক্ষণ lock থাকে। 6 মাসে resolve হওয়া কোনো pair আপনাকে share-প্রতি 3c দিতে পারে, কিন্তু ততক্ষণে অন্যত্র capital কাজে লাগাতে পারবেন না যদি দুই market-ই fully sized হয়।

সঠিক framing: Polymarket-এ stat-arb হলো bounded-time trades-এর একটি series, continuous strategy নয়। Gross PnL নয়, বরং locked capital per day-এ PnL তুলনা করুন।

Risk: resolution-এর পরেও divergence

সবচেয়ে খারাপ stat-arb outcome হলো আপনার convergence prediction ভুল, কারণ underlying premise-টাই ভুল ছিল। Example:

  • আপনি "Trump president on Apr 1" short করেছিলেন, ভেবে যে এটা "Trump president on Mar 1"-এর দিকে converge করবে - কিন্তু March impeachment-এর কারণে date 1 market YES resolve করে এবং date 2 market NO resolve করে। আপনার "spread flat হওয়া উচিত" thesis ভুল ছিল।
  • আপনি একই NBA Finals winner-এ Polymarket বনাম Kalshi arb করেছিলেন। Polymarket official series-এ যে team জিতেছে, সেটিতে resolve করে; Kalshi slightly different definition ব্যবহার করে যেখানে overtime tie-breakers আলাদা ভাবে ধরা হয়। উভয়ই তাদের stated terms অনুযায়ী YES resolve করে, কিন্তু opposite directions-এ।

প্রতিটি market-এর resolution criteria খুব মনোযোগ দিয়ে পড়ুন। Cross-venue arb-এ resolution mismatch-এর এক ধাপ দূরত্ব মানে দুই leg-এই full loss।

Code: pairs monitor এবং threshold-trigger

Reference: দুইটি correlated token monitor করুন, spread threshold ছুঁলেই arb fire করুন।

def pairs_monitor(token_a, token_b, threshold_cents=3, size=10):
    """Buy A and Sell B when (1 - ask_A) + bid_B > 1 + threshold."""
    while True:
        book_a = fetch_book(token_a)
        book_b = fetch_book(token_b)
        if not (book_a.best_ask and book_b.best_bid):
            time.sleep(2); continue
        # implied: cost of buying A at ask + value of selling B at bid
        edge = (1 - book_a.best_ask) + book_b.best_bid - 1
        if edge > threshold_cents / 100:
            print(f"ARB edge={edge:.3f}; firing")
            r_a = fok_buy(token_a, price=book_a.best_ask, size=size)
            if r_a.status != "matched": continue
            r_b = fok_sell(token_b, price=book_b.best_bid, size=size)
            if r_b.status != "matched":
                # leg A filled, B failed -- unhedged, exit A
                fok_sell(token_a, price=book_a.best_bid, size=size)
        time.sleep(3)

Partial fill হলে cleanup করা critical। এটা না করলে partial execution bot-কে directional exposure-এ ফেলে, যা stat-arb-এর পুরো উদ্দেশ্যের ঠিক বিপরীত।

প্রায়শই জিজ্ঞাসিত প্রশ্ন

Can I arbitrage between Polymarket and Kalshi?
Yes, when the same event trades on both. Spreads of 2-5 cents persist between the two exchanges because of regulatory differences, fee structures, and audience differences. The catch: Kalshi is US-only and KYC-gated, so you need accounts on both - check our /guide/polymarket-vs-kalshi/ for setup. The spread arbitrage is real but operationally heavy.
What is a pairs trade in Polymarket context?
Two correlated markets where the price ratio mean-reverts. Example: "Trump wins 2028" and "Republicans win 2028 House" - if Trump trade jumps 5% but the House trade has not moved, the bot buys House and sells Trump (or vice versa) on the assumption the ratio reverts. Edge is small but consistent in liquid politics markets.
How do you size a stat-arb position when both markets resolve?
Size to your largest expected divergence - if your model says the spread can drift 8 cents wider before reverting, size such that 8 cents wider does not exceed your loss limit. Treat each pair as an independent trade with a hard loss limit. Stat-arb pretending to be free money is how accounts blow up.
Is the Polymarket-Kalshi arb persistent?
Yes, but it is shrinking as more bots discover it. Through 2026 we still see 1-3 cent spreads on liquid politics markets persist for hours. Sports markets see narrower spreads. Tail markets (low-volume) see wider but uneconomical-to-trade spreads.
What if both markets diverge through resolution?
The pairs trade goes to its full PnL based on the actual outcomes - which is why pairs trading on prediction markets is fundamentally bounded (unlike perpetuals where divergence can grow forever). Net loss on a pairs trade is capped at the price difference at entry, not infinite.
What tools help find Polymarket pairs?
A correlation matrix across active markets is the starting point. Build it from 30-day price histories pulled from gamma+CLOB. Look for pairs with rho > 0.7 historically that are currently mispriced relative to their typical ratio. Update the matrix weekly - correlations decay.