> For the complete documentation index, see [llms.txt](https://rwaperp-1.gitbook.io/rwaperp-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api-reference/positions-and-leverage/post-v1-client-leverages.md).

# post v1 client leverages

`POST /v1/client/leverages`

**Authentication:** RWA

**Rate limit:** 5 requests per 60 second per user

## Description

Update leverage settings. This endpoint supports two modes:

**Single symbol mode:** When `symbol` is provided, update leverage for that specific symbol.

**Batch mode:** When `symbol` is omitted, set leverage for all symbols in a single atomic operation. Each symbol's new leverage will be adjusted to `min(requested_leverage, symbol_max_leverage)`.

For example, if BTC max leverage is 100, ETH max leverage is 100, and NEAR max leverage is 10, and the user requests leverage = 20, the result will be: BTC = 20, ETH = 20, NEAR = 10.

### Batch update behavior with margin modes

* **Cross margin symbols:** A margin check is performed assuming all cross-margin symbols are updated to the new leverage. Either all cross-margin symbol leverages are updated successfully, or none are updated.
* **Isolated margin symbols:** The leverage update will only apply to symbols with no active isolated positions or pending orders. The update for isolated margin symbols will always go through for eligible symbols.

### Validation logic

{% stepper %}
{% step %}

## Check the leverage range

Check that the leverage range is eligible.
{% endstep %}

{% step %}

## Check the position notional

Check whether the position notional under the updated leverage is acceptable.

* `max_notional = (1 / (symbol_leverage * imr_factor)) ^ (1/0.8)`
* `symbol_leverage_max = round down to int → min(1 / (imr_factor * notional ^ 0.8), 1/base_imr)`
  {% endstep %}

{% step %}

## Check the margin

Check whether the margin is sufficient.
{% endstep %}
{% endstepper %}

## Parameters

No fields are defined in the published schema.

## Request body

| Field         | Type                 | Required | Description                                            |
| ------------- | -------------------- | -------- | ------------------------------------------------------ |
| `symbol`      | string               | No       | Example: `PERP_BTC_USDC`                               |
| `leverage`    | integer              | Yes      | Integer between 1 to 100                               |
| `margin_mode` | `CROSS` / `ISOLATED` | No       | Default: `CROSS`. Margin mode for the leverage update. |

## Responses

### HTTP 200

OK

| Field              | Type                 | Required | Description                                                        |
| ------------------ | -------------------- | -------- | ------------------------------------------------------------------ |
| `success`          | boolean              | Yes      | Indicates whether the request was successful. Example: `True`      |
| `timestamp`        | integer              | No       | Server timestamp in milliseconds. Example: `1702989203989`         |
| `data`             | object               | No       | —                                                                  |
| `data.symbol`      | string               | No       | Trading symbol for the leverage setting. Example: `PERP_BTC_USDC`  |
| `data.margin_mode` | `CROSS` / `ISOLATED` | No       | Margin mode for the returned leverage setting. Example: `ISOLATED` |
| `data.leverage`    | integer              | No       | Configured leverage value for the symbol. Example: `19`            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://rwaperp-1.gitbook.io/rwaperp-docs/rwa-perp-b2b-api/rest-api-reference/positions-and-leverage/post-v1-client-leverages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
