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

# Trade with leverage

> Read and set leverage and margin mode per instrument, and check the margin an order would cost before you send it.

Leverage and margin mode are per-instrument configuration on the accounts whose venue has such a
setting. Not every account does, so the first thing to establish is whether this surface exists at
all for the account in front of you.

## Which accounts have it

Read `capabilities.symbolConfig` on the account — it is on every row from [List
accounts](/api-reference/account/list-accounts) and on every [account
snapshot](/api-reference/account/get-the-account-snapshot). It is what to render off: the engine
re-checks every gate server-side and fails closed, so capabilities drive what you offer, never
what is authorized.

The contract is explicit about one exclusion: on futures, leverage is a fixed contract property
rather than an account setting, and the routes below answer `400` on a venue without the surface
at all. The reference's own request example targets a perpetual.

The same asymmetry shows up in position rows. `leverage`, `liquidationPrice` and `margin` on a
position are venue-reported and null where the concept does not exist — futures and prop accounts.
Render an em dash there, never a faked `1`.

<Steps>
  <Step title="Read the instrument's current setting">
    [Get leverage and margin mode](/api-reference/trading/get-leverage-and-margin-mode) is
    configuration, not exposure, so it is neither plan-gated nor risk-gated.

    ```bash theme={null}
    curl "$TRDRS_API_BASE_URL/api/trading/symbol-config?instrument=HYPERLIQUID:BTC" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY"
    ```

    `config` is null when the venue has no setting for that instrument — a real answer, not an
    error. When it is present it carries `leverage`, `marginMode` (`cross` or `isolated`) and
    `maxLeverage`, which is the ceiling to bound your input control by.
  </Step>

  <Step title="Set leverage, margin mode, or both">
    [Set leverage and margin mode](/api-reference/trading/set-leverage-and-margin-mode) takes the
    instrument plus at least one of the two fields. A body with neither is a `400` rather than a
    silent no-op, and a non-positive leverage is a `400` too.

    ```bash theme={null}
    curl -X PUT "$TRDRS_API_BASE_URL/api/trading/symbol-config" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "instrument": "HYPERLIQUID:BTC",
        "leverage": 10,
        "marginMode": "cross"
      }'
    ```

    Send only `marginMode` to switch between cross and isolated without touching the multiplier.
  </Step>

  <Step title="Price the order before you send it">
    [Preview order margin](/api-reference/trading/preview-order-margin) returns the buying-power
    impact of a hypothetical order. The call is read-only: it never places an order, it carries no
    `clientOrderId` because there is no intent to make idempotent, and it is not risk-gated.

    ```bash theme={null}
    curl -X POST "$TRDRS_API_BASE_URL/api/trading/margin-preview" \
      -H "Authorization: Bearer $TRDRS_TENANT_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "instrument": "ESU6",
        "side": "buy",
        "qty": 2,
        "orderType": "market"
      }'
    ```

    Three fields decide how you present the answer:

    | Field            | What it means                                                                                                             |
    | ---------------- | ------------------------------------------------------------------------------------------------------------------------- |
    | `marginRequired` | The figure, in `currency`. Null when it is unknown — say so rather than showing zero.                                     |
    | `estimate`       | `false` where the broker computes the figure for real (a TastyTrade dry-run), `true` otherwise. Label an estimate as one. |
    | `sufficient`     | Whether the account can cover it, or null when that cannot be determined.                                                 |

    A `400` here can mean the asset class is one this broker cannot route; it carries a machine
    `code` so you can tell that apart from a bad price or quantity.
  </Step>
</Steps>

## Instruments, and how to name them

The exact string an order carries differs by class: a futures product root like `ES`, or a
venue-prefixed crypto canonical like `HYPERLIQUID:BTC`. [List account
instruments](/api-reference/account/list-account-instruments) is the authoritative set for one
account — a futures account lists the contract catalog, a crypto venue account lists that venue's
perpetuals, and the demo lists both. Reading it takes no venue call and never touches account
state, so it is cheap to keep a picker fed from it.

## Where to go deeper

* [List open positions](/api-reference/account/list-open-positions) — where `leverage`, `margin` and `liquidationPrice` are reported per position.
* [Place your first order](/guides/place-your-first-order) — the order body the margin preview is describing.
* [Track fills and P\&L](/guides/track-fills-and-pnl) — the account money, after the fact.
* [Conventions](/partner-platform/overview/conventions) — signed quantities, true nulls, and account targeting.
