> ## 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.

# Skew, term & ratio

> Structures that lean on skew (different-delta legs), term structure (different expiries), or unequal quantities (1×2 ratios).

Structures that lean on **skew** (different-delta legs), **term structure** (different expiries), or
**unequal quantities** (1×2 ratios). The snippets assume the [shared scaffold](https://docs.allasso.ch/dev/pulse/structures/index.md)
(`u = self.underlying_id[0]`, a computed `size`, and
`from pulse import structures, InstrumentType, Option, PeriodType, PeriodID`).

> [!TIP]
>
> **Where the legs live**
>
> A **higher-delta** call is closer to the money (lower strike); a lower-delta call is further OTM
> (higher strike). The term-structure recipes resolve a **near** expiry (`nth=1`) and a **far**
> expiry (`nth=2`) from the same `min_dte` floor.

## Risk reversal

Sell an OTM put to fund a long OTM call - a bullish, often near-zero-cost lean via the skew.

* **Max profit** - unbounded above the call strike. **Max loss** - large below the put strike (behaves like long the underlying).
* **Breakeven** - near spot, shifted by the net premium. **Bias** - bullish, undefined downside.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> put_strike  = self.resolver.strike.delta.resolve(   # 25Δ OTM put - sell
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=PUT, strike_value=0.25)
> call_strike = self.resolver.strike.delta.resolve(   # 25Δ OTM call - buy
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.25)
> sell_put = Option(u, PUT,  put_strike,  expiry)
> buy_call = Option(u, CALL, call_strike, expiry)
> size = self._size(buy_call)
> self.broker.create_order(self.pulse_index, sell_put, -size, is_lots=True)
> self.broker.create_order(self.pulse_index, buy_call, +size, is_lots=True)
> ```

> [tab] Helper
>
> ```python theme={null}
> sell_put = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=PUT, delta=0.25, min_dte=self._min_dte,
> ).option
> buy_call = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=CALL, delta=0.25, min_dte=self._min_dte,
> ).option
> size = self._size(buy_call)
> self.broker.create_order(self.pulse_index, sell_put, -size, is_lots=True)  # sell 25Δ put
> self.broker.create_order(self.pulse_index, buy_call, +size, is_lots=True)  # buy 25Δ call
> ```

## Calendar call spread

Sell the near call, buy the far call at the **same strike** - collect faster near-leg decay and stay
long term-structure vol.

* **Max profit** - around the strike as the near leg decays. **Max loss** - the net debit paid.
* **Breakeven** - set by the far leg's value at near expiry. **Bias** - neutral, long vega.

> [tab] Manual
>
> ```python theme={null}
> near = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> far = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=2, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> strike = self.resolver.strike.delta.resolve(   # 40Δ on the near expiry
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=near,
>     instrument_type=CALL, strike_value=0.40)
> near_call = Option(u, CALL, strike, near)
> far_call  = Option(u, CALL, strike, far)   # same strike, far expiry
> size = self._size(near_call)
> self.broker.create_order(self.pulse_index, near_call, -size, is_lots=True)
> self.broker.create_order(self.pulse_index, far_call,  +size, is_lots=True)
> ```

> [tab] Helper
>
> ```python theme={null}
> legs = structures.calendar_spread_by_delta(
>     self.resolver, u, self.last_pulse, instrument_type=CALL, delta=0.40,
>     near_min_dte=self._min_dte, far_min_dte=self._min_dte, near_nth=1, far_nth=2,
> )
> size = self._size(legs.near_option)
> self.broker.create_order(self.pulse_index, legs.near_option, -size, is_lots=True)  # sell near
> self.broker.create_order(self.pulse_index, legs.far_option,  +size, is_lots=True)  # buy far
> ```

## Diagonal call spread

Like a calendar, but the two legs sit at **different strikes** - pairs term structure with a
directional tilt.

* **Max profit** - near the short strike at near expiry. **Max loss** - the net debit (when opened for a debit).
* **Breakeven** - set by the far leg's value at near expiry. **Bias** - bullish-leaning, long vega.

> [tab] Manual
>
> ```python theme={null}
> near = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> far = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=2, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> near_strike = self.resolver.strike.delta.resolve(   # 40Δ - sell nearer the money
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=near,
>     instrument_type=CALL, strike_value=0.40)
> far_strike  = self.resolver.strike.delta.resolve(   # 20Δ - buy further OTM on the far expiry
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=far,
>     instrument_type=CALL, strike_value=0.20)
> near_call = Option(u, CALL, near_strike, near)
> far_call  = Option(u, CALL, far_strike,  far)
> size = self._size(near_call)
> self.broker.create_order(self.pulse_index, near_call, -size, is_lots=True)
> self.broker.create_order(self.pulse_index, far_call,  +size, is_lots=True)
> ```

> [tab] Helper
>
> ```python theme={null}
> legs = structures.diagonal_spread_by_delta(
>     self.resolver, u, self.last_pulse, instrument_type=CALL, delta=0.40, far_delta=0.25,
>     near_min_dte=self._min_dte, far_min_dte=self._min_dte, near_nth=1, far_nth=2,
> )
> size = self._size(legs.near_option)
> self.broker.create_order(self.pulse_index, legs.near_option, -size, is_lots=True)  # sell near
> self.broker.create_order(self.pulse_index, legs.far_option,  +size, is_lots=True)  # buy far
> ```

> [!NOTE]
>
> **Each diagonal leg has its own delta**
>
> `diagonal_spread_by_delta` resolves `delta` on the **near** expiry and `far_delta` on the **far**
> one, so the two legs land on different strikes. For one strike across two expiries, use
> `calendar_spread_by_delta`, whose far leg reuses the near strike and snaps to the closest one
> that expiry lists.

## Ratio call spread

Buy 1 call, sell 2 higher calls (a **1×2**) - often a credit, profiting from a moderate move up to the
short strike.

* **Max profit** - around the short strike at expiry. **Max loss** - **unbounded** above the short strike (one extra naked short call).
* **Breakeven** - an upper breakeven above the short strike. **Bias** - moderately bullish, undefined upside risk.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> buy_strike  = self.resolver.strike.delta.resolve(   # 40Δ - buy 1 nearer the money
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.40)
> sell_strike = self.resolver.strike.delta.resolve(   # 20Δ - sell 2 further OTM
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.20)
> buy_call  = Option(u, CALL, buy_strike,  expiry)
> sell_call = Option(u, CALL, sell_strike, expiry)
> size = self._size(buy_call)
> self.broker.create_order(self.pulse_index, buy_call,   +size,     is_lots=True)
> self.broker.create_order(self.pulse_index, sell_call, -2 * size, is_lots=True)
> ```

> [tab] Helper
>
> ```python theme={null}
> buy_call = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=CALL, delta=0.40, min_dte=self._min_dte,
> ).option
> sell_call = structures.option_by_delta(
>     self.resolver, u, self.last_pulse,
>     instrument_type=CALL, delta=0.20, min_dte=self._min_dte,
> ).option
> size = self._size(buy_call)
> self.broker.create_order(self.pulse_index, buy_call,   +size,     is_lots=True)  # buy 1 × 40Δ
> self.broker.create_order(self.pulse_index, sell_call, -2 * size, is_lots=True)  # sell 2 × 20Δ
> ```

## Zero-cost call spread

A 1×2 where the short strike is picked by a **premium constraint** - buy 1 call at K1, sell 2 calls at
K2 chosen so `premium(K1) ≈ 2 × premium(K2)`, opening for roughly zero net premium.

* **Max profit** - around K2 at expiry. **Max loss** - **unbounded** above K2 (the extra naked short call).
* **Breakeven** - an upper breakeven above K2. **Bias** - moderately bullish, financed by skew.

> [!NOTE]
>
> **No structures helper - resolve manually**
>
> The short strike is selected by a premium relationship, not a fixed delta, so there is no
> `structures` helper. The `strike.value` resolver returns the strike whose premium is closest to a
> target (here `k1_price / 2`), which lands K2 directly - no manual smile scan.

> [tab] Manual
>
> ```python theme={null}
> expiry = self.resolver.expiry.relative(
>     underlying_id=u, as_of_time=self.last_pulse, period_type=PeriodType.MONTH,
>     instrument_type=CALL, nth=1, period_id=PeriodID.ALL, min_dte=self._min_dte,
> )[0]
> k1_strike = self.resolver.strike.delta.resolve(   # 20Δ long call (K1)
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=0.20)
> k1 = Option(u, CALL, k1_strike, expiry)
> k1_price = self.datafeed.instrument.last(k1, self.last_pulse).price
>
> k2_strike = self.resolver.strike.value.resolve(   # strike whose premium ≈ K1 / 2
>     underlying_id=u, as_of_time=self.last_pulse, expiration_date=expiry,
>     instrument_type=CALL, strike_value=k1_price / 2.0)
> k2 = Option(u, CALL, k2_strike, expiry)
> size = self._size(k1)
> self.broker.create_order(self.pulse_index, k1,  +size,     is_lots=True)  # buy 1 × K1
> self.broker.create_order(self.pulse_index, k2, -2 * size, is_lots=True)  # sell 2 × K2
> ```


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