Packages
Pure-function trading analytics for Elixir — Black-Scholes pricing and IV, options chain analytics (max pain, GEX, skew, surfaces), funding rates, basis, volatility estimators, risk metrics, position sizing, orderflow, and portfolio analytics. Self-describing for AI agents.
Current section
Files
Jump to
Current section
Files
lib/zen_quant.ex
defmodule ZenQuant do
@moduledoc """
Pure-function trading analytics for Elixir — discoverable APIs, no processes, no I/O.
## Start Here: Self-Describing API
ZenQuant describes itself. Before using `exports()` or `h()`, try:
ZenQuant.describe() # All modules with purpose
ZenQuant.describe(:funding) # Functions in Funding module
ZenQuant.describe(:funding, :annualize) # Full detail: params, returns, errors
Short names: `ZenQuant.PowerLaw` → `:power_law`, `ZenQuant.Options.Deribit` → `:deribit`.
## Machine-Readable Access
For runtime agents and non-interactive consumers:
ZenQuant.Funding.__api__() # All hints for one module
ZenQuant.Funding.__api__(:annualize) # Hints for one function
ZenQuant.Manifest.build() # Full API manifest as map
Static export: `mix zen_quant.manifest` → `api_manifest.json`
## Overview
Black-Scholes pricing and implied volatility, options chain analytics,
funding rates, basis, risk metrics, volatility estimators, position sizing,
portfolio analytics, orderflow, and execution primitives.
Every function is pure: it takes plain maps and numbers, returns plain maps
and tuples, and never performs I/O. The library starts no supervision tree.
Exchange payloads (Bourse structs are maps) work as-is, but nothing here
depends on an exchange client.
The only runtime dependency is [Descripex](https://hex.pm/packages/descripex),
which powers the discovery surface above.
"""
use Descripex.Discoverable,
modules: [
ZenQuant.Basis,
ZenQuant.Execution,
ZenQuant.Funding,
ZenQuant.Greeks,
ZenQuant.MeanReversion,
ZenQuant.MM,
ZenQuant.Options,
ZenQuant.Options.BlockTrades,
ZenQuant.Options.Chain,
ZenQuant.Options.Deribit,
ZenQuant.Options.GammaWalls,
ZenQuant.Options.Pricing,
ZenQuant.Options.Probability,
ZenQuant.Options.Skew,
ZenQuant.Options.Snapshot,
ZenQuant.Options.Surface,
ZenQuant.Options.ZeroDTE,
ZenQuant.OrderState,
ZenQuant.Orderflow,
ZenQuant.Portfolio,
ZenQuant.PowerLaw,
ZenQuant.Recorder.JSONL,
ZenQuant.Recorder.Replay,
ZenQuant.Risk,
ZenQuant.Sizing,
ZenQuant.Volatility,
ZenQuant.WS
]
end