{
  "sources": [
    {
      "url": "https://api.imd.fun/artifacts/f5a140f51df99423d6ede60b618dbc6eabc37a3050ac439c80dc3824191e9f59",
      "quote": "176f8115fb67d99340f1de1e6994042dfaa41f830c22e000595df3377cc6a2b3"
    },
    {
      "url": "https://api.imd.fun/artifacts/93cc15561f172c49c8bce174143333ede904fdbfcf51276cbbeb514d4f5b614e",
      "quote": "Taylor (gtmcknight): replica, Gaussian filter, qm tables (github.com/gtmcknight/amm-sim @4812a6382311624e1506aca131ca35c378f930d9, research/solved)"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/tell/fetch.sh",
      "quote": "#!/bin/sh\n# Fetch ../solved and this folder into ONE directory and check every file's sha256.\n# usage: sh fetch.sh <raw URL of research/ at a commit> [dir]        default dir: test/scratch/amm\n# This folder's README.md lands as TELL.md and its fetch.sh as fetch-tell.sh; ../solved keeps its names.\nset -eu\nB=$1; D=${2:-test/scratch/amm}\nmkdir -p \"$D/ref\"\nget() {\n  if command -v curl >/dev/null 2>&1;"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/SHA256SUMS",
      "quote": "fdf24c7aa2b604d770336a5783276da8ed4d50bca9dbcc02e98b4da58f608d26  calib_out_2048.json\n4bd79bfad7e6b6bb5471c72019e1c39b8fceaa880c05f4f98378a88823aaa1ce  clsdata.py\nf362ad97bf49dcc80312ced8f4785259445d615703c22d60bd7a0fc9b14f6578  dp.py\n27fa051b1dfc3a5da824596c59ed5140823049ab05fd18185a4ece1995d65df1  evalpol.py\nb1b374010c5afe28d27edb529e86bf3274d498f2e4f89aa5a71bf089b6c0de12  example_policy.py\n9d37"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/tell/SHA256SUMS",
      "quote": "58313183f81d5a0ba6a5e3454645bd3572c1fe5366694ad72242b7ad932a9714  README.md\n5c567e2dbfcb461e5fad98003c28a66e9c7e0d154e15c962742ffe61e82b8ea9  check.py\ne15046bbf222840e7f1b9fdbf6c151d7e6e3ae92580095d8012cbac6f3ae9628  fetch.sh\n10d22059f380d5abcf596ebd206c0b60aaf1eb67e08684d21016a6d99c180e6e  mirror.py\nad382c07e6c2b3a5a8055ea767e140b7461105f29dafee69b7c1766c90d0634f  tell_qm.json\n6e62a0e070d9778537e"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/replica2.py",
      "quote": "\"\"\"Pure-Python replica of benedictbrady/amm-challenge @6b6921f8 (engine.rs, cfmm.rs,\narbitrageur.rs, router.rs, retail.rs), written from the source for ceiling experiments.\nRNG streams differ from the Rust engine, so absolute scores move by the seed set;\ncompare policies paired on the same seeds.\n\nA policy gets a callback after every trade on its own pool (arb or retail), like afterSwap,\nplus an o"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/real.py",
      "quote": "\"\"\"Solved policy driven ONLY by what afterSwap sees (side, amounts, timestamp, reserves).\n\nFilter: Gaussian belief over ln p (mean, variance).\n  - new step: variance grows by sigma^2 a step; steps with no trade of ours truncate the belief to our no-arb interval\n  - first trade of a step: arb or retail by likelihood ratio. Arb => p is exact (post-trade spot through the fee in force).\n    Retail => "
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/evalpol.py",
      "quote": "\"\"\"Run a solved (dp.py) perfect-information policy on the pure-Python replica.\nusage: python3 -I evalpol.py <pol.json>[,<pol2.json>...] hold        seeds 10000..12047, paired vs the stored HA / old oracle table rows\n       python3 -I evalpol.py <pol.json> mid [n]                      midpoint parameters (lam .8, sigma 9.45, size 20) vs the DP's own value\n\"\"\"\nimport sys, os, math, json, time\nHERE ="
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/par.py",
      "quote": "\"\"\"Run tasks across processes; fall back to one process where a pool cannot start.\nPROCS=<n> sets the process count (default: every CPU; 1 = no pool).\"\"\"\nimport os\n\n\ndef pmap(fn, tasks):\n    tasks = list(tasks)\n    n = int(os.environ.get('PROCS', '0') or 0) or (os.cpu_count() or 1)\n    if n <= 1 or len(tasks) <= 1:\n        return [fn(t) for t in tasks]\n    try:\n        from multiprocessing import "
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/solved/run.py",
      "quote": "\"\"\"Score a policy on a range of replica seeds, showing it only what afterSwap shows a contract.\n\nusage: python3 -I run.py <policy> <seed0> <n> <out.json> [key=val ...]\n  policy   perfect            the solved policy with the true price and rival spot (not blind)\n           gauss              real.py's Gaussian filter      e.g. soft=1 qm=qm_k1e-5.json\n           lattice            latt.py's lattice"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/tell/tellpol.py",
      "quote": "\"\"\"The solved policy with the arbitrage test in place of its guess, on the replica, blind.\n\n  python3 -I run.py tellpol:TellPolicy 10000 2048 out.json soft=1 qm=qm_k1e-5.json\n  python3 -I pair.py out.json ref/gauss_qm.json        # +3.21: what the test adds to the policy the ports implement\n  python3 -I pair.py out.json ref/flag_qm.json         # -0.01: what is left to the true flag\n  python3 -I p"
    },
    {
      "url": "https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research/tell/tellref.py",
      "quote": "\"\"\"The arbitrage test in whole numbers only, as a contract has to do it.\n\nA contract's afterSwap is handed four integers a trade (amountX, amountY, reserveX, reserveY, each the\nengine's f64 times 1e18, truncated) and it knows two more things it can keep itself: the reserves its\nprevious callback was handed and the fees it returned then.  `is_arb` answers, from those alone, whether\nthe trade was th"
    }
  ]
}
