Root-Level Facades¶
AbaQuant’s root abaquant namespace re-exports a handful of common
functions for quick, exploratory use. This notebook is short by design: it
exists to show the root facade alongside the recommended, more explicit
domain imports (abaquant.derivatives, abaquant.credit, abaquant.rates)
used everywhere else in this collection.
For long-lived production code, prefer explicit domain imports — they make dependencies and ownership clearer. See
docs/reference/architecture.rst.
Setup¶
import abaquant
print(f"AbaQuant version: {abaquant.__version__}")
AbaQuant version: 1.0.0rc1
from abaquant import black_scholes, forward_price, portfolio_sharpe
from abaquant.credit import build_transition_matrix, value_cds
from abaquant.rates import future_value, nominal_to_effective_rate, present_value
Root namespace convenience functions¶
root_facade = {
"black_scholes_call": black_scholes(100.0, 100.0, 0.05, 0.20, 1.0),
"forward_price": forward_price(100.0, 0.05, 1.0),
"portfolio_sharpe": portfolio_sharpe(0.10, 0.18, 0.03),
}
for key, value in root_facade.items():
print(f"{key:20s}: {value:.6f}")
black_scholes_call : 10.450584
forward_price : 105.127110
portfolio_sharpe : 0.388889
Dedicated credit and rates facades¶
cds = value_cds(0.03, 0.04, 5, 0.40)
credit_and_rates = {
"future_value": future_value(1_000.0, 0.05, 5),
"present_value": present_value(1_500.0, 0.05, 5),
"effective_rate": nominal_to_effective_rate(0.06, 12),
"transition_shape": build_transition_matrix().shape,
"cds_fair_spread": cds["spread"],
}
for key, value in credit_and_rates.items():
print(f"{key:20s}: {value}")
future_value : 1276.2815625000003
present_value : 1175.2892497026883
effective_rate : 0.06167781186449828
transition_shape : (18, 18)
cds_fair_spread : 0.0183566849452464
Takeaway¶
import abaquant is convenient for quick exploration, but prefer
from abaquant.derivatives import ..., from abaquant.portfolio import ...,
etc. in real projects — see the Reference / Architecture docs page for
the full stability policy.