Deals
The Deal is a sub-entity of the DCA Bot. It represents a single automated transaction executed based on the bot's configured strategy.
The Deal entity holds the following information about:
Order type;
Trading pair(s);
Status of the deal;
Initial and realized trade amounts;
Initial and realized total values of the trade;
Price details, including entry, average, and final prices;
Position percentage reached during the trade;
Conditions related to trailing mechanisms and triggers (e.g., trailing stop enabled, trigger price).
Deals are created automatically by the DCA Bot based on predefined conditions and the selected trading strategy.
A Deal can include various trading stages or types, depending on the configuration, such as:
Initial trade opening;
Trailing take profit execution;
Stop-loss activation;
Safety orders placement;
Final trade closure.
Here, you can find methods and attributes to monitor, update, or analyze the details of deal.
Attributes
from_currency_id: 0, [TBD]
to_currency_id: 0, [TBD]
id integer
Unique 3Commas ID for this Deal entity
type string
The type of entity
bot_id integer
Unique 3Commas ID for this DCA Bot entity
bot_name string
DCA Bot name specified by the user
deal_has_error boolean
Indicates whether this Deal has encountered any errors (true
) or not (false
)
account_id integer
Unique 3Commas ID for this exchange account entity
account_name string
The name for the exchange account set by the user
created_at string
ISO 8601 datetime string of when this Deal entity was created
updated_at string
ISO 8601 datetime string of when this Deal entity was update last time
closed_at string
ISO 8601 datetime string of when this Deal entity was closed
finished? boolean
Indicates whether this Deal is finished (true
) or not (false
)
max_safety_orders integer
Maximum number of Safety Orders allowed for this Deal
active_safety_orders_count integer
The number of Safety Trades Deal is allowed to place in advance on the exchange's order book
current_active_safety_orders_count integer
[TBD]
current_active_safety_orders integer
Number of active Safety Orders at the current time
completed_safety_orders_count integer
Number of Safety Orders that have been completed
active_manual_safety_orders integer
Number of active manual Safety Orders at the current time
completed_manual_safety_orders_count integer
Number of manually executed Safety Orders that have been completed
safety_order_volume string
The volume of the Safety Order for this Deal
safety_order_step_percentage number
Price deviation in percentage to open Safety Orders
safety_order_volume_type string
The volume type for the Safety Order for this Deal
safety_strategy_list array[json]
Array of strategies specifically for the execution of your safety orders
cancellable? boolean
Indicates whether this Deal can be canceled (true) or not (false)
panic_sellable? boolean
Indicates whether this Deal can be closed at market price (true) or not (false)
trailing_enabled boolean
or null
Indicates whether trailing is enabled for Take Profit of this bot (true
) or not (false
)
tsl_enabled boolean
Indicates whether trailing is enabled for Stop Loss (true) or not (false) for this Deal
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 for this Deal
pair strign
Trading pair(s) in 3Commas format
status string
3Commas status for this Deal
localized_status string
Brief description of this status
take_profit_type string
Type of take profit calculation (e.g. base
, total
)
take_profit number
Percentage value for the deal’s Take Profit
take_profit_steps object
Details of the Take Profit and its steps applied to this Deal
id string
[TBD]
amount_percentage string
[TBD]
profit_percentage string
The specific percentage of the price set to trigger this Take Profit trade
editable boolean
Indicates whether the user can modify the settings of trade when editing Deal (true
) or not (false
)
panic_sellable boolean
[TBD]
trade_id string
Unique 3Commas Trade entity ID
execution_timestamp string
or null
The timestamp of when the deal was executed, in ISO 8601 format, or null
if not yet executed
initial_amount string
[TBD]
price string
[TBD]
status string
[TBD]
take_profit_price string
[TBD]
base_order_volume number
The volume of the base order for this Deal Bot
leverage_type string
Type of leverage applied for this Deal
leverage_custom_value string
or null
The leverage value set by the user
bought_amount string
The amount of the purchased asset
bought_volume string
The volume of purchased assets in the base currency
bought_average_price string
The average price of the purchased asset
base_order_average_price string
The average price of the base order
sold_amount string
The amount of the sold asset
sold_volume string
The volume of sold assets in the base currency
sold_average_price string
The average price at which the asset was sold
final_profit: "-3.35618503", The final profit from the deal
martingale_coefficient number
[TBD]
martingale_volume_coefficient number
Coefficient for increasing safety order volume in Martingale strategy
martingale_step_coefficient number
Coefficient for increasing safety order price in Martingale strategy
stop_loss_percentage number
Stop loss percentage for this Deal
sl_to_breakeven_enabled boolean
Indicates whether enables the Move to Breakeven feature for this Deal (true
) or not (false
)
sl_to_breakeven_data json
The upper limit to which the stop loss will move Example: {upper_breakeven_limit: 1}
error_message: null, Description of the error for this Deal if it fails
profit_currency> string
Currency used for the profit from the trades executed by this bot
stop_loss_type string
Specifies the type of action the Deal performs when Stop Loss is triggered after closing a deal
base_order_volume_type string
Volume type for base orders (e.g., quote_currency
, base_currency
, percent
)
from_currency: "USDT", [TBD]
to_currency: "ETH", [TBD]
final_profit_percentage string
The final profit percentage from the deal
usd_final_profit string
The final profit expressed in USD
actual_profit: "-7.69294593", [TBD]
actual_usd_profit: "-7.69294593", [TBD]
failed_message: null, [TBD]
trailing_deviation number
Percentage value of the trailing price, in percent
trailing_max_price string
or null
[TBD]
tsl_max_price string
or null
[TBD]
strategy string
Type of strategy used by the bot: long
or short
last_known_position_info string
or null
min_profit_percentage string
The minimum profit percentage needed to reach for completing a deal, applicable to the close strategy of Take Profit
min_profit_type string
or null
The type of minimum profit used as the basis for profit calculation in this Deal, applicable to the close strategy of Take Profit
close_strategy_list array[json]
An array of strategies used for closing deal
note string
Optional user-defined note for this Deal
add_fundable boolean
Indicates whether adding funds is available for this Deal (true
) or (not
)
smart_trade_convertable boolean
Indicates if this deal was converted to SmartTrade (true
) or not (false
)
market_type: "spot", [TBD] Type of strategy used by the bot (e.g., long, short)
current_price: "2428.0", [TBD]
stop_loss_price: null, [TBD]
actual_profit_percentage string
[TBD]
reserved_quote_funds string
[TBD]
reserved_base_funds string
[TBD]
reserved_base_coin: string
[TBD]
reserved_second_coin string
[TBD]
orderbook_price_currency: "USDT", [TBD]
crypto_widget object
buy_steps array
bot_events array
message [TBD]
created_at [TBD]
Last updated
Was this helpful?