{"approach":"At spread 3 only, when the rival ask is at ticks 1 through 5, retain a same-price ask only if at least $20 of our identified FIFO-ahead quantity remains; otherwise quote one tick below the rival. The base retained priority with only two shares. This avoids spending a whole step with a tiny first-in-queue ask that a retail buy exhausts before spilling into the rival. Desired ask sizing, inventory rules and public probability estimator are retained. The sole trading-rule change is the priority threshold, max(2, 2000/competitor_ask_ticks) shares. A spread-3-only local binding of math.exp in the existing belief loop preserves operations and values; 200 full target-spread SimulationResults exactly matched the trading-rule-only version. Discovery screened 31 variants on the first 200 tuning seeds, then compared four mechanisms on the next 800. The $20 queue mechanism was selected at 2026-11-06T07:05:17.254029+00:00 using those first 1000; it then gained on the untouched last 954 tuning seeds. Code frozen at 2026-11-06T07:07:46.145141+00:00 before any candidate unseen evaluation. Simulator commit b244530ee2a6247b5f930830eeca9dd950da0e7e. Scorer check: CLI run ../base.py --simulations 4000 --seed-start 4000 --workers 4 --json from the official clone; no sandbox. Frozen candidate passed all stated gates: positive unseen mean-edge gain, zero failed simulations, 900 complete non-target SimulationResults identical, and measured one-process wall time no greater than the base. Retail audit on the first 200 tuning seeds, at true probability <0.05 when retail buys arrive, including all execution prices: mean arriving notional 152.56524637899003/run; base participant fills 142.63685499999974/run; competitor fills 9.921477500000002/run. At competitor fills with no main ask remaining, 8.909139/run had YES inventory >1 (size/no-quote proxy), 1.0123384999999998/run otherwise (stock proxy). Of competitor fills, 9.2693955/run initially found our main ask first; 0.652082/run arrived without a main ask. Share quantization leaves a small amount unspent. All discovery variants are gated by self.s == 3. All numbers are local simulator measurements, not leaderboard submissions. Arbitrage edge is signed. Paired SE is sample standard deviation of per-seed edge differences divided by sqrt(n). Defaults, 2000 steps, unsandboxed Python, official SimulationEngine with sample_config(ChallengeConfig(),ParameterVariance(),seed=seed), same as run_batch. No parameter selection used unseen results. Non-target tests use the first 300 seeds of each spread 1,2,4 scanning upward from 60000. Timing loads both factories once, warms both once, alternates order on 200 identical spread-3 unseen seeds in one process, and sums perf_counter around engine construction and run; configuration sampling and loading excluded. Standard library only. Seed lists selected with the official sampler follow. Tuning=[8003,8004,8008,8011,8015,8027,8031,8038,8046,8049,8055,8056,8060,8063,8067,8072,8081,8082,8090,8099,8107,8115,8120,8125,8132,8135,8136,8143,8145,8146,8147,8150,8157,8158,8161,8163,8165,8170,8172,8173,8187,8192,8202,8205,8208,8209,8210,8212,8223,8224,8240,8253,8260,8269,8276,8278,8279,8285,8286,8287,8290,8292,8296,8297,8302,8304,8306,8312,8313,8314,8318,8324,8327,8336,8337,8342,8350,8353,8358,8360,8367,8369,8373,8376,8386,8391,8392,8394,8395,8396,8399,8401,8405,8412,8413,8417,8420,8423,8427,8432,8434,8440,8456,8462,8466,8476,8477,8481,8482,8484,8488,8493,8495,8504,8506,8509,8518,8520,8525,8527,8528,8530,8542,8545,8549,8551,8568,8569,8574,8576,8578,8582,8584,8586,8587,8589,8594,8597,8601,8607,8610,8618,8625,8630,8639,8643,8646,8657,8661,8662,8667,8669,8670,8674,8681,8690,8692,8698,8701,8726,8727,8731,8732,8733,8734,8738,8742,8751,8757,8764,8765,8766,8768,8772,8773,8777,8786,8789,8791,8794,8798,8803,8809,8811,8812,8814,8821,8829,8830,8834,8846,8847,8848,8852,8856,8868,8873,8878,8879,8880,8882,8884,8887,8896,8907,8920,8921,8925,8926,8931,8932,8938,8940,8943,8948,8960,8965,8966,8969,8970,8971,8975,8979,8980,8983,8985,8987,8990,8994,8998,8999,9000,9001,9005,9010,9011,9015,9019,9021,9024,9027,9032,9033,9035,9039,9042,9048,9050,9060,9062,9064,9065,9068,9069,9073,9078,9081,9088,9090,9104,9107,9112,9115,9116,9117,9129,9130,9131,9137,9139,9140,9141,9143,9148,9157,9161,9165,9171,9173,9182,9183,9187,9191,9192,9194,9197,9200,9201,9207,9211,9216,9223,9224,9227,9230,9231,9236,9240,9241,9245,9246,9247,9251,9253,9256,9257,9258,9263,9267,9268,9269,9271,9283,9293,9296,9302,9304,9311,9319,9320,9328,9331,9336,9337,9340,9345,9346,9349,9351,9358,9363,9367,9369,9374,9379,9380,9381,9385,9386,9391,9428,9432,9433,9434,9436,9438,9439,9443,9448,9452,9458,9463,9464,9470,9471,9473,9481,9489,9491,9492,9499,9502,9504,9505,9509,9510,9511,9517,9523,9524,9526,9527,9532,9533,9535,9537,9541,9543,9549,9550,9557,9560,9566,9569,9573,9585,9586,9587,9593,9597,9601,9602,9603,9604,9611,9620,9621,9625,9626,9631,9637,9640,9641,9645,9646,9647,9655,9666,9672,9674,9682,9687,9695,9704,9705,9707,9708,9713,9715,9717,9722,9727,9728,9730,9741,9743,9746,9747,9749,9750,9751,9754,9758,9767,9769,9771,9786,9788,9798,9800,9801,9802,9803,9819,9821,9823,9825,9828,9829,9835,9846,9857,9861,9881,9888,9893,9900,9905,9906,9910,9913,9921,9925,9935,9936,9939,9948,9957,9969,9971,9975,9978,9979,9980,9981,9989,9991,9992,9996,9998,9999,10001,10012,10019,10022,10024,10025,10026,10028,10033,10038,10044,10046,10047,10056,10058,10059,10079,10080,10082,10085,10087,10088,10092,10094,10100,10102,10104,10105,10110,10113,10118,10120,10124,10126,10128,10129,10130,10134,10143,10147,10148,10163,10164,10165,10167,10168,10169,10171,10173,10174,10175,10184,10187,10193,10196,10200,10203,10204,10209,10212,10217,10227,10229,10231,10239,10240,10247,10249,10256,10259,10261,10265,10266,10267,10272,10276,10277,10279,10280,10282,10287,10303,10308,10315,10318,10323,10325,10331,10333,10334,10340,10345,10354,10356,10365,10368,10369,10370,10383,10385,10395,10396,10403,10409,10410,10413,10415,10417,10419,10430,10433,10434,10436,10441,10443,10444,10447,10449,10456,10459,10462,10463,10467,10470,10471,10491,10500,10502,10505,10508,10514,10518,10527,10535,10540,10542,10545,10552,10559,10562,10563,10567,10570,10578,10587,10589,10594,10595,10598,10605,10606,10612,10613,10616,10620,10621,10625,10626,10627,10637,10643,10652,10657,10659,10664,10665,10669,10676,10679,10687,10688,10689,10697,10699,10703,10706,10708,10717,10723,10730,10731,10737,10745,10747,10754,10755,10759,10764,10785,10786,10787,10788,10791,10797,10801,10802,10803,10805,10816,10817,10829,10837,10843,10845,10848,10861,10872,10875,10877,10881,10890,10894,10895,10897,10899,10900,10905,10915,10921,10926,10929,10931,10934,10948,10953,10954,10959,10963,10964,10966,10971,10973,10979,10982,10984,10985,10987,10994,10998,10999,11002,11004,11006,11009,11013,11023,11024,11026,11028,11029,11032,11045,11049,11051,11061,11064,11070,11071,11072,11073,11075,11078,11080,11084,11094,11103,11104,11107,11109,11123,11124,11128,11129,11146,11153,11156,11167,11172,11182,11186,11187,11188,11191,11192,11199,11200,11205,11206,11207,11212,11216,11226,11235,11243,11247,11251,11256,11277,11278,11280,11283,11289,11290,11292,11303,11308,11319,11320,11327,11330,11335,11337,11340,11343,11354,11356,11359,11360,11367,11374,11377,11382,11385,11386,11387,11388,11396,11397,11398,11399,11400,11403,11410,11413,11414,11415,11416,11419,11424,11427,11430,11434,11435,11441,11442,11444,11449,11458,11462,11463,11475,11476,11477,11487,11490,11494,11496,11497,11501,11505,11511,11517,11524,11525,11526,11528,11530,11532,11533,11536,11538,11546,11549,11550,11571,11576,11579,11588,11590,11591,11595,11597,11603,11607,11608,11612,11614,11616,11622,11631,11632,11637,11640,11645,11652,11672,11675,11676,11693,11696,11697,11699,11700,11704,11706,11709,11710,11713,11719,11722,11724,11728,11730,11732,11733,11734,11738,11744,11745,11746,11750,11751,11752,11753,11754,11755,11756,11759,11764,11772,11774,11775,11777,11784,11789,11806,11808,11810,11811,11814,11816,11821,11825,11833,11834,11842,11843,11847,11851,11855,11856,11859,11866,11868,11870,11871,11879,11888,11893,11898,11902,11904,11912,11923,11925,11928,11930,11934,11935,11936,11938,11944,11947,11950,11953,11959,11961,11969,11971,11972,11980,11981,11990,11994,11995,11997,12004,12006,12007,12009,12010,12017,12021,12022,12025,12036,12037,12041,12042,12043,12044,12045,12052,12054,12055,12061,12073,12076,12077,12081,12088,12097,12101,12104,12107,12108,12115,12130,12136,12138,12141,12144,12151,12155,12156,12161,12164,12165,12168,12169,12171,12173,12178,12184,12188,12189,12195,12198,12204,12208,12209,12211,12214,12227,12239,12254,12258,12263,12264,12278,12280,12282,12297,12311,12319,12323,12335,12336,12346,12352,12355,12363,12366,12367,12370,12375,12379,12380,12381,12392,12394,12397,12398,12400,12404,12415,12417,12420,12426,12432,12433,12437,12440,12443,12450,12458,12473,12474,12484,12488,12489,12491,12500,12505,12519,12523,12524,12534,12535,12539,12540,12543,12544,12551,12552,12556,12559,12563,12564,12565,12571,12573,12574,12575,12579,12584,12587,12588,12591,12592,12595,12597,12603,12606,12608,12614,12619,12620,12621,12624,12629,12631,12636,12642,12643,12644,12650,12653,12654,12667,12668,12680,12681,12686,12689,12692,12695,12706,12707,12711,12715,12722,12723,12725,12728,12739,12740,12744,12746,12752,12756,12758,12760,12764,12765,12769,12770,12773,12774,12781,12787,12789,12801,12803,12804,12808,12809,12810,12811,12813,12814,12817,12822,12824,12827,12834,12836,12839,12842,12845,12850,12851,12852,12853,12862,12867,12868,12869,12873,12880,12882,12883,12885,12886,12893,12894,12896,12900,12902,12907,12908,12911,12913,12921,12929,12931,12940,12943,12944,12946,12949,12954,12959,12961,12966,12967,12969,12993,12996,12997,13014,13018,13024,13026,13027,13032,13033,13035,13041,13045,13051,13054,13057,13061,13062,13073,13080,13088,13091,13101,13108,13111,13119,13122,13123,13125,13126,13129,13133,13134,13135,13148,13155,13158,13167,13175,13185,13189,13190,13200,13202,13208,13209,13210,13214,13218,13219,13221,13225,13239,13240,13243,13248,13254,13258,13259,13262,13267,13273,13278,13279,13282,13283,13288,13289,13293,13295,13308,13309,13311,13316,13326,13332,13335,13337,13338,13349,13352,13361,13370,13379,13384,13385,13387,13391,13394,13397,13398,13399,13400,13402,13406,13417,13422,13430,13436,13445,13448,13450,13455,13458,13460,13467,13469,13470,13473,13475,13479,13481,13482,13490,13495,13496,13498,13499,13507,13508,13510,13514,13516,13517,13520,13526,13532,13533,13537,13539,13546,13547,13571,13573,13575,13580,13581,13585,13592,13601,13607,13612,13614,13619,13622,13623,13626,13627,13629,13638,13640,13642,13643,13644,13645,13651,13653,13655,13660,13662,13664,13669,13670,13671,13674,13679,13681,13685,13689,13692,13694,13703,13705,13706,13709,13712,13713,13716,13719,13726,13728,13732,13734,13736,13738,13741,13752,13755,13757,13760,13764,13771,13783,13790,13792,13801,13803,13805,13806,13812,13817,13824,13828,13833,13834,13835,13836,13837,13840,13843,13845,13848,13850,13851,13853,13866,13868,13869,13871,13873,13875,13889,13895,13896,13898,13902,13903,13906,13908,13912,13915,13919,13923,13926,13927,13932,13938,13947,13949,13961,13962,13966,13968,13970,13973,13976,13978,13979,13980,13983,13994,13997,14001,14002,14006,14007,14008,14011,14014,14015,14018,14019,14021,14023,14028,14031,14032,14034,14035,14038,14042,14047,14048,14052,14054,14055,14056,14059,14061,14065,14066,14069,14074,14080,14081,14087,14094,14114,14120,14126,14140,14141,14146,14150,14152,14153,14154,14157,14160,14162,14173,14186,14188,14194,14197,14200,14203,14205,14212,14216,14218,14225,14233,14241,14243,14247,14253,14255,14261,14264,14272,14278,14280,14283,14284,14285,14287,14288,14291,14292,14300,14302,14310,14311,14314,14322,14323,14326,14328,14332,14343,14349,14351,14354,14355,14359,14364,14365,14367,14372,14373,14377,14378,14380,14382,14388,14392,14393,14394,14395,14399,14400,14406,14407,14413,14421,14422,14423,14425,14426,14437,14441,14444,14445,14446,14450,14454,14460,14467,14475,14482,14491,14505,14507,14517,14528,14529,14531,14535,14538,14544,14551,14559,14563,14564,14565,14568,14573,14574,14579,14582,14588,14593,14596,14601,14603,14606,14610,14616,14620,14625,14627,14629,14631,14635,14640,14653,14655,14656,14657,14671,14672,14675,14686,14688,14689,14694,14695,14703,14705,14707,14709,14716,14721,14722,14723,14724,14725,14729,14733,14737,14742,14754,14756,14761,14772,14774,14782,14784,14789,14793,14796,14800,14804,14827,14829,14831,14833,14835,14840,14842,14845,14854,14856,14857,14860,14863,14864,14866,14869,14885,14890,14898,14901,14902,14906,14909,14910,14911,14912,14916,14919,14923,14933,14943,14948,14957,14960,14961,14964,14969,14974,14980,14989,14990,14998,14999,15000,15005,15008,15009,15010,15018,15021,15022,15023,15026,15037,15039,15040,15041,15044,15045,15051,15059,15062,15071,15073,15076,15078,15085,15091,15092,15096,15104,15109,15119,15120,15124,15127,15144,15146,15150,15156,15161,15172,15176,15177,15182,15185,15194,15201,15204,15206,15211,15215,15217,15218,15223,15230,15234,15244,15245,15247,15253,15259,15263,15264,15265,15266,15267,15270,15276,15278,15280,15281,15282,15283,15286,15289,15292,15295,15296,15301,15302,15311,15313,15315,15320,15323,15334,15340,15349,15352,15361,15370,15373,15378,15379,15380,15381,15383,15388,15393,15395,15401,15405,15409,15422,15428,15436,15449,15457,15458,15460,15461,15462,15464,15470,15478,15481,15483,15484,15485,15488,15490,15492,15498,15499,15502,15506,15509,15513,15517,15519,15521,15522,15537,15540,15548,15555,15560,15561,15567,15578,15581,15582,15584,15587,15595,15597,15601,15602,15603,15604,15609,15610,15611,15613,15614,15615,15619,15623,15626,15627,15628,15629,15632,15641,15647,15654,15655,15657,15660,15666,15668,15669,15670,15678,15679,15682,15686,15688,15691,15694,15695,15697,15700,15703,15712,15723,15725,15726,15728,15730,15731,15744,15747,15748,15751,15761,15763,15766,15773,15780,15792,15799,15804,15808,15817,15818,15819,15821,15822,15824,15825,15834,15835,15845,15846,15850,15853,15854,15856,15867,15880,15887,15888,15894,15897,15900,15912,15918,15923,15929,15930,15932,15934,15936,15937,15940,15946,15953,15954,15955,15956,15958,15964,15969,15973,15974,15978,15979,15983,15985,15999]; unseen=[60000,60002,60003,60010,60011,60020,60024,60025,60026,60031,60033,60036,60038,60042,60046,60049,60052,60055,60058,60060,60063,60077,60084,60088,60097,60108,60109,60110,60114,60121,60135,60138,60139,60142,60144,60146,60158,60160,60164,60168,60169,60173,60174,60185,60186,60190,60198,60199,60201,60203,60208,60211,60215,60222,60223,60227,60240,60241,60246,60254,60258,60260,60270,60272,60278,60280,60286,60293,60294,60299,60307,60308,60314,60324,60328,60331,60333,60335,60336,60337,60339,60340,60345,60346,60348,60350,60351,60352,60353,60357,60363,60364,60365,60367,60373,60380,60383,60385,60390,60392,60397,60399,60411,60422,60423,60425,60429,60435,60441,60445,60447,60452,60453,60459,60467,60468,60470,60474,60489,60491,60499,60502,60504,60506,60509,60510,60517,60518,60520,60523,60532,60534,60536,60537,60541,60545,60546,60549,60551,60552,60556,60557,60562,60563,60570,60572,60593,60596,60598,60601,60602,60606,60609,60635,60637,60639,60640,60644,60649,60653,60665,60666,60669,60670,60671,60675,60677,60683,60689,60694,60696,60700,60701,60716,60720,60730,60731,60733,60735,60739,60740,60742,60748,60752,60755,60761,60763,60764,60767,60768,60769,60771,60773,60774,60777,60785,60786,60790,60794,60795,60796,60797,60804,60810,60811,60814,60822,60826,60827,60833,60837,60838,60841,60844,60849,60850,60851,60854,60856,60857,60859,60866,60871,60879,60881,60885,60895,60897,60900,60904,60908,60909,60911,60912,60914,60916,60918,60921,60922,60924,60926,60931,60932,60935,60939,60943,60950,60955,60961,60963,60965,60967,60968,60970,60973,60974,60977,60978,60987,61001,61003,61005,61006,61012,61015,61017,61019,61031,61033,61034,61036,61039,61043,61050,61051,61056,61062,61073,61077,61081,61087,61090,61099,61103,61105,61112,61120,61126,61130,61133,61137,61139,61147,61148,61152,61153,61154,61155,61156,61158,61161,61162,61163,61164,61166,61179,61184,61185,61192,61210,61212,61215,61223,61226,61233,61242,61243,61244,61248,61249,61253,61261,61270,61271,61276,61277,61282,61290,61291,61294,61300,61307,61308,61309,61312,61323,61324,61326,61328,61329,61331,61337,61339,61345,61352,61357,61362,61366,61367,61371,61375,61377,61378,61379,61383,61386,61391,61395,61398,61400,61411,61413,61414,61415,61418,61421,61422,61424,61433,61434,61435,61438,61439,61443,61447,61450,61452,61454,61462,61464,61468,61469,61470,61471,61484,61495,61503,61504,61508,61509,61521,61527,61529,61531,61539,61543,61550,61551,61552,61558,61560,61567,61569,61571,61574,61581,61586,61589,61592,61594,61603,61607,61608,61610,61611,61616,61618,61628,61634,61639,61641,61643,61645,61649,61652,61660,61667,61670,61673,61676,61681,61687,61689,61695,61699,61700,61703,61707,61709,61710,61713,61714,61716,61718,61720,61722,61723,61731,61732,61733,61766,61771,61772,61773,61774,61778,61780,61783,61788,61793,61796,61799,61802,61809,61810,61815,61820,61821,61822,61824,61826,61831,61832,61836,61837,61842,61845,61847,61850,61851,61852,61858,61859,61862,61865,61866,61871,61875,61876,61877,61885,61892,61894,61902,61905,61911,61914,61920,61921,61922,61923,61925,61929,61930,61934,61943,61944,61945,61946,61956,61965,61966,61967,61973,61976,61979,61984,61986,61987,61989,61990,61991,61995,61996,62010,62011,62025,62031,62037,62045,62047,62050,62064,62071,62074,62076,62077,62079,62082,62085,62090,62091,62102,62103,62104,62107,62114,62116,62121,62125,62129,62130,62133,62136,62138,62140,62142,62146,62162,62164,62166,62167,62172,62177,62178,62182,62188,62193,62194,62197,62210,62213,62215,62224,62225,62231,62236,62240,62242,62261,62264,62273,62275,62278,62281,62290,62291,62293,62297,62298,62300,62303,62305,62308,62310,62323,62324,62327,62328,62333,62335,62336,62337,62339,62343,62346,62348,62351,62352,62353,62358,62361,62363,62367,62369,62380,62388,62393,62394,62401,62402,62409,62419,62421,62425,62429,62433,62435,62436,62437,62438,62467,62469,62471,62481,62483,62485,62489,62492,62501,62502,62503,62514,62517,62525,62529,62530,62532,62533,62535,62539,62541,62545,62547,62553,62557,62559,62569,62576,62579,62584,62593,62594,62601,62607,62614,62616,62618,62627,62629,62638,62641,62642,62644,62647,62648,62649,62651,62652,62656,62659,62660,62665,62666,62670,62680,62681,62690,62696,62697,62699,62702,62704,62712,62713,62714,62716,62720,62721,62725,62726,62729,62730,62733,62734,62737,62739,62740,62742,62746,62748,62754,62755,62760,62766,62772,62780,62784,62786,62796,62808,62810,62816,62823,62826,62844,62845,62851,62854,62855,62857,62858,62860,62861,62865,62866,62870,62879,62883,62884,62885,62894,62896,62902,62906,62908,62917,62918,62921,62922,62926,62928,62932,62933,62940,62941,62942,62943,62950,62951,62966,62967,62971,62977,62981,62982,62990,62991,63011,63016,63023,63028,63029,63031,63033,63037,63055,63056,63060,63061,63064,63065,63069,63071,63075,63085,63088,63091,63093,63099,63104,63114,63116,63118,63120,63127,63129,63130,63133,63134,63139,63156,63159,63160,63163,63164,63165,63169,63176,63178,63180,63181,63183,63187,63191,63199,63201,63202,63209,63224,63229,63230,63231,63232,63237,63244,63247,63249,63253,63256,63259,63268,63270,63272,63274,63281,63285,63291,63292,63298,63303,63305,63307,63309,63310,63313,63316,63317,63319,63321,63327,63333,63335,63338,63344,63346,63352,63355,63356,63364,63365,63366,63372,63374,63383,63388,63391,63393,63399,63405,63408,63410,63416,63417,63419,63422,63424,63428,63433,63441,63443,63449,63451,63452,63454,63455,63458,63460,63461,63468,63469,63472,63475,63478,63485,63486,63489,63493,63496,63498,63501,63502,63503,63506,63507,63509,63510,63511,63513,63514,63519,63521,63526,63529,63531,63533,63540,63542,63544,63547,63553,63555,63557,63558,63564,63565,63570,63584,63593,63604,63606,63609,63623,63625,63627,63630,63633,63636,63638,63639,63641,63645,63647,63648,63651,63656,63657,63658,63671,63674,63675,63678,63683,63694,63696,63697,63700,63704,63710,63711,63714,63716,63718,63719,63723,63727,63728,63729,63735,63737,63740,63743,63747,63749,63750,63753,63755,63757,63758,63760,63763,63774,63781,63793,63797,63801,63804,63805,63812,63815,63833,63834,63841,63842,63843,63846,63849,63853,63856,63866,63867,63869,63870,63878,63880,63884,63885,63892,63894,63903,63909,63914,63916,63919,63924,63928,63930,63936,63937,63938,63941,63942,63946,63952,63954,63959,63962,63968,63975,63976,63977,63980,63982,63984,63986,63992,63996,63998,64000,64001,64003,64012,64015,64016,64018,64019,64021,64022,64028,64029,64035,64040,64049,64051,64053,64054,64056,64067,64071,64077,64079,64094,64095,64097,64099,64112,64114,64118,64119,64123,64124,64135,64138,64141,64146,64155,64156,64157,64158,64160,64168,64170,64171,64172,64174,64175,64182,64185,64186,64199,64203,64205,64206,64211,64213,64214,64215,64217,64223,64227,64242,64246,64251,64253,64264,64266,64270,64272,64278,64279,64284,64286,64287,64291,64293,64296,64299,64303,64312,64318,64323,64324,64325,64328,64330,64333,64334,64342,64343,64344,64345,64348,64353,64362,64364,64366,64367,64371,64372,64373,64376,64386,64392,64399,64402,64403,64404,64405,64407,64411,64414,64415,64416,64418,64420,64422,64423,64424,64426,64434,64435,64438,64441,64442,64447,64449,64450,64451,64455,64461,64465,64471,64477,64480,64490,64491,64492,64497,64498,64499,64500,64503,64505,64514,64522,64524,64537,64540,64546,64553,64555,64571,64572,64573,64578,64579,64581,64589,64595,64608,64609,64610,64615,64619,64624,64625,64639,64645,64647,64649,64651,64654,64657,64670,64673,64680,64686,64690,64691,64692,64698,64701,64708,64711,64722,64725,64727,64738,64741,64744,64745,64753,64755,64759,64762,64766,64770,64781,64783,64786,64787,64791,64792,64794,64802,64806,64809,64813,64816,64824,64826,64831,64843,64846,64849,64854,64855,64856,64860,64866,64882,64884,64886,64890,64895,64896,64898,64905,64909,64910,64913,64921,64930,64939,64941,64942,64949,64953,64957,64969,64971,64986,64995,64997,65001,65007,65008,65012,65018,65019,65020,65023,65025,65037,65038,65040,65043,65046,65055,65062,65065,65069,65073,65076,65081,65084,65086,65096,65100,65101,65103,65104,65109,65113,65118,65121,65127,65132,65135,65136,65143,65144,65148,65154,65171,65176,65177,65187,65189,65192,65196,65198,65204,65209,65215,65218,65219,65223,65224,65230,65235,65237,65240,65244,65245,65250,65252,65266,65268,65269,65272,65274,65276,65277,65278,65281,65282,65289,65291,65292,65294,65296,65304,65316,65318,65323,65326,65332,65342,65345,65354,65355,65359,65361,65365,65368,65369,65370,65375,65378,65380,65382,65386,65393,65398,65403,65405,65406,65408,65410,65413,65419,65425,65430,65436,65451,65452,65453,65457,65458,65459,65462,65463,65470,65492,65499,65504,65509,65512,65517,65518,65525,65526,65527,65532,65535,65537,65541,65547,65551,65554,65558,65561,65564,65565,65572,65574,65575,65578,65585,65586,65587,65595,65598,65605,65606,65610,65616,65619,65629,65630,65632,65635,65636,65640,65641,65643,65649,65653,65655,65656,65658,65664,65680,65684,65690,65692,65693,65697,65702,65705,65706,65709,65710,65713,65719,65724,65737,65749,65751,65755,65758,65759,65771,65775,65779,65781,65786,65789,65790,65792,65793,65801,65808,65810,65813,65815,65819,65821,65824,65830,65835,65844,65847,65855,65857,65862,65871,65873,65877,65878,65879,65880,65886,65894,65901,65902,65903,65912,65914,65917,65918,65919,65921,65925,65928,65945,65950,65952,65953,65956,65960,65968,65972,65978,65980,65988,65994,65997,65999,66003,66011,66013,66014,66016,66017,66018,66020,66022,66035,66038,66039,66044,66050,66051,66052,66054,66055,66059,66061,66062,66064,66068,66069,66070,66071,66073,66081,66085,66090,66095,66097,66102,66104,66106,66115,66116,66120,66121,66122,66130,66131,66132,66135,66138,66147,66148,66151,66157,66162,66164,66173,66180,66182,66183,66184,66192,66194,66197,66198,66201,66210,66213,66214,66217,66224,66230,66232,66238,66242,66253,66257,66258,66259,66262,66266,66268,66270,66273,66274,66280,66281,66291,66295,66300,66302,66312,66314,66315,66317,66320,66327,66329,66330,66335,66337,66338,66340,66341,66344,66354,66355,66358,66359,66366,66370,66371,66378,66382,66386,66393,66398,66399,66403,66404,66405,66406,66408,66409,66411,66414,66420,66423,66424,66428,66434,66435,66436,66447,66450,66461,66466,66470,66474,66475,66477,66492,66493,66494,66495,66503,66506,66508,66515,66517,66519,66525,66539,66540,66542,66543,66547,66549,66553,66556,66559,66564,66570,66576,66578,66581,66582,66583,66588,66591,66594,66595,66601,66603,66604,66609,66612,66615,66619,66623,66628,66630,66639,66644,66648,66649,66652,66654,66657,66662,66668,66669,66674,66679,66680,66681,66684,66692,66700,66703,66708,66710,66711,66715,66717,66725,66727,66738,66742,66743,66744,66764,66765,66771,66773,66775,66781,66784,66792,66799,66803,66805,66807,66808,66813,66814,66818,66820,66826,66837,66850,66853,66854,66861,66864,66865,66873,66885,66887,66888,66891,66895,66897,66900,66901,66905,66906,66907,66908,66915,66925,66926,66931,66941,66949,66963,66970,66971,66974,66978,66979,66986,66988,66996,67001,67002,67004,67009,67010,67011,67015,67016,67025,67028,67029,67031,67032,67043,67044,67046,67047,67048,67050,67051,67052,67054,67058,67061,67067,67070,67073,67077,67078,67084,67085,67087,67090,67095,67096,67097,67101,67102,67103,67108,67112,67114,67117,67121,67134,67135,67138,67144,67146,67147,67153,67158,67162,67168,67172,67180,67183,67189,67194,67197,67205,67212,67213,67219,67221,67224,67225,67231,67232,67233,67234,67245,67246,67247,67264,67279,67282,67283,67288,67291,67300,67304,67308,67317,67322,67324,67325,67328,67330,67348,67353,67354,67362,67363,67369,67371,67379,67390,67393,67395,67397,67405,67406,67407,67410,67415,67417,67421,67422,67432,67435,67437,67441,67444,67446,67452,67457,67461,67470,67471,67474,67479,67483,67484,67486,67490,67491,67495,67498,67499,67500,67512,67527,67532,67533,67536,67543,67545,67548,67557,67558,67561,67563,67565,67568,67569,67570,67578,67584,67587,67591,67594,67603,67610,67615,67616,67622,67624,67628,67631,67638,67639,67641,67644,67646,67647,67648,67652,67655,67659,67660,67672,67681,67683,67685,67686,67691,67693,67694,67700,67707,67708,67714,67716,67717,67723,67733,67739,67742,67743,67753,67758,67762,67766,67768,67771,67772,67775,67776,67777,67778,67780,67781,67782,67788,67789,67799,67803,67806,67814,67819,67820,67822,67828,67829,67840,67846,67853,67855,67859,67860,67868,67871,67875,67884,67889,67890,67892,67909,67923,67929,67942,67960,67961,67966,67967,67968,67970,67971,67977,67978,67980,67983,67988,67992,67996].","blocked":null,"python_version":"3.12.3","spread":3,"base_mean_edge":98.4694596619638,"runs":{"tuning":1954,"unseen":2035},"base_unseen":{"mean_edge":118.8166859338749,"retail_edge":149.05823988395983,"arb_edge":-30.241553950072774},"holdout":{"mean_edge":119.67913744244987,"retail_edge":150.15178230308584,"arb_edge":-30.47264486062393,"failures":0},"diff":{"mean":0.8624515085749873,"standard_error":0.3350052544382891,"retail":1.0935424191259948,"arb":-0.23109091055115488},"others_identical":{"runs":900,"identical":true},"seconds":{"base":119.95917750301305,"yours":119.35835233575199},"code":"\"\"\"Crossing-cover strategy with spread-3 low-ask queue protection.\"\"\"\nimport math\nfrom orderbook_pm_challenge.strategy import BaseStrategy\nfrom orderbook_pm_challenge.types import CancelOrder, PlaceOrder, Side\n\nP = dict(lam_r=0.25, m=5.0, sig_n=1.2, lam_j=0.0019, sig_j=0.35, sig=0.02,\n         qmax=3000.0, rmin=2, kA=0.7, kL=0.15, pL=0.05,\n         ammo=1.0, ydem=0.4, W=200.0, fy=0.6, ammo_q=60.0, ammo_pmax=0.05, ammo_maxpay=0.02,\n         fb=0.9, fu=0.7, xu=0.1, sticky=1.0, min_ahead=2.0, keep_hi=1.5, keep_lo=0.7, Hu=300.0, bins=8.0, filt=1.0, uni=0.01, jumpinfo=1.0, dmin=0.0, kLb=0.08, kLf=0.08, pinf=1.0, pre=0.0, H1=100.0,\n         ydf=0.6, Wf=2000.0, g_hi=0.15, g_lo=0.15, qf=400.0, pmaxf=0.05, pre_gap=1.0,\n         ydf1=0.6, g1=5.0, f1=0.6, a1=100.0, nb1=0.0, gs=1.0, p1t=1.0, m1=1.0, zd=1.0, pfl=0.0005)\nSQ2 = math.sqrt(2.0)\nSQ2PI = math.sqrt(2.0 * math.pi)\ndef cdf(x): return 0.5 * (1.0 + math.erf(x / SQ2))\ndef pdf(x): return math.exp(-0.5 * x * x) / SQ2PI\ndef inv(p):\n    p = min(max(p, 1e-9), 1 - 1e-9)\n    t = math.sqrt(-2.0 * math.log(min(p, 1 - p)))\n    x = t - (2.515517 + 0.802853 * t + 0.010328 * t * t) / (1 + 1.432788 * t + 0.189269 * t * t + 0.001308 * t ** 3)\n    x = -x if p < 0.5 else x\n    for _ in range(2):\n        d = pdf(x)\n        if d < 1e-12:\n            break\n        x -= (cdf(x) - p) / d\n    return x\ndef lpm(k):\n    return pdf(k) + k * cdf(k)\ndef fl(q):\n    return math.floor(q * 100 + 1e-9) / 100\n\nNODES = [(-2.2, .06), (-1.3, .17), (-0.6, .27), (0.6, .27), (1.3, .17), (2.2, .06)]\nPROBE = 0.01\n\n\nclass Strategy(BaseStrategy):\n    def __init__(self):\n        self.n = 0\n        self.ahead = set()     # main orders placed strictly ahead of any competitor order at their tick\n        self.res = {}          # order id -> uncovered quantity at placement\n        self.bc = None         # belief: sub-tick grid centres (ticks)\n        self.bw = None         # belief: weights\n        self.st = 0.5          # last one-step sd in ticks\n        self.pcb = self.pca = None\n        self.pb = set()\n        self.pa = set()\n        self.tb = 0\n        self.s = None          # competitor spread parameter\n        self.flow_notional = 0.0\n        self.flow_exposure = 0\n        self.last_ask_tick = None\n        self.last_quote_exposed = False\n        self.last_flow_ca = None\n        self.last_flow_cap = 0.0\n        self.last_flow_correction = 1.0\n        self.params = P.copy()\n\n    def _oid(self, tag):\n        self.n += 1\n        return tag + str(self.n)\n\n    def on_step(self, state):\n        H = max(1, state.steps_remaining)\n        cb = state.competitor_best_bid_ticks or 0\n        ca = state.competitor_best_ask_ticks or 100\n        if self.s is None:\n            self.s = max(1, (ca - cb + 1) // 2)\n            if self.s == 1:\n                self.params.update({'dmin': 0.3, 'pfl': 1e-06})\n            if self.s == 3:\n                self.params.update({'flow_prior': 200, 'flow_level': 0.6, 'flow_strength': 1.0, 'flow_safety': 2.0, 'flow_exposure_min': 5.0})\n        P = self.params\n        if self.s == 3 and self.last_quote_exposed and ca <= self.last_flow_ca + 1:\n            self.flow_exposure += 1\n            self.flow_notional += min(self.last_flow_cap, state.sell_filled_quantity * self.last_ask_tick / 100.0) * self.last_flow_correction\n        lo, hi = cb, ca\n        for o in state.own_orders:\n            if o.side is Side.BUY:\n                lo = max(lo, o.price_ticks)\n            else:\n                hi = min(hi, o.price_ticks)\n        if P['pinf'] > 0:\n            sb = {o.price_ticks for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity <= PROBE + 1e-9}\n            sa = {o.price_ticks for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity <= PROBE + 1e-9}\n            ea = self.pa - sa\n            eb = self.pb - sb\n            if sa and ea:\n                lo = max(lo, min(max(ea), hi))\n            if eb and (sb or min(eb) <= P['p1t']):\n                hi = min(hi, max(min(eb), lo))\n        if P['jumpinfo'] > 0 and self.pcb is not None:\n            if ca > self.pca + 1:\n                lo = max(lo, ca - 1)\n            if cb < self.pcb - 1:\n                hi = min(hi, cb + 1)\n        self.pcb, self.pca = cb, ca\n        if lo > hi:\n            lo, hi = hi, lo\n        # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi]\n        wid = max(hi - lo, 1e-6)\n        nb = max(2, min(48, int(round(wid * P['bins']))))\n        cs = [lo + (i + 0.5) * wid / nb for i in range(nb)]\n        if self.bc is None or P['filt'] <= 0:\n            ws = [1.0 / nb] * nb\n        else:\n            sg = max(self.st, 0.6 * wid / nb)\n            k = -0.5 / (sg * sg)\n            ws = []\n            uni = P['uni'] * sg\n            if self.s == 3:\n                belief_exp = math.exp\n                for c in cs:\n                    t = uni\n                    for ci, wi in zip(self.bc, self.bw):\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * belief_exp(d2)\n                    ws.append(t)\n            else:\n                for c in cs:\n                    t = uni\n                    for ci, wi in zip(self.bc, self.bw):\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * math.exp(d2)\n                    ws.append(t)\n            tot = sum(ws)\n            ws = [w / tot for w in ws]\n        self.bc, self.bw = cs, ws\n        mean_t = sum(c * w for c, w in zip(cs, ws))\n        var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0)\n        phat = min(max(mean_t / 100.0, 0.002), 0.998)\n        var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2\n        sd = math.sqrt(H * var)\n        self.tb = self.tb + 1 if hi <= 1 else 0\n        if self.tb > 0 and P['zd'] > 0:\n            # below the last tick there is no probe: the score keeps walking away from it\n            phat = min(phat, max(P['pfl'], cdf(inv(0.01) - P['zd'] * 0.02 * math.sqrt(self.tb) / sd)))\n        z = inv(phat)\n        Z = z * sd\n        sp = pdf(z) / sd * P['sig']\n        self.st = sp * 100.0\n        s = math.sqrt(sp * sp + var_t / 1e4 + 1e-8)\n        sd1 = math.sqrt(max(1.0, H - 1.0) * var)\n        jp = [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n        lj = P['lam_j']\n\n        def AB(x):\n            k = (x - phat) / s\n            a = s * lpm(k)\n            b = a - (x - phat)\n            ja = sum(w * max(0.0, x - p) for p, w in jp)\n            jb = sum(w * max(0.0, p - x) for p, w in jp)\n            return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb\n\n        if H == 1:\n            def AB(x):\n                return (1 - phat) * x, phat * (1 - x)\n        rho = P['lam_r'] * 0.5\n        mu = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n        kA = P['kL'] if phat < P['pL'] else P['kA']\n\n        def qsize(loss, gain, px):\n            loss *= kA\n            if gain <= 0:\n                return 0.0\n            tail = loss / (rho * gain)\n            if tail >= 1.0:\n                return 0.0\n            return min(P['qmax'], math.exp(mu + P['sig_n'] * inv(1 - max(tail, 1e-6))) / px)\n\n        ptk = phat * 100\n        def qbid(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if phat * 100 - t < P['dmin']:\n                return 0.0\n            if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0:\n                return 0.0\n            if phat < P['pL']:\n                ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0\n                a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL']\n            return qsize(a, b, max(phat, 0.05))\n\n        def qask(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if t - phat * 100 < P['dmin']:\n                return 0.0\n            return qsize(b, a, t / 100.0)\n\n        bids = [o for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity > PROBE + 1e-9]\n        asks = [o for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity > PROBE + 1e-9]\n        sticky = P['sticky'] > 0\n        def top(orders, comp, step):\n            threshold = max(P['min_ahead'], 20 * 100.0 / comp) if self.s == 3 and step == -1 and 1 <= comp <= 5 else P['min_ahead']\n            if sticky and sum(o.remaining_quantity for o in orders if o.price_ticks == comp and o.order_id in self.ahead) >= threshold:\n                return comp\n            return comp + step\n        bid_t = top(bids, cb, 1)\n        ask_t = top(asks, ca, -1)\n        qb = qbid(bid_t)\n        qa = qask(ask_t)\n\n        Y = state.yes_inventory\n        if ask_t == 1 and H > P['H1'] and P['pre'] > 0:\n            qa = qa if Y >= P['a1'] > 0 else 0.0          # let the competitor's 2-tick ask erode instead of fronting it for nothing\n        # ammunition: hold YES so that low asks are covered\n        ptick = phat * 100\n        amt = 0\n        qam = 0.0\n        if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']):\n            wealth = state.cash + Y * phat\n            x = max(ask_t, ptick + 1) / 100.0\n            capw = P['fy'] * wealth / max(phat, 0.005)\n            target = min(P['ydem'] * min(H, P['W']) / x, capw)\n            full = min(P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0\n            t = max(1, min(99, int(math.ceil(ptick + 1e-9))))\n            g = t - ptick\n            if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t:\n                amt, qam = t, min(P['qf'], full - Y)     # a tick p has just crossed: nearly free\n            elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']:\n                amt, qam = t, min(P['ammo_q'], target - Y)\n            elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']:\n                amt, qam = t - 1, min(P['qf'], full - Y)  # rest just under p: filled only on the crossing, or by retail\n\n        if P['pre'] > 0 and ca == 2 and phat < 0.01 and H > P['H1'] and Y < P['pre'] and not qam and 1.0 - ptick < P['pre_gap']:\n            amt, qam = 1, min(P['ammo_q'], P['pre'] - Y)\n        q1 = 0.0\n        if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1:\n            stock_rate = P['ydf1']\n            if self.s == 3:\n                flow = (self.flow_notional + P['flow_prior'] * P['flow_level']) / (P['flow_prior'] + self.flow_exposure)\n                scale = max(0.5, min(2.0, flow / P['flow_level']))\n                stock_rate *= 1.0 + P['flow_strength'] * (scale - 1.0)\n            q1 = max(0.0, stock_rate * min(H, P['Wf']) / (self.s / 100.0) - Y)\n\n        # Bridge expected retail demand until another tick crossing is available.\n        if 0.02 < phat < 0.1:\n            ct = max(2, min(99, int(math.floor(ptick))))\n            wealth = state.cash + Y * phat\n            goal = min(1 * qa, 0.3 * max(wealth, 0.0) / phat)\n            if Y < goal and ct < ask_t:\n                amt, qam = ct, min(3000.0, goal - Y)\n        # order management\n        actions = []\n        free = state.free_cash - 2.0\n        keep_ask = 0.0\n        new_b = []\n        new_a = []\n        def cancel(o):\n            nonlocal free\n            actions.append(CancelOrder(o.order_id))\n            x = o.price_ticks / 100.0\n            if o.side is Side.BUY:\n                free += x * o.remaining_quantity\n            else:\n                free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n            self.ahead.discard(o.order_id)\n            self.res.pop(o.order_id, None)\n        for o in state.own_orders:\n            if o.remaining_quantity <= PROBE + 1e-9:\n                cancel(o)\n        kept_ids = set()\n        def manage(orders, t, q, comp):\n            kept = 0.0\n            for o in orders:\n                if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * P['keep_hi'], 1.0):\n                    kept += o.remaining_quantity\n                    kept_ids.add(o.order_id)\n                else:\n                    cancel(o)\n            return kept\n        kb = manage(bids, bid_t, qb, cb)\n        ka = manage(asks, ask_t, qa, ca)\n        add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0\n        add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0\n\n        budget = P['fb'] * max(free, 0.0)\n        cost = add_b * bid_t / 100.0 + qam * amt / 100.0\n        if cost > budget:\n            f = budget / cost\n            add_b *= f\n            qam *= f\n            cost = budget\n        out = []\n        q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0)\n        if q1 >= 0.01:\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=1, quantity=fl(q1)))\n            free -= fl(q1) / 100.0 + 1e-6\n        if amt and qam >= 0.01:\n            q = fl(qam)\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=amt, quantity=q))\n            free -= q * amt / 100.0 + 1e-6\n        if bid_t >= 1 and add_b >= 0.01:\n            q = fl(add_b)\n            oid = self._oid('b')\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=bid_t, quantity=q, client_order_id=oid))\n            free -= q * bid_t / 100.0 + 1e-6\n            if bid_t > cb:\n                self.ahead.add(oid)\n        if ask_t <= 99 and add_a >= 0.01:\n            x = ask_t / 100.0\n            covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n                       for o in asks if o.order_id in kept_ids)\n            cov = max(0.0, Y - covk - 0.1)\n            unc = max(0.0, add_a - cov)\n            if unc > 0:\n                ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0\n                if H < P['Hu'] and phat < 0.05:\n                    ub = max(0.0, free * (1 - H / P['Hu']))\n                unc = min(unc, ub / (1 - x))\n            q = fl(min(add_a, cov + unc))\n            if q >= 0.01:\n                oid = self._oid('a')\n                out.append(PlaceOrder(side=Side.SELL, price_ticks=ask_t, quantity=q, client_order_id=oid))\n                r = max(0.0, q - cov)\n                self.res[oid] = r\n                free -= r * (1 - x) + 1e-6\n                if ask_t < ca:\n                    self.ahead.add(oid)\n\n        # probes: tiny orders that the arbitrageur removes when p crosses them\n        f = int(math.floor(ptick + 1e-9))\n        r = max(int(P['rmin']), int(math.ceil(2.0 * s * 100)))\n        self.pb = set()\n        self.pa = set()\n        if free > 1.0:\n            for t in range(f, f + r + 1):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.BUY, price_ticks=t, quantity=PROBE))\n                    self.pb.add(t)\n            for t in range(f + 1 - r, f + 2):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.SELL, price_ticks=t, quantity=PROBE))\n                    self.pa.add(t)\n        if self.s == 3:\n            self.last_ask_tick = ask_t\n            self.last_flow_ca = ca\n            exposed_qty = ka + sum(o.quantity for o in out if o.side is Side.SELL and o.price_ticks == ask_t and o.quantity > PROBE)\n            self.last_flow_cap = exposed_qty * ask_t / 100.0\n            self.last_quote_exposed = ask_t / 100.0 > phat + max(0.005, P['flow_safety'] * self.st / 100.0) and self.last_flow_cap >= P['flow_exposure_min']\n            if self.last_quote_exposed:\n                logcap = math.log(self.last_flow_cap)\n                mu_flow = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n                clipped = P['m'] * cdf((logcap - mu_flow - P['sig_n'] ** 2) / P['sig_n']) + self.last_flow_cap * (1.0 - cdf((logcap - mu_flow) / P['sig_n']))\n                self.last_flow_correction = min(3.0, P['m'] / max(clipped, 0.01))\n        return actions + out\n","code_sha256":"823861487546e4e3dc094c2e3b66fdfe578bd0e31845dc9a201e64ff685dc6c1","tried":["join4 (Join rival ask at tick 4 below phat 0.01; permit replenishment there, letting rival erode before us): discovery n=200 {\"mean\":-50.216729751857,\"standard_error\":8.183167490482232,\"retail\":-49.1191068467185,\"arb\":-1.0976229051490003} failures=0","lower4 (Lower ask one tick when 2<=base ask<=4 and phat<0.05): discovery n=200 {\"mean\":-15.80732676489,\"standard_error\":2.899693119586265,\"retail\":-8.551734016243502,\"arb\":-7.255592748669001} failures=0","size4_0 (Multiply qa by 4.0 when phat<0.05): discovery n=200 {\"mean\":-12.6004967091325,\"standard_error\":8.004630988490478,\"retail\":4.218476409017999,\"arb\":-16.818973118145003} failures=0","lower3 (Lower ask one tick when 2<=base ask<=3 and phat<0.05): discovery n=200 {\"mean\":-7.4963031770395006,\"standard_error\":1.649062555556152,\"retail\":-4.362843265435503,\"arb\":-3.133459911607} failures=0","covered (Floor qa at all YES stock minus 0.1 when phat<0.05): discovery n=200 {\"mean\":-5.518283720660001,\"standard_error\":3.664254621270131,\"retail\":2.2083450586119984,\"arb\":-7.7266287792435} failures=0","cover120 (Floor qa at min(covered stock, $120/ask price) when phat<0.05): discovery n=200 {\"mean\":-3.2469281322839993,\"standard_error\":2.4218878188814954,\"retail\":1.4764584818469986,\"arb\":-4.723386614124} failures=0","size2_0 (Multiply qa by 2.0 when phat<0.05): discovery n=200 {\"mean\":-2.915599140629001,\"standard_error\":3.396727970305543,\"retail\":3.2601331716899984,\"arb\":-6.175732312314501} failures=0","cover60 (Floor qa at min(covered stock, $60/ask price) when phat<0.05): discovery n=200 {\"mean\":-2.5672088094869996,\"standard_error\":1.4483732788084336,\"retail\":0.025006805965499694,\"arb\":-2.5922156154525005} failures=0","topup (Permit replenishing main ask at rival price when phat<0.05, despite new size joining behind rival): discovery n=200 {\"mean\":-2.4989316442094998,\"standard_error\":1.766064548988724,\"retail\":0.22745819502649967,\"arb\":-2.7263898392375} failures=0","size0_5 (Multiply qa by 0.5 when phat<0.05): discovery n=200 {\"mean\":-2.2903097295515,\"standard_error\":2.1197405686314337,\"retail\":-5.007053000387501,\"arb\":2.7167432708279997} failures=0","cover30 (Floor qa at min(covered stock, $30/ask price) when phat<0.05): discovery n=200 {\"mean\":-2.2345820753015,\"standard_error\":1.018699615481198,\"retail\":0.10405466131049873,\"arb\":-2.3386367366160004} failures=0","cover10 (Floor qa at min(covered stock, $10/ask price) when phat<0.05): discovery n=200 {\"mean\":-1.1856274977814996,\"standard_error\":0.5084214731376409,\"retail\":-0.028776799424501006,\"arb\":-1.156850698361} failures=0","cap12000 (Relax ask-only 3000-share cap to 12000 shares, retaining original loss quantile, when phat<0.05): discovery n=200 {\"mean\":-0.01714596677500026,\"standard_error\":0.043043001733545735,\"retail\":-0.027451067039501426,\"arb\":0.010305100263500027} failures=0","cap30000 (Relax ask-only 3000-share cap to 30000 shares, retaining original loss quantile, when phat<0.05): discovery n=200 {\"mean\":-0.01714596677500026,\"standard_error\":0.043043001733545735,\"retail\":-0.027451067039501426,\"arb\":0.010305100263500027} failures=0","cap6000 (Relax ask-only 3000-share cap to 6000 shares, retaining original loss quantile, when phat<0.05): discovery n=200 {\"mean\":-0.011706466775000592,\"standard_error\":0.04298694343793547,\"retail\":-0.023294567039501432,\"arb\":0.011588100263499984} failures=0","lower2 (Lower ask one tick when 2<=base ask<=2 and phat<0.05): discovery n=200 {\"mean\":0.0,\"standard_error\":0.0,\"retail\":0.0,\"arb\":0.0} failures=0","queue0_5 (Require $0.5 of priority at rival ask ticks <=5; otherwise undercut by one tick): discovery n=200 {\"mean\":0.0006098002830000837,\"standard_error\":0.0006226105959523917,\"retail\":0.0006098002834998795,\"arb\":0.0} failures=0","keep (Keep oversized asks at ticks <=5 while desired qa remains positive): discovery n=200 {\"mean\":0.02104663030550033,\"standard_error\":0.1503827076507121,\"retail\":0.21144457952899934,\"arb\":-0.19039794922100006} failures=0","queue2 (Require $2 of priority at rival ask ticks <=5; otherwise undercut by one tick): discovery n=200 {\"mean\":0.08551750939650127,\"standard_error\":0.2645062890725151,\"retail\":0.30341861041799945,\"arb\":-0.217901101019} failures=0","queue5 (Require $5 of priority at rival ask ticks <=5; otherwise undercut by one tick): discovery n=200 {\"mean\":0.1318506618694999,\"standard_error\":0.2836967128096735,\"retail\":0.4571141560864993,\"arb\":-0.32526349421499995} failures=0","old2 (Multiply qa by 2 after >=100 consecutive hi<=1 steps, phat<0.01): discovery n=200 {\"mean\":0.14464370774549934,\"standard_error\":0.1689237878362578,\"retail\":0.17780457120999926,\"arb\":-0.03316086346750002} failures=0","floor4 (Multiply qa by 4 when phat<0.001): discovery n=200 {\"mean\":0.20658852375900014,\"standard_error\":0.1911262811697847,\"retail\":0.18873083411049987,\"arb\":0.017857689645000084} failures=0","floor2 (Multiply qa by 2 when phat<0.001): discovery n=200 {\"mean\":0.24324623863249983,\"standard_error\":0.18575546727012268,\"retail\":0.2869017414219997,\"arb\":-0.043655502792500064} failures=0; separate tuning n=800 {\"mean\":0.8267298119642499,\"standard_error\":0.2081965756595045,\"retail\":0.8813855247701252,\"arb\":-0.05465571280624996} failures=0","refresh (Consolidate an undercutting ask into one full-sized order when depth falls below 90% of qa, phat<0.05): discovery n=200 {\"mean\":0.28544002823550024,\"standard_error\":0.3977545320635777,\"retail\":0.5906919098929996,\"arb\":-0.3052518816455002} failures=0","flowask (Scale qa by existing clipped retail-flow estimate/prior, bounded [0.5,2], phat<0.05): discovery n=200 {\"mean\":0.3080041540170001,\"standard_error\":0.5892660952867199,\"retail\":0.5083176574444979,\"arb\":-0.20031350342600016} failures=0","queue10 (Require $10 of priority at rival ask ticks <=5; otherwise undercut by one tick): discovery n=200 {\"mean\":0.35375000276300006,\"standard_error\":0.3766100643592954,\"retail\":0.7363361750374995,\"arb\":-0.38258617226799996} failures=0","size1_5 (Multiply qa by 1.5 when phat<0.05): discovery n=200 {\"mean\":0.4001580400345006,\"standard_error\":1.076648797013605,\"retail\":2.3740619221479986,\"arb\":-1.973903882102} failures=0","deep4 (Multiply qa by 4 when phat<0.005): discovery n=200 {\"mean\":0.43677297359999906,\"standard_error\":0.35508161584426745,\"retail\":0.7322107337810002,\"arb\":-0.295437760185} failures=0","deep2 (Multiply qa by 2 when phat<0.005): discovery n=200 {\"mean\":0.481865401615998,\"standard_error\":0.2914215370848307,\"retail\":0.6815822995294998,\"arb\":-0.1997168979140001} failures=0; separate tuning n=800 {\"mean\":0.3806756857786253,\"standard_error\":0.7017914413597823,\"retail\":1.0621842371496253,\"arb\":-0.6815085513704999} failures=0; final 954 (auxiliary, inspected only after freeze, not used for selection) {\"mean\":-0.5494174150236898,\"standard_error\":0.9036732132785699,\"retail\":0.8484658665477988,\"arb\":-1.3978832815729563}","late2 (Multiply qa by 2 with H<=300 and phat<0.01): discovery n=200 {\"mean\":0.5170704026324996,\"standard_error\":0.3054785088408262,\"retail\":0.8471456057790002,\"arb\":-0.3300752031480001} failures=0; separate tuning n=800 {\"mean\":0.7751994606538749,\"standard_error\":0.19782849794575721,\"retail\":0.9370580829527498,\"arb\":-0.16185862229699993} failures=0","queue20 (Require $20 of priority at rival ask ticks <=5; otherwise undercut by one tick): discovery n=200 {\"mean\":0.48068486451900144,\"standard_error\":0.38389517825956115,\"retail\":0.8155879478225001,\"arb\":-0.3349030832970001} failures=0; separate tuning n=800 {\"mean\":1.1030173726088752,\"standard_error\":0.24973786510189153,\"retail\":1.3004785396941245,\"arb\":-0.19746116708337516} failures=0; selected before final tuning n=954 {\"mean\":0.6744360511800834,\"standard_error\":0.24193424946837613,\"retail\":0.9708646595992669,\"arb\":-0.296428608417086} failures=0; all tuning n=1954 {\"mean\":0.8300731135192938,\"standard_error\":0.16111017705622233,\"retail\":1.0899208324347494,\"arb\":-0.25984771891299907}; frozen unseen n=2035 {\"mean\":0.8624515085749873,\"standard_error\":0.3350052544382891,\"retail\":1.0935424191259948,\"arb\":-0.23109091055115488} failures=0; math.exp alias full-result equivalence 200/200 failures=0; 900 full-result non-target equality checks; timing n=200 each {\"base\":119.95917750301305,\"yours\":119.35835233575199}"],"next":"Test $40 and $80 priority-notional thresholds and a probability-dependent threshold on fresh tuning and unseen ranges. Also test whether the independently positive final-300-step depth rule survives after this queue rule; do not assume within-spread gains add. Seeds 60000-67999 have now been used for this evaluation. Large fixed depth increases, joining behind the rival at tick 4, and covered-stock floors were inferior on the discovery sample."}