From a297c6aceefa3a88cc8e093f8ee3e7bb2606f9cd Mon Sep 17 00:00:00 2001 From: Roy Jones Date: Mon, 15 Dec 2025 21:00:58 +0100 Subject: [PATCH 1/2] docs: add env.sample for kalshi starter Added env.sample file with an example set of environment variables for the starter code. --- env.sample | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 env.sample diff --git a/env.sample b/env.sample new file mode 100644 index 0000000..bfe0669 --- /dev/null +++ b/env.sample @@ -0,0 +1,8 @@ +# Example environment variables for kalshi-starter-code-python + +# API credentials for Kalshi +KALSHI_API_KEY=your_api_key_here +KALSHI_API_SECRET=your_api_secret_here + +# Environment: "demo" or "prod" +KALSHI_ENV=demo From f2618f3094c03a74a0cf650feb298036a442ca23 Mon Sep 17 00:00:00 2001 From: Roy Jones Date: Tue, 16 Dec 2025 13:19:04 +0100 Subject: [PATCH 2/2] docs: add notes on working with markets Adds MARKETS_NOTES.md with practical notes for working with markets when extending the starter code. --- MARKETS_NOTES.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 MARKETS_NOTES.md diff --git a/MARKETS_NOTES.md b/MARKETS_NOTES.md new file mode 100644 index 0000000..c738796 --- /dev/null +++ b/MARKETS_NOTES.md @@ -0,0 +1,40 @@ +# Markets Notes + +This file complements the main README by outlining a few practical +considerations when working with Kalshi markets from the starter code. + +## Environment + +Make sure your environment variables are set correctly: + +- `KALSHI_API_KEY` +- `KALSHI_API_SECRET` +- `KALSHI_ENV` (`demo` or `prod`) + +Use `check_env.py` to verify that everything is configured before +calling any market-related endpoints. + +## Pagination and filtering + +The Kalshi API may return paginated results. When you replace the +placeholder logic in `scripts/print_markets.py` with real API calls: + +- check whether the client or endpoint supports pagination parameters, +- avoid loading a very large number of markets in a single request. + +## Error handling + +When fetching markets: + +- handle network errors (timeouts, connection resets), +- handle authentication failures (invalid or expired credentials), +- log unexpected responses for debugging. + +## Demo vs production + +Always verify which environment you are targeting: + +- `KALSHI_ENV=demo` for testing, +- `KALSHI_ENV=prod` for live trading. + +Never reuse demo credentials in production or vice versa.