Guide

DCA Bot

Automate long and short entries or exits with disciplined executions on dYdX perpetual markets.

A DCA bot executes a series of individual orders to build or unwind a position gradually, rather than entering or exiting all at once. Orders can be triggered by time intervals or price movement, helping smooth execution, reduce timing risk, and maintain consistency during volatile market conditions.

Configuration checklist

Mode

Controls when new orders are placed so the bot follows your timing thesis.

  • Time-based: orders place at fixed intervals no matter how the price moves.
  • Price-based: orders wait for the market to move by a defined percent before placing.

Direction

Decides how the bot adjusts the position.

  • Long builds exposure or trims shorts while short does the opposite.
  • Pick the bias that fits your trade direction.

Execution strategy

Currently taker-only so orders fill immediately even in fast or thin markets.

Order Size ($)

Defines the quote value for initial order.

Additional Orders

Controls how many follow-up orders arrive after the first execution.

  • Bot always places one initial order.
  • Additional Orders = 1 means you will have two total executions.

Take Profit (%)

Optional: closes the entire position once the market hits your profit target.

Stop Loss (%)

Optional: closes the entire position if price moves against your average entry beyond the threshold.

Continue After TP / SL

Determines what happens after a take-profit or stop-loss event.

  • Disabled -> bot stop after closing the position.
  • Enabled -> a fresh execution cycle begins automatically.

Price vs time

Mode-specific controls

Price-Based Mode

Price Gap & Martingale

  • Price Gap (%) defines how much the market must move before the next order triggers.
  • Size Change (%) controls how each order scales after executing (Martingale-style increases).

Time-Based Mode

Interval

  • Interval decides how frequently orders place regardless of price.
  • Align order execution timing with your strategy to prevent overtrading or prolonged inactivity.

Step-by-step creation flow

  1. Choose the market and direction you want to target (long or short).
  2. Pick your mode and timing thesis: time-based intervals or price-based gaps plus any martingale sizing.
  3. Set the initial order size and number of additional orders you want to spread across the execution cycle.
  4. Add optional Take Profit, Stop Loss, and Continue After TP/SL rules to control what happens when a goal or limit triggers.
  5. Review your capital requirements and confirm execution strategy before launching the bot.

Bot lifecycle behavior

  • With neither Take Profit nor Stop Loss enabled, the bot stops automatically after all configured orders (initial + additional) execute. Use this to build or exit positions.
  • When TP or SL is enabled, the bot watches the average entry price on dYdX. The position closes once TP or SL triggers, then either stops or restarts depending on your "Continue After TP/SL" setting.

When take-profit or stop-loss trigger, the bot closes the entire position on that market using the exchange’s average entry price. If you have any manually opened positions on the same market, those positions may be closed as well.

Avoid mixing manual and bot trades on the same market unless you fully understand the shared risk.

Risks & safety notes

  • DCA reduces timing risk but does not protect against strong directional trends that keep moving against you.
  • Martingale-style size increases drastically raise liquidation risk if the market keeps moving against the position.
  • Open positions may incur funding payments over time.
  • Make sure you have enough margin to support every planned order before starting the bot.