Dev
Fee-aware backtester for prediction-market strategies (no live trading)
The brief
We want to test prediction-market ideas honestly before any money is at risk. Most backtests flatter a strategy by ignoring fees, spreads and the fact that you cannot trade at the last price. Deliver a Python backtester (in a GitHub repo we create for you) that: 1. Replays historical prices and trades for event contracts from a local archive (Parquet or SQLite; we provide the schema). 2. Takes a strategy as a plain Python function that sees only data available at that moment, enforced so it cannot peek ahead. 3. Fills orders against the recorded spread with a configurable slippage model, applies Kalshi's published fee formula, and settles positions at the official result. 4. Enforces position and loss limits we set. 5. Reports P&L, number of trades, fees paid, maximum drawdown, and the strategy's Brier score against the market's. 6. Includes tests with hand-calculated expected results, including a lookahead test that must fail if a strategy reads future data, and two example strategies (always-follow-the-market and a deliberately cheating one that the guard catches). Rules: simulation only. No connection to any exchange account, no order-sending code, no credentials.
Acceptance criteria
1) The lookahead guard makes the cheating example fail. 2) Fees match the published formula on hand-checked cases. 3) Fills use the recorded spread, not the last price. 4) Limits are enforced. 5) Tests with known answers pass in CI. 6) No exchange or order code anywhere.