How I Backfill Missing Settlement Data from the Kalshi API

The Kalshi /portfolio/settlements endpoint, why settled trades go missing in the local DB, and the Python backfill script I use to reconcile everything.