From caca6d29b673f682442cf89881134c021c9125c9 Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Sun, 15 Mar 2026 20:44:13 -0700 Subject: [PATCH] Feat: Add Don't Doubt Bull strategy --- lib/strategies/dont-doubt-bull.js | 50 +++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 lib/strategies/dont-doubt-bull.js diff --git a/lib/strategies/dont-doubt-bull.js b/lib/strategies/dont-doubt-bull.js new file mode 100644 index 0000000..0d3f646 --- /dev/null +++ b/lib/strategies/dont-doubt-bull.js @@ -0,0 +1,50 @@ +import { BaseStrategy } from './base.js'; + +export class DontDoubtBullStrategy extends BaseStrategy { + constructor(config = {}) { + super('dont-doubt-bull', { + minYesPct: config.minYesPct || 30, + maxYesPct: config.maxYesPct || 40, + betSize: config.betSize || 2, + cooldownMs: config.cooldownMs || 60000, + ...config + }); + + this.lastTradeTime = 0; + this.lastTradeTicker = null; + } + + evaluate(state) { + if (!state || !this.enabled || !state.closeTime) return null; + + const now = Date.now(); + if (now - this.lastTradeTime < this.config.cooldownMs) return null; + if (state.ticker === this.lastTradeTicker) return null; + + // 15 minute market total. First 1-5 minutes means 10 to 14 mins left. + const timeLeftMs = new Date(state.closeTime).getTime() - now; + const minsLeft = timeLeftMs / 60000; + + if (minsLeft > 14 || minsLeft < 10) return null; // Outside our time window + + const { yesPct } = state; + + // Buy Yes if it's struggling early on + if (yesPct >= this.config.minYesPct && yesPct <= this.config.maxYesPct) { + const signal = { + strategy: this.name, + side: 'yes', + price: yesPct, + size: this.config.betSize, + reason: `Early Bullish Dip: ${minsLeft.toFixed(1)}m left, Yes @ ${yesPct}ยข`, + ticker: state.ticker + }; + + this.lastTradeTime = now; + this.lastTradeTicker = state.ticker; + return signal; + } + + return null; + } +}