Skip to main content

Finance operators

10 operators in the finance category of the live registry. Each is a named formula you can compose inside a state contract or call directly through POST /api/zeq/compute. KO42 is always on; add up to three more per call (total ≤ 4), per the 7-step protocol.

OperatorDescriptionEquation
BETA_COEFFICIENTBeta coefficient beta = Cov(R_i, R_m)/Var(R_m) measuring an asset's sensitivity to systematic market risk.\beta = \frac{Cov(R_i, R_m)}{Var(R_m)}
BLACK_SCHOLESBlack-Scholes option pricing formula C = SN(d1) - Ke^(-rT)*N(d2) for European call options under log-normal asset dynamics.C = SN(d_1) - Ke^{-rT}N(d_2)
BOND_DURATIONMacaulay duration D = sum(t*C_t/(1+y)^t)/P measuring a bond's weighted-average time to cash flow receipt.D = \frac{\sum_{t=1}^n t \times \frac{C_t}{(1+y)^t}}{P}
CAPMCapital Asset Pricing Model E(R_i) = R_f + beta_i*(E(R_m)-R_f) relating expected return to systematic risk.E(R_i) = R_f + \beta_i(E(R_m) - R_f)
EXPECTED_SHORTFALLExpected Shortfall (CVaR) ES = E[X | X < VaR] computing the average loss beyond the VaR threshold for tail risk measurement.ES = E[X | X < VaR]
MONTE_SIMULATIONGeometric Brownian motion S_t = S_0*e^((mu-sigma^2/2)t + sigmaW_t) simulating asset price paths for Monte Carlo pricing.S_t = S_0 e^{(\mu - \frac{\sigma^2}{2})t + \sigma W_t}
PORTFOLIO_VARIANCEPortfolio variance sigma^2_p = sum of w_iw_jsigma_isigma_jrho_ij accounting for all pairwise asset correlations.\sigma_p^2 = \sum_i \sum_j w_i w_j \sigma_i \sigma_j \rho_{ij}
SHARPE_RATIOSharpe ratio SR = (R_p - R_f)/sigma_p measuring risk-adjusted return as excess return per unit of portfolio volatility.SR = \frac{R_p - R_f}{\sigma_p}
VAR_HISTORICALHistorical Value at Risk estimating the maximum expected loss at confidence level alpha from empirical return distribution.VaR = -Percentile(Returns, 1-\alpha)
VAR_MONTE_CARLOMonte Carlo Value at Risk simulating thousands of portfolio return scenarios to estimate tail-risk loss quantiles.VaR_\alpha = -\mu + \sigma \Phi^{-1}(\alpha)

Compute with one of these

curl -sS -X POST https://zeqsdk.com/api/zeq/compute \
-H "Authorization: Bearer $ZEQ_KEY" \
-H "Content-Type: application/json" \
-d '{"operators":["BETA_COEFFICIENT"],"inputs":{}}'

The response carries the bare physics value, its unit and uncertainty, the generated master equation, and a signed envelope you can verify on any node.

See also