> For the complete documentation index, see [llms.txt](https://3commas.gitbook.io/3commas-official-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://3commas.gitbook.io/3commas-official-api-docs/dca-bot.md).

# DCA Bot

The **DCA Bot** allows users to automate trading on the exchange by following a Dollar Cost Averaging strategy.

DCA Bot entity contains a set of parameters and conditions that manage deals.

3Commas provides methods to create and manage DCA Bot entities and their associated deals.

Each **DCA Bot** entity holds information, including:

* Exchange account and trading pairs;
* Strategy configuration and active deals;
* Take Profit and Stop Loss settings;
* Safety Orders configuration for risk management;
* Trading cooldowns and limits.

<br>

The process starts with configuring a **DCA Bot**, where all trading conditions, such as base and safety orders, take profit, and stop loss, are set. The bot automatically creates and manages deals based on the configured strategy.

## Attributes<br>

**id**     `integer`\
Unique 3Commas ID for this DCA Bot entity

**account\_id**     `integer`\
Unique 3Commas ID for this exchange account entity

**is\_enabled**     `boolean`\
Indicates whether DCA Bot is currently enabled (`true`) or not (`false`)

**pairs**     `strign`\
Trading pair(s) in 3Commas format

**strategy\_list**     `array[json]`\
An array of strategies used for opening deals in this DCA Bot

**close\_strategy\_list**     `array[json]`\
An array of strategies used for closing deals in this DCA Bot

**safety\_strategy\_list**     `array[json]`\
Array of strategies specifically for the execution of your safety orders in this DCA Bot

**max\_active\_deals**     `integer`\
The maximum number of active deals available for this DCA Bot. Default: `1`

**active\_deals\_count**     `strign`\
The current number of active deals managed by this bot

**deletable?**     `boolean`\
Indicates whether this DCA Bot can be deleted (`true`) or not (`false`)

**created\_at**     `string`\
ISO 8601 datetime string of when this DCA Bot entity was created

**updated\_at**     `string`\
ISO 8601 datetime string of when this DCA Bot entity was update last time

**trailing\_enabled**     `boolean`\
Indicates whether trailing is enabled for Take Profit of this bot (`true`) or not (`false`)

**trailing\_deviation**     `number`\
Percentage value of the trailing price, in percent

**tsl\_enabled**     `boolean`\
Indicates whether trailing is enabled for Stop Loss (true) or not (false) for this DCA Bot

**deal\_start\_delay\_seconds**     `integer` or `null`\
Delay in seconds before a next deal starts

**stop\_loss\_timeout\_enabled**     `boolean`\
Indicates if the Stop Loss timeout is active (`true`) or not (`false`)

**stop\_loss\_timeout\_in\_seconds**     `integer`\
Duration of the Stop Loss timeout in seconds

**disable\_after\_deals\_count**     `integer`\
The number of deals after that the bot will be switched to disabled (is\_enabled: `false`)

**deals\_counter**     `integer`\
Tracks the number of deals executed by the bot (считает именно для disable\_after\_deals\_count - поправить описание!)

**allowed\_deals\_on\_same\_pair**     `integer` or `null`\
Number of active deals allowed with the same trading pair simultaneously.\
It worls only for bot where `type` is `Bot::MultiBot`

**close\_deals\_timeout**     `integer` or `null`\
The time in seconds after which the deals will close automatically

**url\_secret**      `string`\
Unique code this DCA Bot using for copying this bot

**take\_profit\_type**     `string`\
Type of take profit calculation (e.g. `base`, `total`)

**take\_profit**     `number`\
Percentage value for the bot’s Take Profit

**take\_profit\_steps**     `object`\
Details of the Take Profit and its steps applied to this DCA Bot

&#x20;    **id**     `integer`\
&#x20;    Step number of Take Profit

&#x20;    **amount\_percentage**     `string`\
&#x20;    The percentage of the base order volume to be allocated for this Take Profit step

&#x20;    **profit\_percentage**     `string`\
&#x20;    The specific profit percentage applied to the volume of units for this Take Profit step

**name**     `string`\
Name assigned to the bot

**base\_order\_volume\_type**     `string`\
Volume type for base orders (e.g., `quote_currency`, `base_currency`, `percent`)

**base\_order\_volume**     `number`\
The volume of the base order for this DCA Bot

**safety\_order\_volume\_type**     `string`\
The volume type for the Safety Order in this DCA Bot

**safety\_order\_volume**     `string`\
The volume of the Safety Order for this DCA Bot

**safety\_order\_step\_percentage**     `number`\
Price deviation in percentage to open Safety Orders

**max\_safety\_orders**     `integer`\
Maximum number of Safety Orders allowed for per deal

**active\_safety\_orders\_count**     `integer`\
The number of active Safety Orders the DCA Bot is allowed to place at one time

**min\_profit\_type**     `null` or `string`\
The type of minimum profit used as the basis for profit calculation in this DCA Bot, applicable to the close strategy of Take Profit

**min\_profit\_percentage**     `null` or `string`\
The minimum profit percentage which need to reach for this DCA Bot to complete a deal, applicable to the close strategy of Take Profit

**type**     `string`\
The type of DCA Bot, based on the number of pairs.\
If a single pair is passed, a `Bot::SingleBot` is created;\
If two or more pairs are passed, a `Bot::MultiBot` is created

**martingale\_volume\_coefficient**     `number`\
Coefficient for increasing *safety order volume* in Martingale strategy

**martingale\_step\_coefficient**     `number`\
Coefficient for increasing safety order price (`safety_order_step_percentage`) in Martingale strategy

**stop\_loss\_type**     `string`\
Specifies the type of action the bot performs when Stop Loss is triggered after closing a deal

<details>

<summary><em>Allowed values</em></summary>

* `stop_loss` - closes the deal without disabling the bot;
* `stop_loss_and_disable_bot` - closes the deal and disables the bot.

</details>

**stop\_loss\_percentage**     `number`\
Stop loss percentage for this bot

**stop\_loss\_timeout\_enabled**     `boolean`\
Indicates if the Stop Loss timeout is active

**stop\_loss\_timeout\_in\_seconds**     `integer`\
Duration of the Stop Loss timeout in seconds

**cooldown**     `number`\
The waiting time between closing a deal and accepting a signal to create a new deal for the same asset pair (sec.)

**strategy**     `string`\
Type of strategy used by the bot (e.g., `long`, `short`)

**min\_volume\_btc\_24h**     `number`\
The minimum trading volume in BTC over the last 24 hours required to open a deal

**profit\_currency**     `string`\
Currency used for the profit from the trades executed by this bot

**min\_price**     `null` or `string`\
Minimum price at which the new deal will open for thi DCA Bot

**max\_price**     `null` or `string`\
Maximum price at which the new deal will open for thi DCA Bot

**account\_name**     `string`\
The name for the exchange account set by the user

**trailing\_deviation**      `number`\
Percentage value of the trailing price, in percent

**finished\_deals\_profit\_usd**     `string`\
\[TBD]

**finished\_deals\_count**     `string`\
Total number of deals finished by DCA Bot

**leverage\_type**     `string`\
Type of leverage applied for this DCA Bot<br>

<details>

<summary><em>Allowed value</em></summary>

* **cross** - uses all available funds in your account as collateral for your trades;
* **isolated** - the margin is limited to a specific position;
* **not\_specified** - no leverage type specified for this DCA Bot;

</details>

**leverage\_custom\_value**     `string`\
The leverage value set by the user

**start\_order\_type**     `string`\
Type of order to start deals with (e.g., `limit`, `market`).

**active\_deals\_usd\_profit**     `string`\
Total USD profit from active deals

**risk\_reduction\_percentage**     `number`\
Percentage of losses reduction applied for this DCA Bot

**reinvesting\_percentage**     `number`\
The percentage of realized profit to be reinvested into each new deal

**reinvested\_volume\_usd**     `null` or `number`\
USD volume reinvested from profit

**min\_price\_percentage**     `null` or `string`\
Minimum price percentage for bot activation (only for Multy bot)

**max\_price\_percentage**     `null` or `string`\
Max price percent (only for Multy bot)

**active\_deals**     `array`<br>

List of active [deals](/3commas-official-api-docs/dca-bot/deals.md) managed by this DCA Bot
