{
  "sources": [
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "- when a competitor order is fully filled, a replacement order appears at the\n  start of the next step on the opposite side offset by `spread_ticks`"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "- highest bid matches first\n- lowest ask matches first\n- same-price orders are FIFO\n- resting orders remain until filled or cancelled"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "- participant starts with `$1000`, `0` YES, and `0` NO\n- resting bids reserve `price * quantity` cash\n- uncovered resting asks reserve `(1 - price) * quantity` cash"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "Prices are integer percentage ticks:\n\n- `price_ticks in {1, 2, ..., 99}`\n- economic price = `price_ticks / 100`"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/docs/orderbook_prediction_market_challenge.md",
      "quote": "- participant buys `q` at price `x`: `edge = q * (p_t - x)`\n- participant sells `q` at price `x`: `edge = q * (x - p_t)`"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/market.py",
      "quote": "        if side is Side.SELL:\n            return min(candidates, key=lambda order: (order.price_ticks, order.sequence))\n        return max(candidates, key=lambda order: (order.price_ticks, -order.sequence))"
    },
    {
      "url": "https://raw.githubusercontent.com/danrobinson/prediction-market-challenge/b244530ee2a6247b5f930830eeca9dd950da0e7e/orderbook_pm_challenge/engine.py",
      "quote": "                process.step()\n                probability = process.current_true_probability()\n\n                step_fills = []\n                step_fills.extend(market.execute_arbitrage(probability=probability, step=step))"
    },
    {
      "url": "https://api.imd.fun/artifacts/ecbc9087b4f238fc1b5b0d52f55af073f676c038bfb6756172b1e51480ac1741",
      "quote": "\"code_sha256\": \"baef955ec10728839f7c3357016ec9eb0550e7ec689bbd5171b1cdd5c9e37273\""
    }
  ]
}
