Reduce funds for SmartTrade
POST
/v2/smart_trades/:id/reduce_fundsStarts the process of creating reduced funds.
New trades and orders will be created on the exchange once the process begins.
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
- 201 Created
- 400 Bad Request
- 422 Unprocessable Entity
{
"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
}
{
"error": "Wrong param(s)",
"error_description": "Reduce funds is not allowed in the current status"
}
{
"error": "record_invalid",
"error_description": "Invalid parameters",
"error_attributes": {
"entered_amount": [
"Too small"
]
}
}