> For the complete documentation index, see [llms.txt](https://3commas.gitbook.io/3commas-official-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://3commas.gitbook.io/3commas-official-api-docs/smarttrade/5.-add-funds-for-smarttrade.md).

# Add funds for SmartTrade

**Description:** Adds funds in SmartTrade, increasing the volume of the trade and averaging the price at any moment<br>

{% hint style="warning" %}
The endpoint is available for SmartTrades with statuses `waiting_position` and `waiting_targets`, but not for SmartTrades with trailing enabled, or for the types `simple_buy` and `simple_sell`.
{% endhint %}

<br>

**Permission:** SMART\_TRADES\_WRITE\
**Security:** SIGNED\
\ <br>

***

<mark style="color:green;">**POST**</mark>

<mark style="color:green;">**/v2/smart\_trades/{id}/add\_funds**</mark>

***

\ <br>

## Parameters request<br>

| Name     | Type    | Mandatory | Values | Description                                  |
| -------- | ------- | --------- | ------ | -------------------------------------------- |
| **`id`** | integer | Yes       | -      | Unique 3Commas ID for this SmartTrade entity |

\ <br>

## Parameter response<br>

{% hint style="info" %}
If successful, the response includes a update copy of [SmartTrade](/3commas-official-api-docs/smarttrade.md) entity.
{% endhint %}

\ <br>

## Example Response and errors<br>

<details>

<summary>Status: 201 Created</summary>

<br>

```json
{
    "id": 30415988,
    "version": 2,
    "account": {
        "id": 32402783,
        "type": "binance_us",
        "name": "My Binance US",
        "market": "Binance US Spot",
        "link": "/accounts/32402783"
    },
    "pair": "USDT_DOGE",
    "instant": false,
    "status": {
        "type": "waiting_targets",
        "basic_type": "waiting_targets",
        "title": "Waiting Targets"
    },
    "leverage": {
        "enabled": false
    },
    "position": {
        "type": "buy",
        "order_type": "market",
        "editable": false,
        "units": {
            "value": "43.736",
            "editable": false
        },
        "price": {
            "value": "0.10457",
            "value_without_commission": "0.10394",
            "editable": false
        },
        "total": {
            "value": "4.57371",
            "value_without_commission": "4.54626774"
        },
        "status": {
            "type": "finished",
            "basic_type": "finished",
            "title": "Finished"
        }
    },
    "take_profit": {
        "enabled": true,
        "price_type": "value",
        "steps": [
            {
                "id": 1007239535,
                "order_type": "limit",
                "editable": true,
                "units": {
                    "value": "43.0"
                },
                "price": {
                    "type": "last",
                    "value": "0.1098",
                    "percent": "5.0"
                },
                "volume": "100.0",
                "total": "4.7214",
                "trailing": {
                    "enabled": false,
                    "percent": null
                },
                "status": {
                    "type": "order_placed",
                    "basic_type": "order_placed",
                    "title": "Placed"
                },
                "data": {
                    "cancelable": true,
                    "panic_sell_available": true
                },
                "position": 1
            }
        ]
    },
    "stop_loss": {
        "enabled": true,
        "price_type": "value",
        "breakeven": false,
        "order_type": "market",
        "editable": true,
        "price": {
            "value": null,
            "percent": null
        },
        "conditional": {
            "price": {
                "value": "0.10056",
                "type": "last",
                "percent": null
            },
            "trailing": {
                "enabled": false,
                "percent": null
            }
        },
        "timeout": {
            "enabled": false,
            "value": null
        },
        "status": {
            "type": "to_process",
            "basic_type": "to_process",
            "title": "Pending"
        }
    },
    "reduce_funds": {
        "steps": []
    },
    "market_close": {},
    "note": "",
    "note_raw": null,
    "skip_enter_step": false,
    "data": {
        "editable": true,
        "current_price": {
            "bid": "0.10244",
            "ask": "0.10265",
            "last": "0.1025",
            "quote_volume": "255295.82542",
            "day_change_percent": "-2.539"
        },
        "target_price_type": "price",
        "orderbook_price_currency": "USDT",
        "base_order_finished": true,
        "missing_funds_to_close": "0.0",
        "liquidation_price": null,
        "average_enter_price": "0.10457",
        "average_close_price": null,
        "average_enter_price_without_commission": "0.10394",
        "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": "43.736",
        "entered_total": "4.57371",
        "closed_amount": "0.0",
        "closed_total": "0.0",
        "commission": 0.001,
        "created_at": "2024-08-13T16:19:42.870Z",
        "updated_at": "2024-08-14T15:06:56.792Z",
        "type": "smart_trade"
    },
    "profit": {
        "volume": "-0.09787447584",
        "usd": "-0.09787447584",
        "percent": "-2.14",
        "roe": null
    },
    "margin": {
        "amount": null,
        "total": null
    },
    "is_position_not_filled": false
}
```

</details>

<details>

<summary>Status: 400 Bad Request</summary>

<br>

```json
{
    "error": "record_invalid",
    "error_description": "Invalid parameters",
    "error_attributes": {
        "order_type": [
            "is missing",
            "does not have a valid value"
        ],
        "units": [
            "is missing"
        ],
        "units[value]": [
            "is missing"
        ]
    }
}
```

</details>

<details>

<summary>Status: 422 Unprocessable Entity</summary>

<br>

```json
{
    "error": "record_invalid",
    "error_description": "Invalid parameters",
    "error_attributes": {
        "total": [
            "must be greater than or equal to 1.125"
        ]
    }
}
```

</details>
