polybot

Architecture

Polymarket vs Kalshi: multi-venue architecture in polybot

Two prediction markets, two totally different technical stacks. How polybot abstracts them behind a single venue interface — and what leaks through anyway.

Published Apr 13, 2026


Polymarket and Kalshi are both prediction markets. From a trader’s perspective, they’re similar. From a software perspective, they are entirely different species. This guide walks through what polybot’s venue abstraction looks like, and where the abstraction intentionally leaks.

The two stacks, side by side

PolymarketKalshi
Venue typeOn-chain CLOB (Polygon)Centralised exchange
CollateralUSDC on PolygonUSD from bank account
AuthEIP-712 signed messages, proxy walletAPI key + HMAC
Market discoveryGraphQL + on-chain eventsREST + FIX-adjacent API
Order submissionSigned payload to py-clob-client → CLOBPOST to /v2/orders
Cancel semanticsOn-chain transaction (or soft cancel)REST DELETE
Fill notificationsWebSocket + EVM event logsWebSocket only
FeesZero maker/taker; gas on cancelTiered fee schedule
ResolutionOracle (UMA optimistic)Kalshi-run resolution committee
RegulationRestricted in US; DEX legally elsewhereCFTC-regulated

The BaseVenue interface

polybot’s unification point is src/polybot/venues/base.py. The interface is deliberately small:

class BaseVenue(Protocol):
    async def list_markets(self, filters: MarketFilters) -> list[Market]: ...
    async def get_market(self, market_id: str) -> Market: ...
    async def subscribe_book(self, market_id: str) -> AsyncIterator[BookUpdate]: ...
    async def submit_order(self, order: Order) -> OrderAck: ...
    async def cancel_order(self, order_id: str) -> CancelAck: ...
    async def positions(self) -> list[Position]: ...
    async def balance(self) -> Balance: ...

Strategies never import polymarket.py or kalshi.py. They take a BaseVenue and call its methods.

Where the abstraction holds

Where the abstraction leaks

Unified risk across venues

The risk service in src/polybot/services/risk.py aggregates exposure across venues with per-venue USD-equivalent translation. Key invariants:

What this lets you actually do

With a single polybot start, you can run:

all under one risk budget, with one dashboard, one MCP server. The abstraction’s job is to make that configuration boring. Mostly, it does.

Lessons for your own multi-venue system

Need an agent system built like this?

Cryptuon builds production AI agents, MCP integrations, and trading systems. polybot is our open-source showcase.