> 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/grid-bot.md).

# Grid Bot

**Grid Bot** entities are designed to automate trading strategies by executing a series of buy and sell orders within predefined price ranges. They allow users to take advantage of market fluctuations while minimizing manual intervention.<br>

**Grid Bot** entities hold information such as:<br>

* Configuration details for the bot, including the trading pair, strategy type, and grid settings;
* Performance metrics like current profit, total profits, and investment amounts in base and quote currencies;
* Status indicators, such as whether the bot is enabled or disabled and whether stop-loss actions are set.<br>

  3Commas offers a range of tools to create new Grid Bots, manage their settings, and analyze their performance effectively.\ <br>

  ### Attributes<br>

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

  **account\_id**     `integer`\
  Unique 3Commas ID of this exchange account entity where this Grid Bot was created

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

  **is\_enabled**     `boolean`\
  Indicates if the Grid Bot is enabled

  **grids\_quantity**     `string`\
  Number of grid lines set in the bot configuration

  **created\_at**     `string`\
  ISO 8601 datetime string of when this Grid Bot was created<br>

  **updated\_at**     `string`\
  ISO 8601 datetime string of when this Grid Bot was last updated

  **strategy\_type**     `string`\
  Strategy type for the bot (e.g., manual)

  **upper\_stop\_loss\_enabled**     `boolean`\
  Shows if the upper stop-loss is enabled<br>

  **lower\_stop\_loss\_enabled**     `boolean`\
  Shows if the lower stop-loss is enabled

  **note**     `string`\
  Optional user-defined note about the Grid Bot

  **editable**     `boolean`\
  Indicates if the bot configuration can be edited

  **lower\_price**     `string`\
  Lower price limit for the Grid Bot

  **lower\_stop\_loss\_price**     `string`\
  Lower stop-loss price, if set

  **lower\_stop\_loss\_action**     `string`\
  Action to take if the lower stop-loss is triggered (e.g., stop\_bot)

  **upper\_price**     `string`\
  Upper price limit for the Grid Bot

  **upper\_stop\_loss\_price**     `string`\
  Upper stop-loss price, if set

  **upper\_stop\_loss\_action**     `string`\
  Action to take if the upper stop-loss is triggered (e.g., stop\_bot)<br>

  **quantity\_per\_grid**     `string`\
  Quantity of the asset per grid line

  **leverage\_type**     `string`\
  Shows the leverage type that was set when creating a Grid Bot (e.g., cross)<br>

  **leverage\_custom\_value**     `string`\
  Custom leverage value set for the Grid Bot

  **name**     `string`\
  Name of the Grid Bot

  **pair**     `string`\
  Trading pair in 3Commas format for the bot

  **start\_price**     `string`\
  Starting price of the asset when the bot was created

  **grid\_price\_step**     `string`\
  Price step value between each grid line

  **current\_profit**     `string`\
  Current profit in base currency

  **current\_profit\_usd**     `string`\
  Current profit in USD

  **total\_profits\_count**     `string`\
  Total number of profitable transactions

  **profit\_percentage**     `string`\
  Percentage profit relative to the starting investment

  **current\_price**     `string`\
  Current price of the trading pair<br>

  **max\_active\_buy\_lines**     `string`\
  Maximum number of active buy orders allowed

  **max\_active\_sell\_lines**     `string`\
  Maximum number of active sell orders allowed

  **order\_currency\_type**     `string`\
  Currency type used for orders (e.g., quote)

  **profit\_currency\_type**     `string`\
  Currency type used for profit calculation (e.g., quote)

  **trailing\_up\_enabled**     `boolean`\
  Shows if the trailing-up feature is enabled

  **grid\_type**     `string`\
  Type of grid used (e.g., \`geometric\`)<br>

  **investment\_base\_currency**     `string`\
  Investment amount in the base currency

  **investment\_quote\_currency**     `string`\
  Investment amount in the quote currency

  **unrealized\_profit\_loss**     `string`\
  Unrealized profit or loss in base currency

  **current\_profit\_loss**     `string`\
  Current profit or loss in base currency

  **current\_profit\_loss\_percent**     `string`\
  Percentage of current profit or loss

  **orderbook\_price\_currency**     `string`\
  Currency used for the order book price

  **expansion\_down\_enabled**     `boolean`\
  Shows if the grid expansion downwards is enabled

  **expansion\_down\_stop\_price**     `string`\
  Stop price for downward expansion, if set

  **grid\_lines**     `object`\
  An array of grid line orders associated with this Grid Bot

  &#x20;     **id**     `integer`\
  &#x20;     ID of the Grid Line entity

  &#x20;     **price**     `string`\
  &#x20;     Price value of this grid line

  &#x20;     **side**     `string`\
  &#x20;     The order side for this grid line (e.g., \`buy\` or \`sell\`)<br>

  &#x20;     **order\_placed**     `boolean`\
  &#x20;     Indicates if the order for this grid line has been placed<br>
