POST

/api/v1/smart_trades/:id/reduce_funds

Permission: SMART_TRADES_WRITESecurity: SIGNED

Starts the process of reducing funds from an active SmartTrade. New sell orders will be created on the exchange to partially close the position and lock in funds.

Ensure you check the maximum allowed reduction quantity with the Available reduce funds endpoint before calling this endpoint.
Available Reduce Funds

Path Parameter

idinteger required

Unique Quentrade ID for this SmartTrade entity.

Body Parameters

3
order_typestring required

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

unitsobject required

Defines the amount of units to reduce in this SmartTrade.

valuenumber required

Specifies the number of units to sell.

priceobject required

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

valuenumber required

Price for limit order.

Response Parameters

If successful, the response includes an updated copy of the SmartTrade entity with the new reduce_funds step and updated pending status.

Example Request

reduce_funds_request.json
POST /api/v1/smart_trades/:id/reduce_funds
{
  "order_type": "limit",
  "units": {
    "value": "0.04"
  },
  "price": {
    "value": "0.03711"
  }
}

Example Responses

Returns HTTP 201 Created on success, 400 Bad Request if status is invalid or amount exceeds quota, or 422 Unprocessable Entity on validation error.

reduce_funds_201.json
201 Created
{
  "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
}