getting-started

Your first DEX Conditional Bot (Grid in Range, DCA in Downtrend)

Auto-switch which DEX bot runs based on ETH market regime

15 min + ongoing monitoring · intermediate

What you'll have when finished

  • Have one Conditional Bot orchestrating an existing Grid + DCA based on ETH regime
  • Understand the 3-tick hysteresis and why it prevents whipsaw
  • Be able to read the simulation panel before activating

Before you start

  • You must already have AT LEAST ONE inner DEX bot built (Grid / DCA / TV Webhook) — Conditional Bot orchestrates existing bots, it does NOT create them
  • Each inner bot can only be in ONE Conditional Bot at a time
  • Rule order matters — rules evaluate top-to-bottom and first match fires

Walkthrough

  1. Confirm you have at least one Grid Bot AND one DCA plan

    Open DEX Grid Bot → make sure you have at least one Armed bot (use [[dex-grid-bot-first-standard]] if not). Open DEX DCA → make sure you have at least one Active plan (use [[dex-dca-first-plan-on-base]] if not). The Conditional Bot dropdown will be empty without these.

    Success criteria: You see at least 1 Armed Grid Bot AND at least 1 Active DCA plan in their respective pages

  2. Open DEX Conditional Bot + click New

    DEX Trade → DEX Conditional Bot. Click New Conditional Bot. The rule editor opens with one empty rule and the reference asset dropdown.

    Success criteria: Rule editor is visible with Rule 1 placeholder

  3. Pick ETH as reference asset

    Reference asset dropdown at the top — pick ETH (smart-contract platforms regime). This is what the orchestrator polls for regime classification.

    Success criteria: Reference asset = ETH selected

  4. Configure Rule 1: Range regime → Grid Bot

    Rule 1 name = "Range → Grid". WHEN regime = Range, momentum = Any, min trend strength = empty. THEN = pick your Grid Bot from the Inner Bot dropdown (groups by type). This says: when ETH is ranging, run the grid.

    Success criteria: Rule 1 shows regime=Range AND your Grid Bot is selected as the THEN action

  5. Add Rule 2: Downtrend → DCA

    Click Add Rule. Rule 2 name = "Downtrend → DCA". WHEN regime = Downtrend (or Strong Downtrend if you want stricter). THEN = pick your DCA plan. This says: when ETH is dropping, switch to dollar-cost averaging in.

    Success criteria: Rule 2 shows regime=Downtrend AND your DCA plan as THEN action

  6. Add fallback Rule 3: Strong Downtrend → Pause all

    Click Add Rule. Rule 3 name = "Crash protection". WHEN regime = Strong Downtrend. THEN = Pause all inner bots. This is your panic exit — better to do nothing than run the wrong bot during a violent drop.

    Success criteria: Rule 3 shows regime=Strong Downtrend AND Pause all as THEN action

  7. Simulate before activating

    Click Simulate. The simulation panel shows current ETH regime (e.g., "Uptrend"), trend strength (-1 to 1), RSI, momentum direction, and which rule would match. If no rule matches, all inner bots stay in their current state. Read carefully — typos in rule logic show up here.

    Success criteria: Simulation panel shows current regime AND tells you which rule would fire (or "no rule matches")

  8. Activate + watch the worker

    Click Activate. The worker starts polling ETH OHLCV every minute. When ETH regime changes AND holds for 3 consecutive ticks (hysteresis), the orchestrator pauses the current inner bot and resumes the matching one. The expanded row shows recent regime classifications and switch events.

    Success criteria: Status = Active AND you can see the live regime polling in the expanded row

What's next

You have one autonomous orchestrator deciding which inner bot to run based on ETH regime. Monitor the switch log to validate the hysteresis prevents whipsaw. If you see a switch every 5 minutes, raise the hysteresis from 3 to 5. If you see no switches in days during obvious regime changes, lower it to 2.