DeltaCalc.Presets (DeltaCalc v0.3.0)

Copy Markdown View Source

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

FunctionArityDescriptionParam Kinds
load_dca_preset0Load the default DCA ladder preset for reserve-based position scaling.-
load_thresholds0Load black swan threshold percentages by asset for long and short positions.-
load_modes0Load risk mode configurations for portfolio allocation.-

Summary

Functions

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

Load risk mode configurations for portfolio allocation.

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

Types

asset_threshold()

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

dca_step()

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

risk_mode()

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

Functions

load_dca_preset()

@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)

# 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()

@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)

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

load_thresholds()

@spec load_thresholds() :: %{required(String.t()) => 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)

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