{
  "sources": [
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/retail.py",
      "quote": "        sigma = max(0.01, self._config.size_sigma)\n        mean = max(0.01, self._config.mean_notional)\n        mu_ln = math.log(mean) - 0.5 * sigma * sigma"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/engine.py",
      "quote": "                            order.notional / max(probability, self._config.retail.sell_quantity_price_floor),"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/market.py",
      "quote": "        return min(candidates, key=lambda order: (order.price_ticks, order.sequence))"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/config.py",
      "quote": "    retail_arrival_rate_min: float = 0.154\n    retail_arrival_rate_max: float = 0.352\n    retail_mean_notional_min: float = 2.64\n    retail_mean_notional_max: float = 6.336"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/runner.py",
      "quote": "        config = sample_config(base, var, seed=seed)\n        engine = SimulationEngine(config, strategy_factory, seed=seed)\n        results.append(engine.run())"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/types.py",
      "quote": "    buy_filled_quantity: float\n    sell_filled_quantity: float\n    own_orders: tuple[OwnOrderView, ...]"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/process.py",
      "quote": "        diffusion_move = self._rng.gauss(0.0, self.config.diffusion_sigma)"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/loader.py",
      "quote": "    strategy_cls = getattr(module, \"Strategy\", None)"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/README.md",
      "quote": "FIFO limit order book for a binary `YES` contract."
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "1. Refresh competitor replenishments from the previous step.\n2. Call the participant strategy with current private state and the previous\n   step's aggregate fill totals.\n3. Apply participant cancels and new passive limit orders.\n4. Advance the latent process and compute the true probability `p_t`.\n5. Let the arbitrageur sweep stale quotes against `p_t`.\n6. Generate retail market orders and match them against the book."
    },
    {
      "url": "https://api.imd.fun/artifacts/04e37cd4e1a420b91cd7a012f416e6ebf1002c5c56867981741a3a77c72b9c48",
      "quote": "bde43171c0191751c603d429d3c46ce55bae11086c2826bbb386c9e7ad58c470"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/config.py",
      "quote": "    size_sigma: float = 1.2\n    buy_probability: float = 0.5\n    sell_quantity_price_floor: float = 0.05"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/market.py",
      "quote": "            max_quantity = quantize_down(remaining_cash / best_ask.price, self._config.share_quantum)"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/engine.py",
      "quote": "                step_fills.extend(market.execute_arbitrage(probability=probability, step=step))\n\n                for order in retail.generate_orders():"
    }
  ]
}
