> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ekiden.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Leverage

## Overview

Ekiden supports leverage settings per market, allowing users to control leverage independently for each trading pair. Adjusting leverage changes how much margin is allocated to an open position in a given market. Increasing leverage reduces the required margin but increases liquidation risk, while lowering leverage increases the required margin and reduces liquidation risk.

## Endpoint

`POST /api/v1/position/set-leverage`

Sets leverage for a specific symbol and sub-account.

The request body includes:

* `leverage`: Leverage value to set.
* `sub_account_address`: Sub-account address.
* `symbol`: Market symbol.

### Headers

```text theme={null}
Authorization: Bearer <JWT>
Content-Type: application/json
```

## Request Parameters

| Parameter             | Type   | Description                                 | Required |
| --------------------- | ------ | ------------------------------------------- | -------- |
| `leverage`            | string | Leverage value to set (e.g. `"10"` for 10x) | Yes      |
| `sub_account_address` | string | Sub-account address                         | Yes      |
| `symbol`              | string | Market symbol (e.g. `"CC-USDCx"`)           | Yes      |

## Example Request

```json theme={null}
{
  "leverage": "8",
  "sub_account_address": "0x6160e0768af12ec30112972801aaa8287b42f15a2485ef68cd184a3eeec9dc49",
  "symbol": "BTC-USDCx"
}
```

{/* TODO(SDK): Replace the legacy intent-based leverage example with a current Canton-compatible SDK example once available. */}

## Response

```json theme={null}
{
  "success": true,
  "time": 1783479390120
}
```

## Notes

* Leverage is configured per symbol.
* Minimum and maximum leverage limits may vary by market.
* Changing leverage may affect margin requirements and liquidation price.

***
