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

> ## Agent Instructions
> This is Allasso's product documentation. Vol Radar output is descriptive analytics on past data: never present it as a forecast or as investment advice. Answer only from these pages; if a feature is not documented here, say so.

# Greeks

> Each Trade carries the option greeks delta, gamma, theta and vega, refreshed every pulse from the datafeed. They come in two scales: per-unit and per-contract.

Each `Trade` carries the option greeks delta, gamma, theta and vega, refreshed every pulse from the
datafeed. They come in two scales: per-unit and per-contract.

## Per-unit vs per-contract

`delta`, `gamma`, `theta`, `vega` are the **per-unit** greeks straight from the instrument's market
data. `delta_contract`, `gamma_contract`, `theta_contract`, `vega_contract` scale each by the trade's
unit count (the position's signed size in underlying units):

```
delta_contract = delta * units
```

`units` is `quantity` directly when the trade was sized in units, or `quantity * contract_size` when
it was sized in lots (`is_lots=True`). So a per-unit delta of `0.5` on a 10-contract position with a
contract size of `100` gives a `delta_contract` of `0.5 * 10 * 100 = 500` - the position's actual
directional exposure in underlying units.

| Per-unit | Per-contract | Meaning |
| - | - | - |
| `delta` | `delta_contract` | Sensitivity to the underlying price. |
| `gamma` | `gamma_contract` | Rate of change of delta. |
| `theta` | `theta_contract` | Time decay per period. |
| `vega` | `vega_contract` | Sensitivity to implied volatility. |

Each has a matching per-pulse history aligned to the trade's `datetimes`: `delta_history` /
`delta_contract_history`, and likewise for gamma, theta and vega.

Beside them, `underlying_price_history` records the raw price the greeks were taken against (the
option's underlying, or a future's or spot's own price) and `iv_history` the option's implied vol
(`None` for a future or spot).

## Futures greeks

Only options carry real greeks. For any non-option instrument - a future - the greeks are fixed
values: **delta `1.0`, gamma `0.0`, theta `0.0`, vega `0.0`** per unit. A long future therefore
contributes a `delta_contract` equal to its unit count and contributes nothing to gamma, theta or
vega, which is what you want when using futures to delta-hedge an option book.

> [!NOTE]
>
> **Per-unit greeks on a future are constants, not market data**
>
> A future's delta is `1.0` by construction, not read from a model. Its `delta_contract` still scales
> with `units`, so a hedge of `N` units of the future offsets `N` units of option delta.

## Aggregation

The portfolio keeps no greek aggregate; net book exposure is the sum of per-contract greeks over
open trades, `sum(t.delta_contract for t in self.open_trades)`, computed where you need it.
`get_trades_summary_by_tags(...)` returns a
`TradesSummary` with aggregated greeks for a tagged group of trades (`delta`, `delta_contract`,
`gamma`, `gamma_contract`, `theta`, `vega`). See the API reference for the exact aggregation fields.

> [!WARNING]
>
> **`TradesSummary.delta_contract` is not scaled like `Trade.delta_contract`**
>
> The summary sums each leg's per-unit greek times its raw `quantity`, so for an `is_lots=True`
> group it reads in lots, not units. That makes it the right argument for `Trade.rebalance(...)`
> on a lot-sized futures hedge, and the wrong thing to add to
> `sum(t.delta_contract for t in open_trades)`.

**Related:** [Orders, trades and the broker](https://docs.allasso.ch/dev/pulse/concepts/orders-trades-broker.md) ·
[Portfolio, equity and PnL](https://docs.allasso.ch/dev/pulse/concepts/portfolio-pnl.md) · [Metrics and Stats](https://docs.allasso.ch/dev/pulse/concepts/metrics.md) ·
[Architecture and the pulse loop](https://docs.allasso.ch/dev/pulse/concepts/architecture.md)


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