{
  "nbformat": 4,
  "nbformat_minor": 5,
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# DepthFeed: inspect a synthetic sample\n",
        "Synthetic compatibility sample. Eight fixed, fabricated rows with demo identifiers and a 2000-01-01 UTC clock. No recorded market history. For schema and integration checks, not for evaluating coverage, liquidity, completeness or strategy performance. Purchased archive versions may have different schemas.\n",
        "Install pandas, pyarrow and matplotlib in your Python environment. The notebook reads only the local file; it makes no API requests. Change the path to a purchased file to inspect its actual schema.\n",
        "Timestamps are Unix milliseconds, displayed in UTC. Prices are fractions of a $1 contract. Size fields retain venue-native quantities. Level changes are updates, not a trade tape."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {},
      "outputs": [],
      "source": [
        "import pandas as pd\n",
        "import pyarrow.parquet as pq\n",
        "import matplotlib.pyplot as plt\n",
        "\n",
        "# Place the downloaded file beside this notebook.\n",
        "df = pq.read_table(\"kalshi-book.parquet\").to_pandas()\n",
        "print(df.dtypes)\n",
        "display(df.head())\n",
        "\n",
        "# All observations in this sample are fabricated.\n",
        "time = pd.to_datetime(df[\"recv_ts_ms\"], unit=\"ms\", utc=True)\n",
        "price = df[\"yes_prices\"].apply(lambda levels: max(levels, default=float(\"nan\")))\n",
        "plt.plot(time, price, marker=\"o\")\n",
        "plt.title(\"Synthetic sample - format demonstration only\")\n",
        "plt.ylabel(\"Price, fraction of $1\")\n",
        "plt.xlabel(\"UTC\")\n",
        "plt.xticks(rotation=30)\n",
        "plt.tight_layout()"
      ]
    }
  ]
}
