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

# Margin & Fees

The formulas Rails uses to size margin and fees for an options order. For a conceptual
overview, see the [Margin & Liquidation](/latest/options/guides/margin-and-liquidation)
guide. Authoritative figures for a specific order come from the
[Get Contract Pricing](/latest/options/rest-api/get-contract-pricing) and
[Get Margin](/latest/options/rest-api/get-margin) endpoints.

## Notation

| Symbol  | Meaning                       |
| ------- | ----------------------------- |
| `Index` | Index price of the underlying |
| `Mark`  | Mark price of the contract    |
| `K`     | Strike price                  |
| `qty`   | Order quantity                |

## Constants

| Constant            | Value                   | Used for                                                    |
| ------------------- | ----------------------- | ----------------------------------------------------------- |
| Long order buffer   | `1.165`                 | Long initial margin at order placement                      |
| Long holding buffer | `0.165`                 | Long position/maintenance margin (premium already deducted) |
| IM rate             | `0.15` (15% of `Index`) | Short initial margin                                        |
| IM floor            | `0.10` (10% of `Mark`)  | Short initial margin floor (deep OTM)                       |
| MM rate             | `0.05` (5% of `Index`)  | Short maintenance margin                                    |
| MM floor            | `0.05` (5% of `Mark`)   | Short maintenance margin floor                              |

The long buffer of `0.165` breaks down as 12.5% trading fee + 1% insurance + 3% slippage.

## Margin

**OTM discount** (per contract):

| Option type | `OTM`               |
| ----------- | ------------------- |
| Call        | `MAX(0, K − Index)` |
| Put         | `MAX(0, Index − K)` |

**Long** (buying) — the premium is paid up front; margin covers the buffer:

| Margin                | Formula              |
| --------------------- | -------------------- |
| Initial (order)       | `Mark · 1.165 · qty` |
| Holding / Maintenance | `Mark · 0.165 · qty` |

**Short** (selling) — per-contract margin is `MAX(rate · Index − OTM, floor · Mark) + Mark`:

| Margin             | Formula                                       |
| ------------------ | --------------------------------------------- |
| `IM′` per contract | `MAX(0.15 · Index − OTM, 0.10 · Mark) + Mark` |
| `MM′` per contract | `MAX(0.05 · Index − OTM, 0.05 · Mark) + Mark` |
| Initial margin     | `MAX(IM′, MM′) · qty`                         |
| Maintenance margin | `MM′ · qty`                                   |

Short initial margin is floored at the maintenance level (`MAX(IM′, MM′)`) so it is never
weaker than the maintenance requirement.

## Fees

| Fee       | Formula                                                 |
| --------- | ------------------------------------------------------- |
| Taker fee | `MIN(0.0003 · Index, 0.125 · Mark) · qty`               |
| Maker fee | Same as taker; Rails-designated makers are exempt (`0`) |

The delivery fee charged at settlement is covered in [Settlement](/latest/options/formulas/settlement).
