Skip to main content

Reduce funds for SmartTrade

POST
/v2/smart_trades/:id/reduce_funds
Permission: SMART_TRADES_WRITE
Security: SIGNED

Starts the process of creating reduced funds.

New trades and orders will be created on the exchange once the process begins.


Path Parameter

idintegerrequired

Unique 3Commas ID for this SmartTrade entity.

Body Parameters

order_typeintegerrequired

Order type for reducing funds in this SmartTrade: market, limit.

unitsobjectrequired

Defines the amount of units to reduce in this SmartTrade.

Hide child parametersShow child parameters
valuenumberrequired

Specifies the number of units to sell.

priceobjectrequired

Provides pricing details for the limit order. This parameter is required if order_type is set to limit.

Hide child parametersShow child parameters
valuenumberrequired

Price for limit order

Example Request

POST
/v2/smart_trades/12345678/reduce_funds
{
"order_type": "limit",
"units": {
"value": "0.04"
},
"price": {
"value": "0.03711"
}
}

Response Parameters

If successful, the response includes an updated copy of the SmartTrade entity.

Example Responses

{
"id": 12345678,
"version": 2,
"account": {
"id": 32199203,
"type": "paper_trading",
"name": "Paper Account 1251857",
"market": "Binance Spot account simulator",
"link": "/accounts/32199203"
},
"pair": "BTC_ETH",
"instant": false,
"status": {
"type": "pending_reduce_funds",
"basic_type": "pending_reduce_funds",
"title": "Pending reduce funds"
},
"leverage": {
"enabled": false
},
"position": {
"type": "buy",
"editable": false,
"units": {
"value": "4.0",
"editable": false
},
"price": {
"value": "0.03719",
"value_without_commission": "0.03716",
"editable": false
},
"total": {
"value": "0.14878864"
},
"order_type": "market",
"status": {
"type": "finished",
"basic_type": "finished",
"title": "Finished"
}
},
"take_profit": {
"enabled": true,
"price_type": "value",
"steps": [
{
"id": 1224972676,
"order_type": "limit",
"editable": true,
"units": {
"value": "4.0"
},
"price": {
"type": "last",
"value": "0.04088",
"percent": null
},
"volume": "100.0",
"total": "0.16352",
"trailing": {
"enabled": false,
"percent": null
},
"status": {
"type": "order_placed",
"basic_type": "order_placed",
"title": "Placed"
},
"closed_at": null,
"data": {
"cancelable": true,
"panic_sell_available": true
},
"position": 1
}
]
},
"stop_loss": {
"enabled": false
},
"reduce_funds": {
"steps": [
{
"id": 1224983548,
"type": "market",
"status": {
"type": "idle",
"basic_type": "idle",
"title": "Pending"
},
"units": {
"value": "0.3995"
},
"price": {
"value": "0.03702",
"value_without_commission": "0.03702"
},
"total": {
"value": "0.01478949"
},
"closed_at": null,
"data": {
"cancelable": false,
"panic_sell_available": false
}
}
]
},
"market_close": {},
"note": "",
"note_raw": null,
"skip_enter_step": false,
"data": {
"editable": false,
"current_price": {
"day_change_percent": "-0.162",
"bid": "0.03702",
"ask": "0.03703",
"last": "0.03703",
"quote_volume": "1626.01355238"
},
"target_price_type": "price",
"orderbook_price_currency": "BTC",
"base_order_finished": true,
"missing_funds_to_close": "0.0",
"liquidation_price": null,
"average_enter_price": "0.03719",
"average_close_price": null,
"average_enter_price_without_commission": "0.03716",
"average_close_price_without_commission": null,
"panic_sell_available": true,
"add_funds_available": false,
"reduce_funds_available": false,
"force_start_available": false,
"force_process_available": true,
"cancel_available": true,
"finished": false,
"base_position_step_finished": true,
"entered_amount": "4.0",
"entered_total": "0.14878864",
"closed_amount": "0.0",
"closed_total": "0.0",
"commission": 0.001,
"created_at": "2024-12-17T15:44:49.405Z",
"updated_at": "2024-12-17T15:52:33.169Z",
"type": "smart_trade"
},
"profit": {
"volume": "-0.00085672",
"usd": "-91.0173245288",
"percent": "-0.58",
"roe": null
},
"margin": {
"amount": null,
"total": null
},
"is_position_not_filled": false
}