# Adjust Margin

{% hint style="info" %}
This action is used to add or remove isolated margin from an open position.
{% endhint %}

***

## Example Request

This example sets the leverage on  <mark style="color:green;">`BTC`</mark>  to <mark style="color:green;">`5x`</mark> using the <mark style="color:green;">`Cross`</mark> margin-mode.

```json
{
  "action": "adjust_margin",
  "coin": "BTC",
  "amount": 5,
  "is_add": true,
  "bot_id": BOT_ID,
  "api_key": "API_KEY"
}
```

***

## coin<mark style="color:red;">\*</mark>

This required parameter indicates which coin to use for the action.

```json
"coin": "BTC"
```

***

## amount<mark style="color:red;">\*</mark>

This parameter indicates the amount value to add/remove.

* A value of `5` is equal to a `5` USD

```json
"amount": 5
```

***

## is\_add<mark style="color:red;">\*</mark>

This required parameter indicates wether to add or remove an amount from margin.

* `true`  will add an amount to margin
* `false` will remove an amount from margin

```json
"is_add": true
```

***

## delay

This parameter indicates a number of seconds to wait before triggering the action.

* A value of `5` is equal to a `5 seconds` delay
* Max. allowed delay is `10 seconds`

```json
"delay": 5
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://katoshi.gitbook.io/katoshi-docs/api/signal-api/adjust-margin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
