Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/quickstart-trading
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Quickstart Trading Guide

This guide shows how to place a simple trade using the Kalshi Python SDK.

## Setup

1. Install dependencies: `pip install kalshi-python`.
2. Set the `KALSHI_API_KEY_ID` and `KALSHI_PRIVATE_KEY_PATH` environment variables.

## Placing an order

```python
from kalshi_python import KalshiClient, Configuration

cfg = Configuration(host="https://api.kalshi.com/trade-api/v2")
cfg.api_key_id = "YOUR_API_KEY_ID"
with open("path/to/private_key.pem", "r") as f:
cfg.private_key_pem = f.read()

client = KalshiClient(cfg)
order = client.trader_api.create_order(
ticker="YES-EXAMPLE",
order_type="market",
side="buy",
size=1
)
print(order)