diff --git a/tools/sell.py b/tools/sell.py index a459d10..046b1b9 100755 --- a/tools/sell.py +++ b/tools/sell.py @@ -132,7 +132,9 @@ def main(): cutoff_price = max(recent_prices + [best_ask or 0]) * 1.1 if recent_prices else float("inf") med_vol = med or 1 for r in rows: - ahead = sum(u for p, u in asks if p < r["price"]) + # p <= (not <): a resting order AT the same price was posted first and has time + # priority over yours - it's ahead of you too, not a free pass to the front of the queue. + ahead = sum(u for p, u in asks if p <= r["price"]) # Outside the recent-traded range the queue mechanism doesn't meaningfully apply (no # real evidence that cumulative ahead-quantity, much of it itself unreachable junk # asks, clears at the normal rate) - that means "not a binding constraint" (0), NOT