Trading
DEX Conditional Bot (regime-switching orchestrator)
10 min read
What it is
Watches a reference asset's market regime (BTC/ETH/SOL or 7 others) and activates ONE of your inner DEX bots per regime — Grid Bot when ranging, DCA when trending down, TradingView Webhook when strong uptrend etc. Mirrors the CEX Conditional Bot logic verbatim but orchestrates DEX bots instead. Hysteresis built in: the regime must hold for 3 consecutive ticks before a switch fires, preventing whipsaw between regimes.
How to think about it
A grid bot prints money when markets range and loses when they trend. A DCA bot prints money when prices rise long-term and feels bad when ranging. The Conditional Bot solves this by picking the right inner bot AUTOMATICALLY based on classified market regime. Build your Grid Bot once, your DCA plan once, your TV Webhook once — then write 2-3 rules that say "when ETH is ranging, run the grid; when trending, run the DCA". The orchestrator does the switching.
Step-by-step
-
Build your inner bots first
Conditional Bot requires at least one existing DEX bot to orchestrate. Pre-create: a Grid Bot for range markets, a DCA plan for downtrends, a TradingView Webhook for trend-following triggers. The Inner Bot Picker dropdown groups them by type and shows their status — only "usable" (armed/active) bots can be selected.
-
Pick a reference asset for regime classification
10 supported assets: BTC (macro-wide regime), ETH (smart-contract platforms), SOL (alt-L1 risk-on), AVAX, LINK, ARB, OP, BNB, ADA, DOGE. BTC is the default — its regime tends to drive the rest of crypto. Pick a more specific asset if your inner bots are LINK-pair or ARB-pair specific.
-
Add 2-4 rules
Each rule has a WHEN clause (regime + optional momentum + optional min trend strength) and a THEN clause (activate one specific inner bot OR Pause all). The first matching rule fires per tick. Rules are evaluated top-to-bottom. Typical rule set: (1) Strong Uptrend → DCA, (2) Range → Grid Bot, (3) Strong Downtrend → Pause all.
-
Set hysteresis ticks (default 3)
How many consecutive ticks the new regime must hold before the bot switches. Lower = more responsive but more whipsaw between regimes. Higher = more stable but slower to adapt. 3 is the validated default (live-tested May 2026) that mirrors the CEX implementation.
-
Simulate before activating
Click Simulate to fetch the current regime + show which rule would fire and what inner bot would activate. The simulation panel shows trend strength, RSI, momentum direction, and the matched rule. Useful for verifying your rule logic before turning the bot on with live capital.
-
Activate
Click Activate. The worker starts polling the reference asset OHLCV every minute. When the regime changes and holds for the hysteresis tick count, the orchestrator pauses the current inner bot and resumes the matching one. Per-switch event log is visible in the expanded row.
-
Monitor + adjust
Expanded row shows: current regime, current active inner bot, recent switches, last tick timestamp, simulated next switch if regime is about to flip. Use the Edit button to update rules without rebuilding the whole bot. Use Pause to freeze the orchestrator without losing the rule config.
Tips & pitfalls
- You orchestrate EXISTING bots — Conditional Bot does not create them. If you have not built a Grid Bot, DCA plan, and at least one TV Webhook, build those first. The Inner Bot dropdown will be empty otherwise.
- Live-validated May 2026: returned "Downtrend" on ETH/USDT with trend -0.50 and RSI 28 from binanceus. Same classifyRegime math as CEX — if it works on CEX, it works here.
- Hysteresis 3 ticks (= 3 minutes at the default polling rate) prevents flapping. If the regime is Range but momentarily flickers to Volatile for 1 tick before going back, no switch fires. Only when 3 consecutive ticks show Volatile does the switch fire.
- Rules fire top-to-bottom — order matters. A "Range → Grid" rule placed below a more general "Any regime → Pause all" rule will never fire because the Any-rule swallows everything first. Place specific rules above general ones.
- Pause all is the panic exit. Use it as the fallback for Strong Downtrend or Volatile regimes when none of your inner bots are appropriate — better to do nothing than to run the wrong bot.
- The simulation panel does NOT execute any trade. It just classifies the current regime and shows which rule would match. Use it liberally before activating to catch typos in your rule logic.
- Each inner bot can only be in ONE Conditional Bot at a time. If you try to assign the same Grid Bot to two different Conditional Bots, the orchestrator will warn you about the conflict.
- Switching cost is zero — pausing/resuming inner bots does not cancel their pre-signed orders. A Grid Bot paused by the orchestrator can be re-armed instantly when the regime returns; no re-signing needed.