From eec97eb1e574afddd575e8badd2331fcea78b7a8 Mon Sep 17 00:00:00 2001 From: direkturcrypto Date: Tue, 31 Mar 2026 14:27:55 +0700 Subject: [PATCH] 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 --- .env.example | 6 ++++-- src/services/makerRebateExecutor.js | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 0236346..fd77233 100644 --- a/.env.example +++ b/.env.example @@ -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 MAKER_MM_REENTRY_ENABLED=true -# Price range for maker rebate eligibility (both sides must be in range) -# Polymarket rebates are earned on orders within ~30-70% range +# YES bid price range — bot only enters when YES bid is within this 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_MAX_PRICE=0.69 diff --git a/src/services/makerRebateExecutor.js b/src/services/makerRebateExecutor.js index 73653c9..a53bf16 100644 --- a/src/services/makerRebateExecutor.js +++ b/src/services/makerRebateExecutor.js @@ -642,9 +642,11 @@ export async function executeMakerRebateStrategy(market) { // Safety: ensure NO is also strictly below NO ask (maker) if (noAsk && noBid >= noAsk) noBid = roundToTick(noAsk - ts, tickSize); - // Range check on NO bid - if (noBid < MIN_PRICE || noBid > MAX_PRICE) { - logger.info(`MakerMM${tag}: waiting — NO bid $${noBid.toFixed(3)} (need ${MIN_PRICE}-${MAX_PRICE})`); + // Sanity check on NO bid — only basic bounds, no range filter. + // MIN/MAX_PRICE applies to YES only (entry condition), not NO. + // 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); continue; }