Kalshi’s clearinghouse has a weekly maintenance window on Thursdays from
3:00 AM to 5:00 AM ET. Orders submitted during this window will not be
cleared. The order will be reverted.
Your application should prevent users from submitting orders during this
window.
General HTTP errors
| Code | Title | When it happens | How to fix |
|---|
| 429 | Rate limit exceeded | Too many requests in a short window | Retry with backoff, reduce request rate, or use an API key |
Trading API
route_not_found
This error is most common in three situations:
-
Wrong
outputMint for prediction markets. If you are selling an outcome
token, outputMint must match the market’s settlement mint. We currently
support two settlement mints:
- USDC:
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
- CASH:
CASHx9KJUStyftLFWGvEVf59SGeG9sh5FfcnZMVPCASH
You can resolve this by using the settlement
mint listed in the market’s accounts object.
-
Incorrect
amount units. The amount parameter is the inputMint
amount in atomic units (scaled by decimals). If you pass standard
(human-readable) units (for example 8 instead of 8_000_000), the router will not find a viable route.
-
No liquidity at the top of book. For outcome tokens,
route_not_found
can mean there is no available bid/ask on the side the user wants to trade.
How to check
- Get the market for the outcome token:
GET https://dev-prediction-markets-api.dflow.net/api/v1/market/by-mint/{outcome_mint} (See Metadata API)
- Use your production Metadata API base URL in production.
- See which side the user is on:
- In the response, open the
accounts object and find the entry whose
yesMint or noMint equals the outcome mint.
- If it matches
yesMint, they are trading the YES outcome.
- If it matches
noMint, they are trading the NO outcome.
- Check the right bid or ask using the top-level fields from the same market response:
- Selling YES → check
yesBid. If it is null (or empty), there is no one to buy.
- Selling NO → check
noBid. If it is null (or empty), there is no one to buy.
- Buying YES → check
yesAsk. If it is null (or empty), no one is offering YES.
- Buying NO → check
noAsk. If it is null (or empty), no one is offering NO.
Prediction Markets IDL
| Code | Name | Message |
|---|
| 16 | MarketNotOpen | Market is not open |
| 17 | MarketOutcomeDetermined | Market outcome is already determined |
| 18 | MarketNotDetermined | Market is not determined |
| 19 | InvalidMarketStatus | Invalid market status |
| 64 | InvalidQuantity | Invalid quantity |
| 80 | OrderAlreadyFilled | Order already filled |
| 81 | InvalidFillQuantity | Invalid fill quantity |
| 82 | InvalidMarketOutcome | Invalid market outcome |
| 83 | FillUnderproduced | Produced output < min output amount |
| 84 | FillOverconsumed | Consumed input > max input amount |
| 96 | Underflow | Underflow |
| 97 | Overflow | Overflow |
| 255 | Unknown | Unknown error |