no price floor: min_price 0.01 → 0 (both books), cap stays 0.95

User call 2026-07-13 after a big 0.001 longshot was floor-blocked (the
same band class that blocked the 16x Hive copy at 0.05). Executor's
protected prices now round to 4dp and scale with the price — the old 2dp
rounding zeroed the bound on sub-penny books (BUY never bounds below the
quoted cross; SELL never above the quoted bid; verified at 0.001/0.002).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
jaxperro
2026-07-12 21:48:20 -04:00
parent 65923f17f2
commit c88618f220
3 changed files with 12 additions and 4 deletions
+10 -2
View File
@@ -341,16 +341,24 @@ class LedgerLiveExecutor:
return {"ok": False, "filled_shares": 0.0, "price": price,
"resp": f"pre-check failed: {e}", "paper": False}
try:
# protected prices round to 4dp and scale WITH the price — 2dp
# rounding zeroed the bound on sub-penny books (0.001 longshots
# are the follow set's specialty; the min_price floor removal
# 2026-07-13 makes them copyable, so the executor must survive
# them). BUY never bounds below the quoted cross; SELL never
# bounds above the quoted bid.
if side == "BUY":
r = self.client.place_market_order(
token_id=token_id, side="BUY",
amount=round(sz * price, 2),
max_price=min(round(price * (1 + self._slip), 2), 0.99),
max_price=min(max(round(price * (1 + self._slip), 4),
price), 0.99),
order_type=self._otype)
else:
r = self.client.place_market_order(
token_id=token_id, side="SELL", shares=sz,
min_price=max(round(price * (1 - self._slip), 2), 0.01),
min_price=min(max(round(price * (1 - self._slip), 4),
0.0001), price),
order_type=self._otype)
except Exception as e: # NEVER raise into the trade loop —
# but a timed-out post may still be resting: sweep + measure first