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

# Auto-buy the Pick of the Day on Kalshi

> Set up the Kalshi trader with one command and answer its questions in your terminal.

Start [`potd-trader` v0.4.1](https://github.com/0xinsider/potd-trader/releases/tag/v0.4.1) with one command. It installs the trader, asks for missing information, guides your contract review, and runs a dry run. The 0xinsider signal remains Polymarket-backed; you review which Kalshi contract represents the same outcome.

## Start the setup

On macOS or Linux, including WSL, paste this into your terminal:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/0xinsider/potd-trader/v0.4.1/scripts/setup-kalshi.sh | sh
```

The installer downloads an isolated copy of `uv`, Python, the release, and its dependencies. It does not change your shell profile or global Python installation. The [release](https://github.com/0xinsider/potd-trader/releases/tag/v0.4.1) identifies the shipped source.

The wizard asks for:

* A setup folder, with `~/kalshi-potd-demo` as the default, and `demo` or `production` for a new setup. Start with demo.
* Your Pro or Max API key from [0xinsider.com/developers](https://0xinsider.com/developers) and the API key ID for your Kalshi account. Key inputs are hidden.
* The path to your downloaded Kalshi private PEM key. The wizard copies it into your private setup folder; you do not paste its contents.
* Your per-pick budget and UTC daily cap, defaulting to $5 and $25. Both include the conservative fee reserve described below.

Create your [Kalshi demo account](https://demo.kalshi.co/) and download its key using Kalshi's [API key instructions](https://docs.kalshi.com/getting_started/api_keys). Demo credentials are separate from production credentials. The [demo environment](https://docs.kalshi.com/getting_started/demo_env) uses mock funds, and its prices and market coverage can differ from production.

Use an RSA key of at least 2,048 bits or an Ed25519 key. Your private key stays local. Do not paste keys into chat, shell commands, or issues.

## Answer the review prompts

The wizard checks your Kalshi balance and current picks, then asks which Kalshi market ticker matches each unmapped pick. Enter a ticker, choose `yes` or `no`, and set your maximum purchase price. Press Enter at the ticker prompt to skip a pick.

It displays both contracts, their settlement rules, and the links to the official terms. Compare the game, backed team, date, overtime, cancellation, postponement, and tie rules. Matching team names alone is not enough.

Type `the same event, outcome and settlement rules` only when you have established equivalence. Changed source picks, rules, or official contract PDFs require another review. You can review a saved contract again in the same wizard.

Demo fixture listings without real settlement rules do not qualify.

The wizard then runs a dry run. With at least 1 reviewed current pick, it offers to enable orders and start a foreground watcher; trading stays stopped unless you choose that action and type the required confirmation. Demo uses `place demo orders`; production uses `spend real money on Kalshi`.

If no pick is released or no equivalent contract is available, keep the saved setup and rerun the same command later. The trader skips unmatched picks; it does not invent a mapping or calculate a Kalshi-native pick.

## Resume or stop

Run the same setup command again and choose your saved folder to resume a stopped setup. It reuses valid credentials and preserves account identity, mappings, and order reservations. If the trader is already installed, `potd-trader kalshi setup` opens the same wizard.

The installer adds a `trader` launcher to your setup folder. For the default demo folder:

```bash theme={null}
cd ~/kalshi-potd-demo
./trader status
./trader live off
```

The wizard disables new orders when its foreground watcher stops, including with `Ctrl+C`. If you start a watcher separately with `./trader watch`, stop it with `Ctrl+C`, then use `./trader live off` to keep future submissions stopped.

Stop existing watchers before rerunning setup or upgrading. Separate machines and copied folders do not share order reservations.

## Try a dry run

```bash theme={null}
./trader run --dry-run
./trader ledger
./trader watch --dry-run
```

A dry run reads the pick, mapping, market, and executable price. It does not submit an order, even if the local live setting is enabled. Use `Ctrl+C` to stop the watcher.

Only binary, \$1 contracts with default settlement bounds are supported. Combo contracts are skipped.

The trader buys whole contracts. It checks your destination price ceiling, available funds, and daily reservation limit before submission. A market with insufficient executable liquidity, a stale mapping, or missing safety data is skipped. Available account funds are checked again before a live submission.

Your destination ceiling is an additional limit. The trader applies the lowest of that ceiling, local `MAX_PRICE`, the source pick's `entry_authorization.max_entry_price`, and the source backed price plus local `MAX_SLIPPAGE_PCT`. These limits do not estimate a Kalshi return.

Before submission, the trader refuses reported positions or resting orders in the target Kalshi market. Kalshi's account reads can lag, and there is no atomic check that the market remains flat when an order arrives.

Use a dedicated Kalshi account and its default subaccount `0`, the only subaccount this release supports. Do not trade manually or run another trading tool on that account while this trader is active. The shared local ledger coordinates only instances of this tool.

The fee reserve is deliberately larger than an estimated trading fee: it adds $1.0001 per contract to cover possible rounding across split fills. Both principal and this reserve must fit within `STAKE_USD`, so a $5 setup can buy fewer contracts than you expect from the market price alone. Unsupported or missing fee data prevents submission.

Use API credentials for your own Kalshi account. Broker accounts with external commissions are unsupported; those charges are not included in the exchange fee reserve.

## Enable demo orders later

If you left trading stopped in the wizard, you can enable demo orders from your setup folder:

```bash theme={null}
./trader live on
./trader run
./trader ledger
./trader reconcile
```

`live on` asks you to type `place demo orders` in a demo setup. Enable orders in your own terminal after reviewing the dry run. Demo orders use mock funds.

Each submission is an immediate-or-cancel order. It can fill partly, and the unfilled part does not remain as a resting order. An uncertain submission keeps its reservation and blocks a repeat order until reconciliation establishes its state.

A zero-fill submission response without a complete terminal order record also stays reserved. `reconcile` must establish that the order cannot fill before the reservation is released.

## Stop and reconcile

```bash theme={null}
./trader live off
./trader live status
./trader reconcile
./trader ledger
```

`live off` writes a persistent `HALT` file and prevents new submissions from watchers using the same folder. An order already sent can still fill. `reconcile` reads provider order state; it does not submit a replacement order. Incomplete records or mismatched identity, outcome, price, or fee bounds keep the entry unresolved.

Orders and reservations are stored in `kalshi-ledger.json`. Keep uncertain entries in the ledger. Do not delete a ledger, mapping, or lock file while a process is running.

All instances using the same Kalshi account must use one shared setup folder on one local filesystem. Once a ledger exists, changing its environment, account identity, or file paths stops trading until you restore the original setup.

## Use a separate production setup

Run the setup command again, choose a new folder, and select `production`. Add credentials for a dedicated production account and review its contracts in the wizard. Demo mappings and ledger entries do not transfer to production.

The new folder starts with orders disabled. If you choose to enable production orders, type `spend real money on Kalshi` in your own terminal.

Production orders spend real funds. Kalshi's account and regional eligibility requirements apply. The tool does not guarantee profit or that a Kalshi contract exists for every pick.

## Settings and spending limits

The Kalshi workflow loads `.env.kalshi` from the active folder. Inherited environment variables do not override its settings. Keep Kalshi and Polymarket setups separate.

| Variable | Default | Meaning |
| - | - | - |
| `KALSHI_ENVIRONMENT` | `demo` | The Kalshi environment for this folder. |
| `LIVE` | `no` | Orders stay disabled until you enable them locally. |
| `STAKE_USD` | `5` | The per-pick budget includes principal and the conservative fee reserve. |
| `MAX_PRICE` | `0.925` | This local price ceiling also limits every mapped contract. |
| `MAX_SLIPPAGE_PCT` | `3` | The destination price cannot exceed the source backed price by more than this percentage. |
| `KICKOFF_BUFFER_MINUTES` | `5` | Submission stops this many minutes before verified kickoff or source authorization expiry. |
| `DAILY_CAP_USD` | `25` | The UTC limit includes principal and worst-case reserved fees. |
| `KALSHI_API_KEY_ID` | Empty | The API key ID for your own account. |
| `KALSHI_PRIVATE_KEY_PATH` | Empty | Your local private PEM file. |

The ledger reserves spending before submission. Uncertain orders keep consuming budget until reconciliation proves what happened, including across a UTC date change.

A confirmed fill keeps the full original reservation against its UTC submission day, including a partial fill. A confirmed zero-fill terminal order releases its reservation. Separate folder copies do not coordinate this limit.

## What leaves your machine

| Destination | Data and purpose |
| - | - |
| `api.0xinsider.com` | Your 0xinsider API key, to read the current picks. |
| `external-api.demo.kalshi.co` or `external-api.kalshi.com` | Your key ID, signed authentication headers, market tickers, and order details, for the selected environment's account reads and order submission. |
| `gamma-api.polymarket.com` | Source token IDs, to verify the mapped Polymarket contract. |
| `assets.kalshi.com` | Official contract PDF reads, to verify the reviewed settlement terms. |

Your PEM private key stays local and signs authenticated Kalshi requests. Package installation also contacts package hosts. See the [trader repository](https://github.com/0xinsider/potd-trader) for source, release verification, and the complete command reference.


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