Skip to main content

Documentation Index

Fetch the complete documentation index at: https://pmxt.dev/docs/llms.txt

Use this file to discover all available pages before exploring further.

Three methods build on matching to answer pricing questions across venues.

compareMarketPrices

Side-by-side bid/ask for the same market on every venue. Under the hood this calls fetchMarketMatches with relation: "identity" and includePrices: true, then maps the results to a flat comparison.
import pmxt

router = pmxt.Router(pmxt_api_key="pmxt_live_...")

prices = router.compare_market_prices(market_id="d35bc8c6-...")

for p in prices:
    print(f"{p.venue:12s}  bid {p.best_bid:.2f}  ask {p.best_ask:.2f}")
polymarket    bid 0.60  ask 0.65
kalshi        bid 0.58  ask 0.63
limitless     bid 0.61  ask 0.66

Response shape

{
  "market": { "marketId": "...", "title": "..." },
  "relation": "identity",
  "confidence": 0.95,
  "reasoning": "Same resolution condition.",
  "bestBid": 0.60,
  "bestAsk": 0.65,
  "venue": "kalshi"
}

fetchRelatedMarkets

Find related markets across venues — markets whose resolution condition is a subset or superset of the target market.
related = router.fetch_related_markets(market_id="d35bc8c6-...")

for r in related:
    print(f"{r.relation:10s} {r.venue:12s}  {r.market.title}")
    print(f"           confidence {r.confidence:.0%}  bid {r.best_bid}  ask {r.best_ask}")
    print(f"           {r.reasoning}")
subset     kalshi        Will the nominee be from California?
           confidence 85%  bid 0.40  ask 0.45
           Narrower market — California origin implies Democratic candidacy.
superset   polymarket    Will a Democrat win the popular vote?
           confidence 72%  bid 0.70  ask 0.73
           Broader — popular vote does not guarantee election win.
Subset means A=YES implies B=YES but not vice versa. Superset is the reverse. See relation types for the full taxonomy.
fetchRelatedMarkets filters matches to subset and superset relations only. If you want all relations, use fetchMarketMatches directly.

fetchMatchedMarkets

Returns matched market pairs across venues with live pricing from each. The Router finds identity-matched markets on different venues and returns each pair with side-by-side data.
pairs = router.fetch_matched_markets(min_difference=0.03, category="Politics", limit=20)

for p in pairs:
    print(f"{p.market_a.title}")
    print(f"  {p.venue_a:12s} @ {p.price_a:.2f}")
    print(f"  {p.venue_b:12s} @ {p.price_b:.2f}")
Will BTC hit $100k by Dec 31?
  polymarket   @ 0.58
  kalshi       @ 0.63

Parameters

ParameterTypeDefaultNotes
minDifferencenumber0Minimum price difference between venues to include.
categorystringFilter both sides of the match by category.
limitinteger50Maximum number of matched pairs to return.
Results are sorted by price difference descending.

Response shape

{
  "marketA": { "marketId": "...", "title": "..." },
  "marketB": { "marketId": "...", "title": "..." },
  "priceDifference": 0.05,
  "venueA": "polymarket",
  "venueB": "kalshi",
  "priceA": 0.58,
  "priceB": 0.63,
  "reasoning": "Both markets ask whether BTC exceeds $100k by Dec 2026"
}

Composing with venue exchanges

The Router is read-only. To trade, use venue-specific exchange classes with the local SDK. A typical workflow:
import pmxt

router = pmxt.Router(pmxt_api_key="pmxt_live_...")
poly   = pmxt.Polymarket(private_key="0x...")

# 1. Browse matched markets across venues
pairs = router.fetch_matched_markets(category="Politics")

# 2. Inspect the order book on a specific venue
book = poly.fetch_order_book(market_id=pairs[0].market_a.market_id)

# 3. Place an order locally (never proxied through PMXT)
# poly.create_order(...)
Router returns the same unified schema as every other exchange, so marketId, outcomes, and all other fields work interchangeably.