> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kairos.trade/llms.txt
> Use this file to discover all available pages before exploring further.

# Routing across venues

> How an order picks its venue, how to find the same question on several venues, and how to choose between them: readiness, funds, price, fees and rules.

The same question is often listed on Polymarket, Predict.fun and Hyperliquid at once. The Partner API trades all three with one integration, so you choose the venue for each order.

## How an order picks its venue

The venue is part of the market id:

| Market id | Venue |
| - | - |
| `polymarket:0x<64 hex>`, or a bare `0x<64 hex>` condition id | Polymarket |
| `predictfun:<digits>` | Predict.fun |
| `hyperliquid:<digits>` | Hyperliquid |

Each order goes to exactly the venue its market names. Kairos doesn't split an order across venues or move it to another venue. To trade one question on two venues, place two orders. Each is its own action with its own signature, fills and `orderId`.

## Find the same question on other venues

`GET https://data.kairos.trade/market-clusters` maps a market to its equivalents on other venues. It is public and needs no key. Use `floor=exact` for markets that settle on the same contract terms.

`markets` takes `<provider_id>:<market_id>` pairs. Provider `2` is Polymarket, `8` is Predict.fun and `9` is Hyperliquid; `market_id` is the market's id in the [market data API](https://docs.kairos.trade/wallets/markets.md).

```bash theme={null}
curl "https://data.kairos.trade/market-clusters?markets=9:19168&floor=exact"
```

```json theme={null}
{
  "clusters": {
    "9:19168": {
      "members": [
        { "provider_id": 1, "provider": "kalshi",      "market_id": "KXBUNDESLIGAGAME-26OCT31BMUBVB-BMU", "title": "Bayern Munich wins" },
        { "provider_id": 2, "provider": "polymarket",  "market_id": "5852478", "title": "Will FC Bayern München win on 2026-10-31?" },
        { "provider_id": 8, "provider": "predictfun",  "market_id": "3481439", "title": "Will FC Bayern München win on 2026-10-31?" },
        { "provider_id": 9, "provider": "hyperliquid", "market_id": "19168",   "title": "Bundesliga Matchday 8: FC Bayern Munich v Borussia Dortmund: FC Bayern Munich" }
      ]
    }
  }
}
```

Turn each member into a Partner API market id:

| `provider` | Market id for an order |
| - | - |
| `polymarket` | `polymarket:` + `condition_id` from `GET https://md.kairos.trade/v1/markets/polymarket/{market_id}`. The cluster's `market_id` and `ticker` are not the condition id |
| `predictfun` | `predictfun:{market_id}` |
| `hyperliquid` | `hyperliquid:{market_id}` |
| Any other provider | Not traded through the Partner API. Skip it |

Outcome names differ between venues: the same result can be `Yes` on one venue and a team or player name on another. Read each market's `outcomes` and pick the one that means the same result before you treat two orders as the same trade. See [matched markets](https://docs.kairos.trade/rest/matched-markets.md) for the full catalog, the similarity rules and the live spread feed.

## Choose a venue

Check these in order. The first three rule venues out; the last two rank what's left.

**1. The venue is available**

Wallet status lists every venue offered to you. A venue that is `available: false`, or missing from `venues`, can't take orders right now. See [availability](https://docs.kairos.trade/wallets/venues.md#availability).

**2. The wallet can trade there**

`venues.{venue}.ready` is `true`, or `venues.{venue}.next` is `"setup"` and the user is happy to sign setup first. `"wait"` rules the venue out for a few seconds; `"fund"` and `"blocked"` rule it out until the user acts. See [readiness](https://docs.kairos.trade/wallets/setup.md#3-read-readiness).

**3. The wallet has the funds there**

Collateral is per venue: pUSD on Polygon for Polymarket, USDT on BNB Chain for Predict.fun, USDC in the Hyperliquid account. `venues.{venue}.balance` shows each. A buy needs `price × size` plus that venue's fees.

**4. The order fits the venue's rules**

Time in force, tick, lot size and minimums differ: for example Hyperliquid takes `GTC`, `FAK` and `IOC` only, whole shares, and buys of at least 10 USDC. See [venue rules](https://docs.kairos.trade/wallets/venues.md).

**5. Best all-in price**

Compare the price you'd get on each book for your size, plus each venue's fees: Polymarket's taker fee (charged on top, in pUSD), Predict.fun's `feeRateBps` (in the signed order), Hyperliquid's taker fee and any builder fee. Live books are on the [market data stream](https://docs.kairos.trade/websocket/market-data-websocket.md). Some Polymarket markets also hold taking orders for a short delay (`match_delay_ms`).

```bash HTTP theme={null}
curl "$BASE/v3/wallets/$WALLET" -H "X-Kairos-Partner-Id: $PARTNER" -H "X-Kairos-Wallet-Api: 2"
# Keep the venues where venues.<venue>.available is not false, ready is true,
# and balance covers price × size plus fees.
```

```python Python theme={null}
from kairos_wallet import api, WALLET

def venues_that_can_trade(markets_by_venue, price, size):
    """Venues where this wallet can buy `size` at `price` right now."""
    venues = api("GET", f"/v3/wallets/{WALLET}")["venues"]
    return [
        (venue, market) for venue, market in markets_by_venue.items()
        if (v := venues.get(venue)) and v.get("available") is not False and v["ready"]
        and float(v["balance"] or 0) >= float(price) * float(size)
    ]
```

```js JavaScript (SDK) theme={null}
// Venues where this wallet can buy `size` at `price` right now.
async function venuesThatCanTrade(wallet, marketsByVenue, price, size) {
  const status = await kairos.wallet.status(wallet)
  return Object.entries(marketsByVenue).filter(([venue]) => {
    const v = status.venues?.[venue]
    return v && v.available !== false && v.ready && Number(v.balance) >= Number(price) * Number(size)
  }).map(([venue, market]) => ({ venue, market }))
}
```

The balance check above leaves out fees, so treat it as a first filter. The order itself is refused if the venue account is short.

## Fall back when a venue fails

When an order fails on one venue, you can place it on the next one, as a new order with a new `clientOrderId`:

| Result | Was anything placed? | Fall back? |
| - | - | - |
| `NO_MATCH`, `VENUE_REJECTED`, `SIGNATURE_EXPIRED` | No | Yes |
| `503 <venue> is not available right now`, `403 API-key access to <venue> is disabled` | No | Yes |
| `final: true`, `success: false`, and `message` is `No fill: …` or `The order failed at the venue; …` | No, or its fills were reverted | Yes |
| `final: true` and `filledSize` below `size` (a `FAK` or `IOC` that partly filled) | Partly | Only for the unfilled rest |
| `ORDER_OUTCOME_UNKNOWN`, `message` `Outcome not confirmed yet; …`, or a `5xx` or timeout after signing | Maybe | **No.** Retry on the same venue with the same `clientOrderId` first: it returns the order if it was placed. Or read the wallet's orders there, not only open ones, since it may have filled. Otherwise you may end up with both |
| `final: false` and `success: true` (the order rests, or the venue is still matching it) | Yes | Cancel it first. Fall back only once the cancel lists it in `cancelled`, and only for what hadn't filled |

## Move funds to the venue

Each venue trades only from its own collateral, so routing to a venue needs funds there:

* **Ask the user to send funds** to the venue, as shown in [set up and fund a wallet](https://docs.kairos.trade/wallets/setup.md#2-fund-the-wallet).
* **Use a [funded trade plan](https://docs.kairos.trade/wallets/trade-plans.md)** (preview). One signed buy order that first bridges exactly the shortfall from the wallet's USDC on Polygon or Arbitrum, then trades.

## Manage orders across venues

Reads and cancels already span every venue:

* `GET /v3/wallets/{address}/orders` and `/positions` return every venue at once. Filter with `venue=` ([show orders and positions](https://docs.kairos.trade/wallets/portfolio.md)).
* One cancel signature cancels orders on any mix of venues, and `cancelAll` cancels everything ([cancel](https://docs.kairos.trade/wallets/trade.md#cancel)).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.