fix: apply price range filter to YES only, not NO

MIN/MAX_PRICE was filtering both YES and NO bids, blocking valid
skewed-market entries like YES=11c + NO=87c (NO fails MAX_PRICE=0.30).

Now only YES is range-checked. NO only needs basic sanity bounds (0 < noBid < 1).
This enables targeting cheap YES markets while NO bid can be any value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
direkturcrypto
2026-03-31 14:27:55 +07:00
co-authored by Claude Sonnet 4.6
parent 3a4dbf2b02
commit eec97eb1e5
2 changed files with 9 additions and 5 deletions
+4 -2
View File
@@ -95,8 +95,10 @@ MAKER_MM_REENTRY_DELAY=30
# Set to false to disable re-entry — bot places one order per market then waits for next # Set to false to disable re-entry — bot places one order per market then waits for next
MAKER_MM_REENTRY_ENABLED=true MAKER_MM_REENTRY_ENABLED=true
# Price range for maker rebate eligibility (both sides must be in range) # YES bid price range — bot only enters when YES bid is within this range.
# Polymarket rebates are earned on orders within ~30-70% range # NO bid is derived from MAX_COMBINED - YES bid, and is NOT range-filtered.
# Default (balanced market): 0.30-0.69 — enters near 50/50
# Skewed market mode: 0.10-0.30 — only enters when YES is cheap (e.g. YES=11c, NO=87c)
MAKER_MM_MIN_PRICE=0.30 MAKER_MM_MIN_PRICE=0.30
MAKER_MM_MAX_PRICE=0.69 MAKER_MM_MAX_PRICE=0.69
+5 -3
View File
@@ -642,9 +642,11 @@ export async function executeMakerRebateStrategy(market) {
// Safety: ensure NO is also strictly below NO ask (maker) // Safety: ensure NO is also strictly below NO ask (maker)
if (noAsk && noBid >= noAsk) noBid = roundToTick(noAsk - ts, tickSize); if (noAsk && noBid >= noAsk) noBid = roundToTick(noAsk - ts, tickSize);
// Range check on NO bid // Sanity check on NO bid — only basic bounds, no range filter.
if (noBid < MIN_PRICE || noBid > MAX_PRICE) { // MIN/MAX_PRICE applies to YES only (entry condition), not NO.
logger.info(`MakerMM${tag}: waiting — NO bid $${noBid.toFixed(3)} (need ${MIN_PRICE}-${MAX_PRICE})`); // e.g. YES=11c + NO=87c is valid even though NO > MAX_PRICE.
if (noBid <= 0 || noBid >= 1) {
logger.info(`MakerMM${tag}: waiting — NO bid $${noBid.toFixed(3)} out of bounds`);
await sleep(POLL_SEC * 1000); await sleep(POLL_SEC * 1000);
continue; continue;
} }