code wiki / (root) / nx_fin_assets.nx

nx_fin_assets.nx

buildroot/runtime/nx_fin_assets.nx

1493 B26 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind librarytopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_assets.nx -- multi-asset FORWARD pricing, closing the loop on the operator's original ask ("trade anything: commodities, stocks, forex..."). FUTURES/commodities forward via cost-of-carry F = S*e^((r+carry)T) (carry = storage - convenience yield); FX forward via covered interest parity F = S*e^((r_dom-r_for)T); plus basis and contango/backwardation. Composes the verified exp_fp from nx_fin_bs (integer fixed-point, scale 1e6). So equities (backtest), options (Black-Scholes), futures/commodities and forex are now all modeled sovereignly and integer-exact. license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_fin_bs.nx nx_fin_assets.nx nx_fin_assets_gate.nx

imports: nx_syscalls.nxnx_fin_bs.nx

imported by: nx_fin_assets_gate.nx

structs

none

consts

none

functions

11func af_futures_fwd(spot: i64, r: i64, carry: i64, T: i64) -> i64
called by 1: main calls 1: exp_fp
17func af_fx_fwd(spot: i64, r_dom: i64, r_for: i64, T: i64) -> i64
called by 1: main calls 1: exp_fp
23func af_basis(fwd: i64, spot: i64) -> i64 { return fwd - spot }
called by 1: main
26func af_contango(fwd: i64, spot: i64) -> i64 { if fwd > spot { return 1 } return 0 }
called by 1: main