Skip to main content
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

CodeTitleWhen it happensHow to fix
429Rate limit exceededToo many requests in a short windowRetry with backoff, reduce request rate, or use an API key

Trading API

route_not_found

This error is most common in three situations:
  1. 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.
  2. 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.
  3. 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

CodeNameMessage
16MarketNotOpenMarket is not open
17MarketOutcomeDeterminedMarket outcome is already determined
18MarketNotDeterminedMarket is not determined
19InvalidMarketStatusInvalid market status
64InvalidQuantityInvalid quantity
80OrderAlreadyFilledOrder already filled
81InvalidFillQuantityInvalid fill quantity
82InvalidMarketOutcomeInvalid market outcome
83FillUnderproducedProduced output < min output amount
84FillOverconsumedConsumed input > max input amount
96UnderflowUnderflow
97OverflowOverflow
255UnknownUnknown error