# `DeltaCalc.Presets`
[🔗](https://github.com/ZenHive/delta_calc/blob/v0.3.0/lib/delta_calc/presets.ex#L1)

Preset configurations for risk modes, black swan thresholds, and DCA ladder strategies.

Provides hardcoded preset configurations for MVP usage. Future versions will
load these from JSON configuration files for user customization.

## API Functions
| Function | Arity | Description | Param Kinds |
| --- | --- | --- | --- |
| `load_dca_preset` | 0 | Load the default DCA ladder preset for reserve-based position scaling. | - |
| `load_thresholds` | 0 | Load black swan threshold percentages by asset for long and short positions. | - |
| `load_modes` | 0 | Load risk mode configurations for portfolio allocation. | - |

# `asset_threshold`

```elixir
@type asset_threshold() :: %{long: integer(), short: integer()}
```

# `dca_step`

```elixir
@type dca_step() :: {Decimal.t(), Decimal.t()}
```

# `risk_mode`

```elixir
@type risk_mode() :: %{pct: Decimal.t(), cap: Decimal.t()}
```

# `load_dca_preset`

```elixir
@spec load_dca_preset() :: [dca_step()]
```

Load the default DCA ladder preset for reserve-based position scaling.

## Returns

3-step list of \{price_pct, allocation_pct\} Decimal tuples. Covers 90% of capital across decreasing price levels; 10% held in reserve. (`list`)

```elixir
# descripex:contract
%{
  returns: %{
    type: :list,
    description: "3-step list of {price_pct, allocation_pct} Decimal tuples. Covers 90% of capital across decreasing price levels; 10% held in reserve."
  }
}
```

# `load_modes`

```elixir
@spec load_modes() :: %{
  conservative: risk_mode(),
  moderate: risk_mode(),
  aggressive: risk_mode()
}
```

Load risk mode configurations for portfolio allocation.

## Returns

Map with :conservative, :moderate, :aggressive keys, each a map of %\{pct: Decimal, cap: Decimal\}. (`map`)

```elixir
# descripex:contract
%{
  returns: %{
    type: :map,
    description: "Map with :conservative, :moderate, :aggressive keys, each a map of %{pct: Decimal, cap: Decimal}."
  }
}
```

# `load_thresholds`

```elixir
@spec load_thresholds() :: %{required(String.t()) =&gt; asset_threshold()}
```

Load black swan threshold percentages by asset for long and short positions.

## Returns

Map keyed by asset symbol (e.g. "ETH") to %\{long: integer, short: integer\} threshold percentages. (`map`)

```elixir
# descripex:contract
%{
  returns: %{
    type: :map,
    description: "Map keyed by asset symbol (e.g. \"ETH\") to %{long: integer, short: integer} threshold percentages."
  }
}
```

---

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