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

# Leverage

> SetLeverage and ListLeverage - set the leverage for one market on a Hypernova account, and read it back for every market.

## SetLeverage

`SetLeverage` · **write key** · Body: `{ "accountId": "…", "symbol": "BTC", "leverage": "5" }` · Response: `{}`

* `leverage` is a decimal string from 1 up to the market's `maxLeverage` in [ListMarkets](https://hypernova.xyz/docs/api/accounts.md#listmarkets), with at most four decimal places. A value outside that answers `invalid_argument`, and the message says why, such as `invalid leverage: BTC allows at most 10x`.
* A market whose leverage was never set trades at its `maxLeverage`.
* Leverage can change while a position is open. A change that needs more margin than the account has free answers `failed_precondition`.

## ListLeverage

`ListLeverage` · **read key** · Body: `{ "accountId": "…", "symbol": "BTC" }`, with `symbol` optional

The account's leverage on every market, ordered by symbol, whether or not it holds a position there, or on the one market `symbol` names.

```json theme={null}
{ "leverages": [{ "symbol": "BTC", "leverage": "5" }, { "symbol": "ETH", "leverage": "10" }] }
```

* `leverage` is what the market's margin is computed at, for an open position and the next order alike: the value SetLeverage last set, or `maxLeverage` when never set.
* A value set above a market's current `maxLeverage` reads as `maxLeverage`, because margin is capped there.
* An account in `ACCOUNT_STATE_AWAITING_SIGNATURE` or `ACCOUNT_STATE_INITIALIZING` may answer `not_found`, because its portfolio is created during activation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.