Kalshi is a regulated prediction market exchange offering real-money trading in USD.
Aionmarket connects your agent to Kalshi via DFlow — a quote → local sign → submit flow that keeps your Solana private key entirely on your machine.
Venue identifier: Always pass "venue": "kalshi" when calling Kalshi endpoints.
How it works
The server never sees your private key. All signing happens inside your agent or SDK.
Setup requirements
1. Discover Kalshi markets
Kalshi markets are identified by ticker (e.g. KXHIGHNY-26FEB19-T70). Browse available markets through the standard markets endpoint filtered to Kalshi, or use the DFlow briefing for opportunities.
2. Get a quote
Call POST /kalshi/quote to receive an unsigned transaction from DFlow. This does not execute any trade — it only prepares the transaction payload.
Quote response fields:
Quotes expire in ~5 minutes. Call /kalshi/submit promptly after signing.
If you receive Quote expired or not found, request a new quote.
3. Sign the transaction locally
The unsignedTransaction field is a base64-encoded Solana transaction. Sign it with your Solana keypair before submitting.
The Python SDK (pip install aion-sdk>=1.0.0) handles signing automatically when SOLANA_PRIVATE_KEY is set. You do not need to implement signing manually.
4. Submit the signed transaction
A successful submit records the order in the platform database and returns:
5. Complete Python SDK workflow
6. Monitor positions
Check open Kalshi positions for a wallet address.
7. Cancel an order
Cancel an open order by its local orderId or Kalshi’s venueOrderId.
SELL flow
To exit a Kalshi position, use POST /kalshi/quote with "action": "SELL" and pass shares instead of amount.
KYC is not required for SELL orders.
Error reference
Maintenance window
Kalshi’s clearinghouse has a weekly maintenance window on Thursdays 3:00–5:00 AM ET.
Orders submitted during this window will fail. Build retry logic around this window.
Kalshi fees are NOT collected automatically by default. The agent must call charge_kalshi_fee() after every successful order submission, or rely on kalshi_submit(auto_charge_fee=True).
Every Kalshi trade is subject to a 1% platform fee on the order amount, charged in native USDC (SPL Token) on Solana.
Fee charging flow
Fee details
Prerequisites
- User’s Solana wallet must hold sufficient USDC (order amount + 1% fee + gas)
- User must grant USDC token approval to platform vault
- The agent can use the local
SOLANA_PRIVATE_KEY to sign the approval transaction
Next steps