> 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/smarttrade/trades.md).

# Trades

The **Trade** is a sub-entity of SmartTrade. Each trade entity includes the conditions set for its specific trade type.

The **Trade** entity holds the following information about:

* Order type ;
* Trading pair; Trade status;
* Initial and realized amounts;
* Initial and realized total values;
* Price values, including initial, average, and realized prices;
* Position percentage for the trade;
* Conditions related to trailing and triggers (e.g., trailing enabled, trigger price).

Each trade is created automatically by 3Commas based on the conditions set within the SmartTrade entity.

Depending on the conditions set within SmartTrade, a trade can be one of the following types:

* Position trade;
* Take profit trade;
* Stop-loss trade;
* Reduce funds trade;
* Market close trade.

Here you will find a set of methods to manage these trades.

<br>

## Attributes<br>

**id**     `integer`\
Unique 3Commas Trade entity ID<br>

**average\_price**     `null` or`string`\
The weighted average price at which the asset was bought or sold during the execution of the trades<br>

**follow\_price\_type**     `string`\
The type of price to follow for this trade (f.e. `bid`,`ask` or `last`)<br>

**initial\_amount**     `string`\
The initial amount for this trade<br>

**initial\_total**     `string`\
The initial total for this trade<br>

**initial\_price**     `number`\
The initial price for this trade<br>

**order\_price**     `null` or `string`\
The limit price for this trade<br>

**order\_side**     \
`string`\
The side of the order to be created by this trade<br>

<details>

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

* Buy
* Sell

</details>

<br>

**order\_type**     `string`\
The type of order used to open the position trade<br>

<details>

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

* Market
* Limit
* Conditional

</details>

<br>

**pair**     `string`\
Trading pair in 3Commas format for this trade<br>

**position\_percentage**     `null` or `string`\
Percentage of the step in Take Profit. This field is only filled if `trade_purpose` is `take_profit`<br>

**realised\_amount**     `string` or `null`\
Indicates the realized amount from the trade<br>

**realised\_total**     `string` or `null`\
Indicates the total realized amount from the trade<br>

**realised\_percentage**     `number`\
Indicates the realized percentage of the total trade amount<br>

**realised\_price**     `number` or`null`\
Indicates the realized price of the trade<br>

**status**     `string`\
3Commas status for this Trade<br>

**take\_profit\_percentage**     `string` or `null`\
The percentage price level for Take Profit for this Trade<br>

**trade\_purpose**     `string`\
The type of trade<br>

<details>

<summary><strong>Show allowed values</strong></summary>

* position
* take\_profit
* stop\_loss
* reduce\_funds

</details>

<br>

**trail\_percentage**     `string` or `null`\
Indicates the percentage deviation from the price for this trade<br>

**trail\_value**     `string` or `null`\
Indicates the deviation from the price calculated by 3Commas for this trade<br>

**trailing\_enabled**     `boolean` Indicates whether the trailing settings for this trade can be edited<br>

**trailing\_last\_price**     `string` or `null`\
Indicates the last price used for trailing<br>

**trailing\_last\_price\_updated\_at**     `number` or `null`\
Indicates the timestamp of the last update to the trailing price<br>

**trigger\_condition**     `number` or `null`\
Indicates the condition under which the trigger is activated<br>

<details>

<summary><strong>Show allowed values</strong></summary>

* greater
* less
* greater\_or\_equal
* less\_or\_equal

</details>

<br>

**trigger\_price**     `string` or `null`\
Indicates the price at which the trigger is activated<br>

**trigger\_price\_percentage**     `string` or `null`\
Indicates the percentage for the trigger price<br>

**trigger\_type**     `string`\
Indicates the type of trigger for the trade<br>

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

**updated\_at**     `string`\
ISO 8601 datetime string of when this Trade entity was updated<br>

**cancelable**     `boolean`\
Indicates whether this trade can be canceled<br>

**force\_processable**     `boolean`\
Indicates whether this Trade can be close by market<br>
