PATCH

/api/v1/smart_trades/:id

Permission: SMART_TRADES_WRITESecurity: SIGNED

Updates an existing SmartTrade in place using its ID. Modifying SmartTrade parameters is available for entities in waiting_position or waiting_targets status.

Editing is supported only when the SmartTrade is in waiting_position (entry pending) or waiting_targets (position filled, waiting for TP/SL).
SmartTrade Entity

Path Parameter

idinteger required

Unique Quentrade ID for this SmartTrade entity.

Body Parameters

4
leverageobject

Details of the Leverage applied to this SmartTrade.

enabledboolean required

Enables leverage settings for this SmartTrade. Set to true to activate. Default: false

typestring

Leverage type for the futures account: cross or isolated.

valueinteger

Cross or isolated leverage multiplier value based on exchange rules and currency limits.

positionobject

Settings of the position applied to this SmartTrade (available if waiting_position).

unitsobject

Details of the units applied to this SmartTrade [value: number].

priceobject

Details of the price applied to this SmartTrade [value: number].

conditionalobject

Settings of conditional order: [order_type: string] (market, limit), [price: object] (type: bid/ask/last, value: number), and [trailing: object] (enabled: boolean, percent: number).

take_profitobject

Details of Take Profit settings and multi-target steps applied to this SmartTrade.

enabledboolean required

Enables Take Profit for this SmartTrade. Set to true to activate. Default: false

stepsarray[object]

Detailed conditions for each Take Profit step: [id: integer], [order_type: market/limit], [volume: number], [price: object] (type: bid/ask/last, value/percent: number), and [trailing: object] (enabled: boolean, percent: number min: 0.01 max: 100 for the last step).

stop_lossobject

Details of Stop Loss protection applied to this SmartTrade.

enabledboolean required

Enables Stop Loss for this SmartTrade. Set to true to activate. Default: false

breakevenboolean

Enables Move to Breakeven. Requires at least two Take Profit steps. Default: false

order_typestring required

Stop Loss type: market or limit. Required when stop_loss[enabled] is true.

priceobject

Direct price value configuration [value: number].

conditionalobject

Conditional Stop Loss settings [price: object (type, value, percent), trailing: object (enabled: boolean)].

timeoutobject

Timeout delay configuration [enabled: boolean, value: integer (in seconds)].

Response Parameters

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

Example Request

edit_smart_trade_request.json
PATCH /api/v1/smart_trades/:id
{
  "position": {
    "type": "buy",
    "units": {
      "value": "34.0"
    },
    "price": {
      "value": "0.00000442"
    }
  },
  "take_profit": {
    "enabled": true,
    "steps": [
      {
        "id": 1225026814,
        "order_type": "limit",
        "units": {
          "value": "34.0"
        },
        "price": {
          "type": "last",
          "value": "0.00000508"
        },
        "volume": "100.0",
        "total": "0.00017272",
        "trailing": {
          "enabled": false
        }
      }
    ]
  },
  "stop_loss": {
    "enabled": true,
    "order_type": "market",
    "conditional": {
      "price": {
        "type": "last",
        "value": "0.00000280"
      },
      "trailing": {
        "enabled": false
      }
    }
  }
}

Example Responses

Returns HTTP 200 OK on successful modification, or 400 Bad Request on validation or state conflict.

edit_smart_trade_200.json
200 OK
{
  "id": 32037964,
  "version": 2,
  "account": {
    "id": 32199203,
    "type": "paper_trading",
    "name": "Paper Account 1251857",
    "market": "Binance Spot account simulator",
    "link": "/accounts/32199203"
  },
  "pair": "BTC_1INCH",
  "instant": false,
  "status": {
    "type": "waiting_targets",
    "basic_type": "waiting_targets",
    "title": "Waiting Targets"
  },
  "leverage": {
    "enabled": false
  },
  "position": {
    "type": "buy",
    "editable": false,
    "units": {
      "value": "34.0",
      "editable": false
    },
    "price": {
      "value": "0.00000442",
      "value_without_commission": "0.00000442",
      "editable": false
    },
    "total": {
      "value": "0.00015043"
    },
    "order_type": "limit",
    "status": {
      "type": "finished",
      "basic_type": "finished",
      "title": "Finished"
    }
  },
  "take_profit": {
    "enabled": true,
    "price_type": "value",
    "steps": [
      {
        "id": 1317007688,
        "order_type": "limit",
        "editable": true,
        "units": {
          "value": null
        },
        "price": {
          "type": "last",
          "value": "0.00000508",
          "percent": null
        },
        "volume": "100.0",
        "total": null,
        "trailing": {
          "enabled": false,
          "percent": null
        },
        "status": {
          "type": "idle",
          "basic_type": "idle",
          "title": "Pending"
        },
        "closed_at": null,
        "data": {
          "cancelable": true,
          "panic_sell_available": false
        },
        "position": 1
      }
    ]
  },
  "stop_loss": {
    "enabled": true,
    "price_type": "value",
    "breakeven": false,
    "order_type": "market",
    "editable": true,
    "status": {
      "type": "idle",
      "basic_type": "idle",
      "title": "Pending"
    },
    "units": {
      "value": null
    },
    "total": {
      "value": null
    },
    "price": {
      "value": null,
      "percent": null
    },
    "closed_at": null,
    "conditional": {
      "price": {
        "value": "0.0000028",
        "type": "last",
        "percent": null
      },
      "trailing": {
        "enabled": false,
        "percent": null
      }
    },
    "timeout": {
      "enabled": false,
      "value": null
    }
  },
  "reduce_funds": {
    "steps": []
  },
  "market_close": {},
  "note": "",
  "note_raw": null,
  "skip_enter_step": false,
  "data": {
    "editable": true,
    "current_price": {
      "day_change_percent": "1.799",
      "bid": "0.00000283",
      "ask": "0.00000284",
      "last": "0.00000283",
      "quote_volume": "0.19732848"
    },
    "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.00000442",
    "average_close_price": null,
    "average_enter_price_without_commission": "0.00000442",
    "average_close_price_without_commission": null,
    "panic_sell_available": true,
    "add_funds_available": true,
    "reduce_funds_available": true,
    "force_start_available": false,
    "force_process_available": true,
    "cancel_available": true,
    "finished": false,
    "base_position_step_finished": true,
    "entered_amount": "34.0",
    "entered_total": "0.00015043028",
    "closed_amount": "0.0",
    "closed_total": "0.0",
    "commission": 0.001,
    "created_at": "2024-12-17T16:08:51.237Z",
    "updated_at": "2025-02-13T18:12:44.122Z",
    "type": "smart_trade"
  },
  "profit": {
    "volume": "-0.0000543065",
    "usd": "-5.188117714065",
    "percent": "-36.1",
    "roe": null
  },
  "margin": {
    "amount": null,
    "total": null
  },
  "is_position_not_filled": false
}