# `Bourse.Unified.OptionQuantity`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/unified/option_quantity.ex#L1)

Converts option quantities between unified base exposure and venue wire units.

Unified option order quantities and position `contracts` are expressed in
units of the option's base currency. Each authored venue declares whether its
native quantity field uses base units or contract counts.

# `from_contracts`

```elixir
@spec from_contracts(Bourse.Market.t(), number() | String.t()) ::
  {:ok, number()} | {:error, Bourse.Error.t()}
```

Converts an option contract count to canonical base exposure.

# `from_native`

```elixir
@spec from_native(Bourse.Market.t(), number() | String.t()) ::
  {:ok, number()} | {:error, Bourse.Error.t()}
```

Converts a venue option quantity to canonical base-currency exposure.

# `from_native_result!`

```elixir
@spec from_native_result!(term(), Bourse.Exchange.t()) :: term()
```

Converts parsed option orders and positions from venue wire units to base exposure.

# `normalize_market`

```elixir
@spec normalize_market(Bourse.Market.t(), map(), Bourse.Exchange.t()) ::
  Bourse.Market.t()
```

Applies authored option quantity semantics to a parsed market.

# `to_contracts`

```elixir
@spec to_contracts(Bourse.Market.t(), number() | String.t()) ::
  {:ok, number()} | {:error, Bourse.Error.t()}
```

Converts canonical base exposure to an option contract count.

# `to_native`

```elixir
@spec to_native(Bourse.Market.t(), number() | String.t()) ::
  {:ok, number()} | {:error, Bourse.Error.t()}
```

Converts a canonical base-currency option amount to the venue wire unit.

# `to_native_request!`

```elixir
@spec to_native_request!(map(), Bourse.Exchange.t(), String.t()) :: map()
```

Converts unified option order amounts before venue request shaping.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
