quantflow 0.9.0__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. {quantflow-0.9.0 → quantflow-1.0.0}/.dockerignore +2 -0
  2. {quantflow-0.9.0 → quantflow-1.0.0}/.github/copilot-instructions.md +40 -3
  3. quantflow-1.0.0/.github/instructions/bibliography.instructions.md +16 -0
  4. quantflow-1.0.0/.github/instructions/observable.instructions.md +49 -0
  5. {quantflow-0.9.0 → quantflow-1.0.0}/.github/workflows/build.yml +8 -22
  6. {quantflow-0.9.0 → quantflow-1.0.0}/.github/workflows/docker-multiarch.yml +17 -0
  7. quantflow-1.0.0/.github/workflows/examples.yml +37 -0
  8. quantflow-1.0.0/.github/workflows/main.yml +27 -0
  9. {quantflow-0.9.0 → quantflow-1.0.0}/.github/workflows/release.yml +10 -0
  10. {quantflow-0.9.0 → quantflow-1.0.0}/.gitignore +5 -0
  11. {quantflow-0.9.0 → quantflow-1.0.0}/CLAUDE.md +2 -0
  12. quantflow-1.0.0/CODE_OF_CONDUCT.md +85 -0
  13. {quantflow-0.9.0 → quantflow-1.0.0}/Makefile +16 -7
  14. quantflow-1.0.0/PKG-INFO +84 -0
  15. quantflow-1.0.0/app/__main__.py +88 -0
  16. quantflow-1.0.0/app/api/cointegration.py +78 -0
  17. quantflow-1.0.0/app/api/deps.py +116 -0
  18. quantflow-1.0.0/app/api/docs/__init__.py +7 -0
  19. quantflow-1.0.0/app/api/docs/cointegration.md +9 -0
  20. quantflow-1.0.0/app/api/docs/double_exponential_sampling.md +11 -0
  21. quantflow-1.0.0/app/api/docs/gaussian_sampling.md +12 -0
  22. quantflow-1.0.0/app/api/docs/heston_vol_surface.md +15 -0
  23. quantflow-1.0.0/app/api/docs/hurst_vasicek.md +9 -0
  24. quantflow-1.0.0/app/api/docs/hurst_wiener.md +15 -0
  25. quantflow-1.0.0/app/api/docs/poisson_sampling.md +10 -0
  26. quantflow-1.0.0/app/api/docs/supersmoother.md +12 -0
  27. quantflow-1.0.0/app/api/docs/volatility_surface.md +21 -0
  28. quantflow-1.0.0/app/api/docs/yield_curve.md +21 -0
  29. quantflow-1.0.0/app/api/heston.py +85 -0
  30. quantflow-1.0.0/app/api/hurst.py +176 -0
  31. quantflow-1.0.0/app/api/rates.py +65 -0
  32. quantflow-1.0.0/app/api/sampling.py +132 -0
  33. quantflow-1.0.0/app/api/smoother.py +54 -0
  34. quantflow-1.0.0/app/api/status.py +13 -0
  35. quantflow-1.0.0/app/api/volatility.py +138 -0
  36. {quantflow-0.9.0 → quantflow-1.0.0}/app/scripts/heston_divfm_fit.py +3 -3
  37. {quantflow-0.9.0 → quantflow-1.0.0}/app/utils/paths.py +2 -1
  38. quantflow-1.0.0/app/utils/static.py +15 -0
  39. quantflow-1.0.0/dev/api-serve +15 -0
  40. {quantflow-0.9.0 → quantflow-1.0.0}/dev/blocks/quantflow.yaml +1 -0
  41. quantflow-1.0.0/dev/docs-serve +16 -0
  42. quantflow-1.0.0/dev/frontend-serve +8 -0
  43. quantflow-1.0.0/dev/install +3 -0
  44. {quantflow-0.9.0 → quantflow-1.0.0}/dev/lint +1 -1
  45. quantflow-1.0.0/dev/mkdocs-serve +12 -0
  46. {quantflow-0.9.0 → quantflow-1.0.0}/dev/quantflow.dockerfile +10 -5
  47. quantflow-1.0.0/dev/serve-info +10 -0
  48. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/data/index.md +1 -0
  49. quantflow-1.0.0/docs/api/data/yahoo.md +21 -0
  50. quantflow-1.0.0/docs/api/dists/distributions.md +9 -0
  51. quantflow-1.0.0/docs/api/dists/distributions1d.md +9 -0
  52. quantflow-1.0.0/docs/api/dists/index.md +9 -0
  53. quantflow-1.0.0/docs/api/dists/marginal1d.md +9 -0
  54. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/index.md +23 -3
  55. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/black.md +2 -2
  56. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/calibration.md +2 -0
  57. quantflow-1.0.0/docs/api/options/moneyness.md +10 -0
  58. quantflow-1.0.0/docs/api/options/parity.md +6 -0
  59. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/vol_surface.md +6 -6
  60. quantflow-1.0.0/docs/api/rates/calibration.md +5 -0
  61. quantflow-1.0.0/docs/api/rates/cir.md +5 -0
  62. quantflow-1.0.0/docs/api/rates/index.md +23 -0
  63. quantflow-1.0.0/docs/api/rates/interpolated.md +17 -0
  64. quantflow-1.0.0/docs/api/rates/nelson_siegel.md +5 -0
  65. quantflow-1.0.0/docs/api/rates/vasicek.md +10 -0
  66. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/rates/yield_curve.md +2 -1
  67. quantflow-1.0.0/docs/api/ta/ewma.md +4 -0
  68. quantflow-1.0.0/docs/api/ta/index.md +3 -0
  69. quantflow-1.0.0/docs/api/ta/kalman.md +24 -0
  70. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/ta/supersmoother.md +1 -1
  71. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/utils/index.md +0 -2
  72. quantflow-1.0.0/docs/api/utils/price.md +5 -0
  73. {quantflow-0.9.0 → quantflow-1.0.0}/docs/bib2md.py +7 -1
  74. {quantflow-0.9.0 → quantflow-1.0.0}/docs/bibliography.md +12 -0
  75. quantflow-1.0.0/docs/contributing.md +48 -0
  76. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/_utils.py +38 -0
  77. quantflow-0.9.0/docs/examples/volsurface.json → quantflow-1.0.0/docs/examples/fixtures/volsurface_btc.json +2654 -2851
  78. quantflow-1.0.0/docs/examples/fixtures/volsurface_eth.json +3916 -0
  79. quantflow-1.0.0/docs/examples/fixtures/yahoo_spx.json.gz +0 -0
  80. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/heston_volatility_pricer.py +2 -2
  81. quantflow-1.0.0/docs/examples/index.md +32 -0
  82. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/pricing_method_comparison.py +8 -8
  83. quantflow-1.0.0/docs/examples/rates_kalman.py +82 -0
  84. quantflow-1.0.0/docs/examples/spx_vol_surface.py +25 -0
  85. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/vol_surface_bns2_calibration.py +2 -2
  86. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/vol_surface_bns_calibration.py +2 -2
  87. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/vol_surface_heston_calibration.py +2 -2
  88. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/vol_surface_hestonj_calibration.py +4 -4
  89. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/vol_surface_inputs.py +2 -1
  90. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/wiener_volatility_pricer.py +1 -1
  91. {quantflow-0.9.0 → quantflow-1.0.0}/docs/glossary.md +127 -4
  92. quantflow-1.0.0/docs/index.md +47 -0
  93. {quantflow-0.9.0 → quantflow-1.0.0}/docs/references.bib +30 -0
  94. {quantflow-0.9.0 → quantflow-1.0.0}/docs/release-notes.md +71 -1
  95. quantflow-1.0.0/docs/theory/forwards.md +68 -0
  96. quantflow-1.0.0/docs/theory/kalman.md +329 -0
  97. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/option_pricing.md +13 -6
  98. {quantflow-0.9.0 → quantflow-1.0.0}/docs/tutorials/cir.md +1 -1
  99. quantflow-0.9.0/docs/tutorials/volatility_surface.md → quantflow-1.0.0/docs/tutorials/heston_calibration.md +4 -103
  100. quantflow-1.0.0/docs/tutorials/index.md +12 -0
  101. {quantflow-0.9.0 → quantflow-1.0.0}/docs/tutorials/option_pricing.md +1 -1
  102. quantflow-1.0.0/docs/tutorials/rates_kalman.md +111 -0
  103. quantflow-1.0.0/docs/tutorials/spx_vol_surface.md +31 -0
  104. quantflow-1.0.0/docs/tutorials/volatility_surface.md +131 -0
  105. quantflow-1.0.0/frontend/observablehq.config.js +51 -0
  106. quantflow-1.0.0/frontend/package-lock.json +5062 -0
  107. quantflow-1.0.0/frontend/package.json +18 -0
  108. quantflow-1.0.0/frontend/src/cointegration.md +82 -0
  109. quantflow-1.0.0/frontend/src/heston-vol-surface.md +102 -0
  110. quantflow-1.0.0/frontend/src/hurst.md +111 -0
  111. quantflow-1.0.0/frontend/src/index.md +18 -0
  112. quantflow-1.0.0/frontend/src/lib/api.ts +15 -0
  113. quantflow-1.0.0/frontend/src/lib/palette.ts +101 -0
  114. quantflow-1.0.0/frontend/src/sampling.md +158 -0
  115. quantflow-1.0.0/frontend/src/style.css +114 -0
  116. quantflow-1.0.0/frontend/src/supersmoother.md +81 -0
  117. quantflow-1.0.0/frontend/src/volatility-surface.md +212 -0
  118. quantflow-1.0.0/frontend/src/yield-curve.md +169 -0
  119. {quantflow-0.9.0 → quantflow-1.0.0}/mkdocs.yml +23 -12
  120. {quantflow-0.9.0/app → quantflow-1.0.0/notebooks}/heston_divfm_fit.py +6 -6
  121. {quantflow-0.9.0 → quantflow-1.0.0}/pyproject.toml +60 -36
  122. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/deribit.py +20 -29
  123. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/fed.py +42 -30
  124. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/fmp.py +22 -12
  125. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/fred.py +7 -7
  126. quantflow-1.0.0/quantflow/data/yahoo.py +298 -0
  127. quantflow-1.0.0/quantflow/dists/__init__.py +24 -0
  128. quantflow-1.0.0/quantflow/dists/base.py +33 -0
  129. quantflow-0.9.0/quantflow/utils/distributions.py → quantflow-1.0.0/quantflow/dists/distributions1d.py +51 -26
  130. quantflow-0.9.0/quantflow/utils/marginal.py → quantflow-1.0.0/quantflow/dists/marginal1d.py +95 -15
  131. quantflow-1.0.0/quantflow/dists/mv_normal.py +32 -0
  132. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/bs.py +5 -4
  133. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/calibration/base.py +19 -12
  134. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/calibration/bns.py +2 -2
  135. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/calibration/heston.py +4 -4
  136. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/divfm/pricer.py +4 -4
  137. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/divfm/trainer.py +2 -2
  138. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/inputs.py +59 -43
  139. quantflow-1.0.0/quantflow/options/moneyness.py +84 -0
  140. quantflow-1.0.0/quantflow/options/parity.py +167 -0
  141. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/pricer.py +67 -29
  142. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/strategies/__init__.py +2 -1
  143. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/strategies/base.py +15 -29
  144. quantflow-1.0.0/quantflow/options/strategies/butterfly.py +87 -0
  145. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/strategies/calendar_spread.py +28 -21
  146. quantflow-1.0.0/quantflow/options/strategies/spread.py +92 -0
  147. quantflow-1.0.0/quantflow/options/strategies/straddle.py +46 -0
  148. quantflow-1.0.0/quantflow/options/strategies/strangle.py +55 -0
  149. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/surface.py +531 -497
  150. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/svi.py +1 -1
  151. quantflow-1.0.0/quantflow/rates/__init__.py +51 -0
  152. quantflow-1.0.0/quantflow/rates/calibration.py +257 -0
  153. quantflow-1.0.0/quantflow/rates/cir.py +461 -0
  154. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/rates/interest_rate.py +9 -0
  155. quantflow-1.0.0/quantflow/rates/interpolated.py +214 -0
  156. quantflow-1.0.0/quantflow/rates/nelson_siegel.py +191 -0
  157. quantflow-1.0.0/quantflow/rates/no_discount.py +55 -0
  158. quantflow-1.0.0/quantflow/rates/options.py +179 -0
  159. quantflow-1.0.0/quantflow/rates/vasicek.py +349 -0
  160. quantflow-1.0.0/quantflow/rates/yield_curve.py +177 -0
  161. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/base.py +16 -7
  162. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/bns.py +34 -14
  163. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/cir.py +49 -14
  164. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/heston.py +28 -15
  165. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/jump_diffusion.py +23 -6
  166. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/ou.py +27 -5
  167. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/poisson.py +3 -3
  168. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/wiener.py +17 -2
  169. quantflow-1.0.0/quantflow/ta/base.py +5 -0
  170. quantflow-1.0.0/quantflow/ta/estimator.py +35 -0
  171. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/ta/ewma.py +65 -33
  172. quantflow-1.0.0/quantflow/ta/kalman.py +588 -0
  173. quantflow-1.0.0/quantflow/ta/ohlc.py +119 -0
  174. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/ta/supersmoother.py +11 -11
  175. quantflow-1.0.0/quantflow/utils/__init__.py +0 -0
  176. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/numbers.py +2 -0
  177. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/plot.py +31 -5
  178. quantflow-1.0.0/quantflow/utils/price.py +46 -0
  179. quantflow-1.0.0/quantflow/utils/text.py +23 -0
  180. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/types.py +6 -1
  181. quantflow-1.0.0/quantflow_tests/__init__.py +0 -0
  182. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/conftest.py +1 -1
  183. quantflow-1.0.0/quantflow_tests/test_app.py +270 -0
  184. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_cir.py +10 -0
  185. quantflow-1.0.0/quantflow_tests/test_cir_curve.py +171 -0
  186. quantflow-1.0.0/quantflow_tests/test_data.py +100 -0
  187. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_data_deribit.py +7 -14
  188. quantflow-1.0.0/quantflow_tests/test_data_yahoo.py +82 -0
  189. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_disable_outliers.py +10 -8
  190. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_distributions.py +1 -1
  191. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_divfm.py +83 -18
  192. quantflow-1.0.0/quantflow_tests/test_fmp_unit.py +75 -0
  193. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_heston.py +1 -1
  194. quantflow-1.0.0/quantflow_tests/test_heston_calibration.py +95 -0
  195. quantflow-1.0.0/quantflow_tests/test_interpolated_curve.py +262 -0
  196. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_jump_diffusion.py +1 -1
  197. quantflow-1.0.0/quantflow_tests/test_nelson_siegel.py +190 -0
  198. quantflow-1.0.0/quantflow_tests/test_non_inverse_surface.py +101 -0
  199. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_ohlc.py +4 -4
  200. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_options.py +40 -13
  201. quantflow-1.0.0/quantflow_tests/test_options_pricer.py +118 -0
  202. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_ou.py +1 -1
  203. quantflow-1.0.0/quantflow_tests/test_parity.py +83 -0
  204. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_poisson.py +1 -1
  205. quantflow-1.0.0/quantflow_tests/test_rates.py +89 -0
  206. quantflow-1.0.0/quantflow_tests/test_rates_options.py +97 -0
  207. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_strategies.py +6 -4
  208. quantflow-1.0.0/quantflow_tests/test_surface_calibration.py +130 -0
  209. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_surface_methods.py +1 -1
  210. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_svi.py +15 -15
  211. quantflow-1.0.0/quantflow_tests/test_ta_filters.py +68 -0
  212. quantflow-1.0.0/quantflow_tests/test_ta_kalman.py +262 -0
  213. quantflow-1.0.0/quantflow_tests/test_utils_dates_bins.py +53 -0
  214. quantflow-1.0.0/quantflow_tests/test_vasicek_curve.py +144 -0
  215. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_wiener.py +10 -0
  216. quantflow-1.0.0/quantflow_tests/test_yield_curve_fit.py +67 -0
  217. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/utils.py +5 -4
  218. quantflow-1.0.0/readme.md +47 -0
  219. {quantflow-0.9.0 → quantflow-1.0.0}/taplo.toml +10 -5
  220. quantflow-1.0.0/uv.lock +3536 -0
  221. quantflow-0.9.0/.coveragerc +0 -18
  222. quantflow-0.9.0/PKG-INFO +0 -120
  223. quantflow-0.9.0/app/__main__.py +0 -45
  224. quantflow-0.9.0/app/cointegration.py +0 -164
  225. quantflow-0.9.0/app/double_exponential_sampling.py +0 -81
  226. quantflow-0.9.0/app/gaussian_sampling.py +0 -91
  227. quantflow-0.9.0/app/heston_vol_surface.py +0 -165
  228. quantflow-0.9.0/app/hurst.py +0 -327
  229. quantflow-0.9.0/app/poisson_sampling.py +0 -72
  230. quantflow-0.9.0/app/supersmoother.py +0 -110
  231. quantflow-0.9.0/app/utils/__init__.py +0 -12
  232. quantflow-0.9.0/app/volatility_surface.py +0 -118
  233. quantflow-0.9.0/dev/install +0 -3
  234. quantflow-0.9.0/docs/api/rates/index.md +0 -1
  235. quantflow-0.9.0/docs/api/ta/ewma.md +0 -4
  236. quantflow-0.9.0/docs/api/ta/index.md +0 -1
  237. quantflow-0.9.0/docs/api/ta/kalman.md +0 -3
  238. quantflow-0.9.0/docs/api/utils/distributions.md +0 -9
  239. quantflow-0.9.0/docs/api/utils/marginal1d.md +0 -9
  240. quantflow-0.9.0/docs/contributing.md +0 -24
  241. quantflow-0.9.0/docs/index.md +0 -49
  242. quantflow-0.9.0/docs/mcp.md +0 -63
  243. quantflow-0.9.0/docs/tutorials/index.md +0 -9
  244. quantflow-0.9.0/quantflow/ai/__init__.py +0 -1
  245. quantflow-0.9.0/quantflow/ai/server.py +0 -27
  246. quantflow-0.9.0/quantflow/ai/tools/base.py +0 -33
  247. quantflow-0.9.0/quantflow/ai/tools/charts.py +0 -40
  248. quantflow-0.9.0/quantflow/ai/tools/crypto.py +0 -105
  249. quantflow-0.9.0/quantflow/ai/tools/fred.py +0 -82
  250. quantflow-0.9.0/quantflow/ai/tools/stocks.py +0 -99
  251. quantflow-0.9.0/quantflow/ai/tools/vault.py +0 -35
  252. quantflow-0.9.0/quantflow/options/strategies/butterfly.py +0 -100
  253. quantflow-0.9.0/quantflow/options/strategies/spread.py +0 -73
  254. quantflow-0.9.0/quantflow/options/strategies/straddle.py +0 -39
  255. quantflow-0.9.0/quantflow/options/strategies/strangle.py +0 -68
  256. quantflow-0.9.0/quantflow/rates/nelson_siegel.py +0 -123
  257. quantflow-0.9.0/quantflow/rates/yield_curve.py +0 -37
  258. quantflow-0.9.0/quantflow/ta/__init__.py +0 -5
  259. quantflow-0.9.0/quantflow/ta/base.py +0 -14
  260. quantflow-0.9.0/quantflow/ta/kalman.py +0 -72
  261. quantflow-0.9.0/quantflow/ta/ohlc.py +0 -109
  262. quantflow-0.9.0/quantflow_tests/fixtures/volsurface.json +0 -4359
  263. quantflow-0.9.0/quantflow_tests/test_ai.py +0 -461
  264. quantflow-0.9.0/quantflow_tests/test_data.py +0 -61
  265. quantflow-0.9.0/quantflow_tests/test_implied_fwd.py +0 -175
  266. quantflow-0.9.0/quantflow_tests/test_options_pricer.py +0 -53
  267. quantflow-0.9.0/quantflow_tests/test_rates.py +0 -220
  268. quantflow-0.9.0/readme.md +0 -49
  269. quantflow-0.9.0/uv.lock +0 -4568
  270. {quantflow-0.9.0 → quantflow-1.0.0}/.github/instructions/makefile.instructions.md +0 -0
  271. {quantflow-0.9.0 → quantflow-1.0.0}/.github/instructions/release.instructions.md +0 -0
  272. {quantflow-0.9.0 → quantflow-1.0.0}/.github/instructions/tutorial.instructions.md +0 -0
  273. {quantflow-0.9.0 → quantflow-1.0.0}/.github/workflows/deploy.yml +0 -0
  274. {quantflow-0.9.0 → quantflow-1.0.0}/.vscode/launch.json +0 -0
  275. {quantflow-0.9.0 → quantflow-1.0.0}/.vscode/settings.json +0 -0
  276. {quantflow-0.9.0 → quantflow-1.0.0}/.vscode/tasks.json +0 -0
  277. {quantflow-0.9.0 → quantflow-1.0.0}/CITATION.cff +0 -0
  278. {quantflow-0.9.0 → quantflow-1.0.0}/LICENSE +0 -0
  279. {quantflow-0.9.0/app/scripts → quantflow-1.0.0/app}/__init__.py +0 -0
  280. {quantflow-0.9.0/docs → quantflow-1.0.0/app/api}/__init__.py +0 -0
  281. {quantflow-0.9.0/docs/examples → quantflow-1.0.0/app/scripts}/__init__.py +0 -0
  282. {quantflow-0.9.0 → quantflow-1.0.0}/app/scripts/test_comparison.py +0 -0
  283. {quantflow-0.9.0/quantflow/ai/tools → quantflow-1.0.0/app/utils}/__init__.py +0 -0
  284. {quantflow-0.9.0 → quantflow-1.0.0}/dev/build-examples +0 -0
  285. {quantflow-0.9.0 → quantflow-1.0.0}/dev/charts.yaml +0 -0
  286. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/.helmignore +0 -0
  287. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/Chart.yaml +0 -0
  288. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/templates/_helpers.tpl +0 -0
  289. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/templates/_service.tpl +0 -0
  290. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/templates/app.yaml +0 -0
  291. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/templates/configmap.yaml +0 -0
  292. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/templates/secret.yaml +0 -0
  293. {quantflow-0.9.0 → quantflow-1.0.0}/dev/helm/values.yaml +0 -0
  294. {quantflow-0.9.0 → quantflow-1.0.0}/dev/marimo +0 -0
  295. {quantflow-0.9.0 → quantflow-1.0.0}/dev/test +0 -0
  296. {quantflow-0.9.0/quantflow/data → quantflow-1.0.0/docs}/__init__.py +0 -0
  297. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/data/deribit.md +0 -0
  298. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/data/fed.md +0 -0
  299. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/data/fmp.md +0 -0
  300. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/data/fred.md +0 -0
  301. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/divfm.md +0 -0
  302. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/index.md +0 -0
  303. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/pricer.md +0 -0
  304. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/options/svi.md +0 -0
  305. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/rates/interest_rate.md +0 -0
  306. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/bns.md +0 -0
  307. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/cir.md +0 -0
  308. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/compound_poisson.md +0 -0
  309. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/copula.md +0 -0
  310. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/dsp.md +0 -0
  311. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/heston.md +0 -0
  312. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/index.md +0 -0
  313. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/jump_diffusion.md +0 -0
  314. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/ou.md +0 -0
  315. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/poisson.md +0 -0
  316. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/sp/wiener.md +0 -0
  317. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/ta/ohlc.md +0 -0
  318. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/ta/paths.md +0 -0
  319. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/utils/bins.md +0 -0
  320. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/utils/numbers.md +0 -0
  321. {quantflow-0.9.0 → quantflow-1.0.0}/docs/api/utils/types.md +0 -0
  322. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/heston.gif +0 -0
  323. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/README.md +0 -0
  324. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/favicon.ico +0 -0
  325. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/head-snippet.html +0 -0
  326. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/manifest.json +0 -0
  327. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-app-icon-1024.png +0 -0
  328. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-app-icon-128.png +0 -0
  329. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-app-icon-256.png +0 -0
  330. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-app-icon-512.png +0 -0
  331. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-github-social-1280x640.png +0 -0
  332. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-linkedin-banner.png +0 -0
  333. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-lockup-1200.png +0 -0
  334. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-lockup-dark-1200.png +0 -0
  335. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-lockup-dark-2400.png +0 -0
  336. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-lockup-tagline-dark-1600.png +0 -0
  337. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-lockup-tagline-light-1600.png +0 -0
  338. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-1024.png +0 -0
  339. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-128.png +0 -0
  340. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-16.png +0 -0
  341. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-256.png +0 -0
  342. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-32.png +0 -0
  343. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-48.png +0 -0
  344. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-512.png +0 -0
  345. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-64.png +0 -0
  346. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-1024.png +0 -0
  347. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-128.png +0 -0
  348. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-16.png +0 -0
  349. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-256.png +0 -0
  350. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-32.png +0 -0
  351. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-48.png +0 -0
  352. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-512.png +0 -0
  353. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/png/quantflow-mark-dark-64.png +0 -0
  354. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-app-icon.svg +0 -0
  355. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-favicon.svg +0 -0
  356. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-linkedin-banner.svg +0 -0
  357. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-lockup-dark.svg +0 -0
  358. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-lockup-tagline-dark.svg +0 -0
  359. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-lockup-tagline-light.svg +0 -0
  360. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-lockup.svg +0 -0
  361. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-mark-dark.svg +0 -0
  362. {quantflow-0.9.0 → quantflow-1.0.0}/docs/assets/logos/quantflow-mark.svg +0 -0
  363. {quantflow-0.9.0/quantflow/options → quantflow-1.0.0/docs/examples}/__init__.py +0 -0
  364. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/cir_pdf_comparison.py +0 -0
  365. {quantflow-0.9.0 → quantflow-1.0.0}/docs/examples/fft.py +0 -0
  366. {quantflow-0.9.0/quantflow_tests → quantflow-1.0.0/docs/examples}/fixtures/deribit_futures.json +0 -0
  367. {quantflow-0.9.0/quantflow_tests → quantflow-1.0.0/docs/examples}/fixtures/deribit_instruments.json +0 -0
  368. {quantflow-0.9.0/quantflow_tests → quantflow-1.0.0/docs/examples}/fixtures/deribit_options.json +0 -0
  369. {quantflow-0.9.0 → quantflow-1.0.0}/docs/favicon.ico +0 -0
  370. {quantflow-0.9.0 → quantflow-1.0.0}/docs/javascripts/mathjax.js +0 -0
  371. {quantflow-0.9.0 → quantflow-1.0.0}/docs/robots.txt +0 -0
  372. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/characteristic.md +0 -0
  373. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/convexity_correction.md +0 -0
  374. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/index.md +0 -0
  375. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/inversion.md +0 -0
  376. {quantflow-0.9.0 → quantflow-1.0.0}/docs/theory/levy.md +0 -0
  377. {quantflow-0.9.0 → quantflow-1.0.0}/docs/tutorials/bns_calibration.md +0 -0
  378. {quantflow-0.9.0 → quantflow-1.0.0}/docs/tutorials/pricing_method_comparison.md +0 -0
  379. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/__init__.py +0 -0
  380. {quantflow-0.9.0/quantflow/rates → quantflow-1.0.0/quantflow/data}/__init__.py +0 -0
  381. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/fiscal_data.py +0 -0
  382. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/data/vault.py +0 -0
  383. {quantflow-0.9.0/quantflow/sp → quantflow-1.0.0/quantflow/options}/__init__.py +0 -0
  384. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/calibration/__init__.py +0 -0
  385. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/divfm/__init__.py +0 -0
  386. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/divfm/network.py +0 -0
  387. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/divfm/weights.py +0 -0
  388. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/butterfly.md +0 -0
  389. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/calendar_spread.md +0 -0
  390. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/spread.md +0 -0
  391. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/straddle.md +0 -0
  392. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/strangle.md +0 -0
  393. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/options/docs/terminology.md +0 -0
  394. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/py.typed +0 -0
  395. {quantflow-0.9.0/quantflow/utils → quantflow-1.0.0/quantflow/sp}/__init__.py +0 -0
  396. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/copula.py +0 -0
  397. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/sp/dsp.py +0 -0
  398. {quantflow-0.9.0/quantflow_tests → quantflow-1.0.0/quantflow/ta}/__init__.py +0 -0
  399. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/ta/paths.py +0 -0
  400. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/bins.py +0 -0
  401. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/dates.py +0 -0
  402. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/functions.py +0 -0
  403. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow/utils/transforms.py +0 -0
  404. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_bns.py +0 -0
  405. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_copula.py +0 -0
  406. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_frft.py +0 -0
  407. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_utils.py +0 -0
  408. {quantflow-0.9.0 → quantflow-1.0.0}/quantflow_tests/test_vault.py +0 -0
  409. {quantflow-0.9.0 → quantflow-1.0.0}/rops.toml +0 -0
@@ -14,3 +14,5 @@ __pycache__
14
14
  .pytest_cache
15
15
  .codebuild
16
16
  .gihub
17
+ frontend/node_modules
18
+ frontend/src/.observablehq
@@ -12,7 +12,19 @@ applyTo: '/**'
12
12
 
13
13
  * Always run `make lint` after code changes — runs taplo, isort, black, ruff, and mypy
14
14
  * Never edit `readme.md` directly — it is generated from `docs/index.md` via `make docs`
15
- * To install all dependencies (including all optional extras) run `make install-dev` — runs `uv sync --all-extras`
15
+ * To install all dependencies (including all optional extras) run `make install-dev`
16
+ * Do not modify code unless the developer explicitly asks for a code change.
17
+ * Never run `git commit` (or `git push`) unless the developer explicitly asks for it.
18
+ Preparing changes in the working tree is the deliverable; committing is the developer's action.
19
+ * Never change code that works unless you have been asked by the developer to do so,
20
+ or you have a good reason to believe the code is wrong.
21
+ * Concentrate on fixing the problem, not on making the code look nice unless you are
22
+ extremely confident that your code style is better than the original and that the original code style
23
+ is not serving a purpose (e.g. readability, consistency with other code, etc.).
24
+ If you are unsure, ask the developer or leave the code style as it is.
25
+
26
+ ## Run Tests
27
+
16
28
  * To run all tests use `make test` — runs all tests in the `tests/` directory using pytest
17
29
  * To run a specific test file, use `uv run pytest tests/path/to/test_file.py`
18
30
 
@@ -29,19 +41,44 @@ applyTo: '/**'
29
41
  * Documentation is built using [mkdocs](https://www.mkdocs.org/) and stored in the `docs/` directory. The documentation source files are written in markdown format.
30
42
  * Split prose into short paragraphs (one idea per paragraph) separated by blank lines. Never write a wall-of-text paragraph that strings together mechanism, rationale, caveats and usage advice. This applies to mkdocs tutorials, theory pages and long docstrings.
31
43
  * Do not use dashes (em dashes, en dashes, or hyphens used as dashes) in documentation files or docstrings. Use colons, parentheses, or restructure the sentence instead.
44
+ * Always use `Annotated(..., Doc("..."))` for docstrings in code, never use triple-quoted strings below the definition of a function or class. For example:
45
+ ```python
46
+ from typing_extensions import Annotated, Doc
47
+
48
+ def foo(x: Annotated[int, Doc("This is the docstring for x")]) -> float:
49
+ """This is the docstring for foo"""
50
+ return float(x)
51
+ ```
52
+ * Do not use Docstrings with markdown text that may generate headings (e.g. `# Heading`, `## Heading`, etc.)
32
53
  * Math in documentation and docstrings: always use `\begin{equation}...\end{equation}` for any formula or equation. Use `$...$` only for brief inline references to variables (e.g. $F$, $K$). Do not use `$$...$$`, `` `...` ``, or RST syntax (`.. math::`, `:math:`).
33
54
  * Math notation convention: use $\Phi$ for the characteristic function and $\phi$ for the characteristic exponent, where $\Phi = e^{-\phi}$.
34
55
  * Glossary entries in `docs/glossary.md` must be kept in alphabetical order.
35
- * Do not repeat concept definitions inline in tutorials or docstrings link to the glossary instead using a relative markdown link (e.g. `[moneyness](../glossary.md#moneyness)`).
56
+ * Do not repeat concept definitions inline in tutorials or docstrings, link to the glossary instead using a relative markdown link (e.g. `[moneyness](../glossary.md#moneyness)`).
57
+ * Use relative links for all mkdocs page links (e.g. `[Option Pricing](../theory/option_pricing.md)`) — prefer relative over absolute URLs to keep links shorter and portable.
58
+ * Prefer mkdocstrings relative cross-references whenever the target is visible from the current scope: write `[label][.member]` (same class) or `[label][..Sibling]` (same module) instead of repeating the fully-qualified path. Use the full path only when the target lives in a different module than the current docstring.
36
59
  * To rebuild doc examples run `uv run ./dev/build-examples` — runs all scripts in `docs/examples/` and writes their output to `docs/examples_output/`
37
60
 
38
61
  ## Pydantic models
39
62
 
40
- * Always document Pydantic fields with `Field(description=...)` never use a docstring below a field assignment
63
+ * Always document Pydantic fields with `Field(description=...)`, never use a docstring below a field assignment
41
64
  * Split long description strings across lines using implicit string concatenation rather than shortening the text
42
65
  * When a docstring line exceeds the line length limit, split it across multiple lines rather than shortening the text
66
+ * Put Pydantic config options directly in the class definition, not as a `model_config = ConfigDict(...)` class variable:
67
+ ```python
68
+ # correct
69
+ class Foo(BaseModel, arbitrary_types_allowed=True): ...
70
+
71
+ # wrong
72
+ class Foo(BaseModel):
73
+ model_config = ConfigDict(arbitrary_types_allowed=True)
74
+ ```
43
75
 
44
76
  ## Package structure
45
77
 
46
78
  * Strategy runtime markdown descriptions (read by `load_description()` at runtime) live inside the package at `quantflow/options/strategies/docs/` — they must be inside the package to be accessible when the library is installed
47
79
  * mkdocs documentation pages live in `docs/api/options/` — do not mix these two locations
80
+
81
+ ## Code Conventions
82
+
83
+ * Always use `utcnow` from `quantflow.utils.dates` for getting the current UTC datetime, never use `datetime.utcnow()` or `datetime.now()`
84
+ * Never import inside functions unless explicitly discussed; all imports should be at the top of the module
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: quantflow-bibliography-instructions
3
+ description: 'Instructions for bibliography in quantflow'
4
+ applyTo: '/**'
5
+ ---
6
+
7
+ Instructions for updating the bibliography for quantflow:
8
+
9
+ * The bibliography for quantflow is maintained in `docs/references.bib`
10
+ * Each entry must be added in alphabetical order of the label (the part after the first `{` in the bib entry).
11
+ * Regenerate the markdown file `docs/bibliography.md` from the `bib` file using the
12
+ ```bash
13
+ make docs-bib
14
+ ```
15
+ * Run this command every time you update the `bib` file to keep the markdown file in sync
16
+ * Do not edit `docs/bibliography.md` directly as it is generated from `docs/references.bib`.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: quantflow-observable-instructions
3
+ description: 'Instructions for Observable Framework pages in quantflow'
4
+ applyTo: '/frontend/src/**'
5
+ ---
6
+
7
+
8
+ # Observable Framework Instructions
9
+
10
+ These instructions apply to markdown files in `frontend/src/`, which are rendered by Observable Framework.
11
+
12
+ ## Math
13
+
14
+ Observable Framework uses KaTeX for math rendering. The syntax is different from standard markdown math (no `$...$` or `$$...$$`).
15
+
16
+ - **Display math** (block, centered): use a `tex` fenced code block:
17
+
18
+ ````
19
+ ```tex
20
+ E = mc^2
21
+ ```
22
+ ````
23
+
24
+ - **Inline math**: use the `tex` tagged template literal inside an inline expression:
25
+
26
+ ```
27
+ The smoothing factor ${tex`\alpha`} controls decay.
28
+ ```
29
+
30
+ - Do not use `$...$` or `$$...$$` for math in Observable Framework pages.
31
+ - Do not use `\begin{equation}...\end{equation}` (that convention applies only to mkdocs pages in `docs/`).
32
+
33
+ ## Downloads
34
+
35
+ Always render download actions as a `<button>` element (not an `<a>` link). Use the pattern:
36
+
37
+ ```js
38
+ const downloadData = () => {
39
+ const blob = new Blob([JSON.stringify(data, null, 2)], {type: "application/json"});
40
+ const url = URL.createObjectURL(blob);
41
+ const a = document.createElement("a");
42
+ a.href = url;
43
+ a.download = "filename.json";
44
+ a.click();
45
+ URL.revokeObjectURL(url);
46
+ };
47
+
48
+ display(html`<button onclick=${downloadData} style="cursor: pointer; background: var(--qf-primary); color: #fff; border: none; padding: 0.5em 1em; border-radius: 4px;">Download (JSON)</button>`);
49
+ ```
@@ -3,7 +3,7 @@ name: build
3
3
  on:
4
4
  push:
5
5
  branches-ignore:
6
- - deploy
6
+ - main
7
7
  tags-ignore:
8
8
  - v*
9
9
 
@@ -31,6 +31,10 @@ jobs:
31
31
  uses: actions/setup-python@v5
32
32
  with:
33
33
  python-version: ${{ matrix.python-version }}
34
+ - name: Start Redis
35
+ uses: supercharge/redis-github-action@1.8.1
36
+ with:
37
+ redis-version: 7
34
38
  - name: Install uv
35
39
  run: pip install -U pip uv
36
40
  - name: Install dependencies
@@ -50,25 +54,7 @@ jobs:
50
54
  token: ${{ secrets.CODECOV_TOKEN }}
51
55
  files: ./build/coverage.xml
52
56
 
53
- image:
54
- if: github.ref == 'refs/heads/main'
55
- uses: ./.github/workflows/docker-multiarch.yml
56
- needs: build
57
+ examples:
58
+ uses: ./.github/workflows/examples.yml
57
59
  with:
58
- image-name: quantflow
59
-
60
- deploy:
61
- name: Create Deployment
62
- if: github.ref == 'refs/heads/main'
63
- runs-on: ubuntu-latest
64
- permissions:
65
- deployments: write
66
- needs: image
67
- steps:
68
- - uses: chrnorm/deployment-action@v2
69
- name: Create GitHub deployment
70
- id: deployment
71
- with:
72
- token: "${{ secrets.TOKEN_DEPLOYMENT }}"
73
- environment: prod
74
- payload: '{"tag": "main-${{ github.sha }}"}'
60
+ upload: false
@@ -8,13 +8,24 @@ on:
8
8
  type: string
9
9
 
10
10
  jobs:
11
+ build-examples:
12
+ uses: ./.github/workflows/examples.yml
13
+ with:
14
+ upload: true
15
+
11
16
  build-amd64:
17
+ needs: build-examples
12
18
  runs-on: ubuntu-latest
13
19
  env:
14
20
  GITHUB_TOKEN: ${{ github.token }}
15
21
 
16
22
  steps:
17
23
  - uses: actions/checkout@v4
24
+ - name: download examples output
25
+ uses: actions/download-artifact@v4
26
+ with:
27
+ name: examples-output
28
+ path: docs
18
29
  - name: Login to GitHub Container Registry
19
30
  uses: docker/login-action@v3
20
31
  with:
@@ -31,6 +42,7 @@ jobs:
31
42
  run: rops docker push ${{ inputs.image-name }} --arch
32
43
 
33
44
  build-arm64:
45
+ needs: build-examples
34
46
  runs-on: ubuntu-24.04-arm
35
47
  env:
36
48
  GITHUB_TOKEN: ${{ github.token }}
@@ -38,6 +50,11 @@ jobs:
38
50
 
39
51
  steps:
40
52
  - uses: actions/checkout@v4
53
+ - name: download examples output
54
+ uses: actions/download-artifact@v4
55
+ with:
56
+ name: examples-output
57
+ path: docs
41
58
  - name: Login to GitHub Container Registry
42
59
  uses: docker/login-action@v3
43
60
  with:
@@ -0,0 +1,37 @@
1
+ name: examples
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ upload:
7
+ description: Upload the generated outputs as an artifact
8
+ type: boolean
9
+ default: true
10
+
11
+ jobs:
12
+ build-examples:
13
+ runs-on: ubuntu-latest
14
+ env:
15
+ GITHUB_TOKEN: ${{ github.token }}
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Set up Python
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.14"
23
+ - name: Install uv
24
+ run: pip install -U pip uv
25
+ - name: Install dependencies
26
+ run: uv sync --frozen --no-install-project --group docs --extra data
27
+ - name: build examples
28
+ run: uv run ./dev/build-examples
29
+ - name: upload examples output
30
+ if: inputs.upload
31
+ uses: actions/upload-artifact@v4
32
+ with:
33
+ name: examples-output
34
+ path: |
35
+ docs/assets/examples/
36
+ docs/examples/output/
37
+ if-no-files-found: error
@@ -0,0 +1,27 @@
1
+ name: main
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ image:
10
+ uses: ./.github/workflows/docker-multiarch.yml
11
+ with:
12
+ image-name: quantflow
13
+
14
+ deploy:
15
+ name: Create Deployment
16
+ runs-on: ubuntu-latest
17
+ permissions:
18
+ deployments: write
19
+ needs: image
20
+ steps:
21
+ - uses: chrnorm/deployment-action@v2
22
+ name: Create GitHub deployment
23
+ id: deployment
24
+ with:
25
+ token: "${{ secrets.TOKEN_DEPLOYMENT }}"
26
+ environment: prod
27
+ payload: '{"tag": "main-${{ github.sha }}"}'
@@ -16,6 +16,16 @@ permissions:
16
16
  jobs:
17
17
  release:
18
18
  runs-on: ubuntu-latest
19
+ services:
20
+ redis:
21
+ image: redis:7
22
+ ports:
23
+ - 6379:6379
24
+ options: >-
25
+ --health-cmd "redis-cli ping"
26
+ --health-interval 10s
27
+ --health-timeout 5s
28
+ --health-retries 5
19
29
  env:
20
30
  PYTHON_ENV: ci
21
31
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -37,6 +37,11 @@ dist
37
37
  _build
38
38
 
39
39
  # builds
40
+ docs/design
40
41
  app/docs
42
+ app/examples
43
+ frontend/node_modules
44
+ frontend/src/.observablehq
41
45
  docs/assets/examples
42
46
  docs/examples/output
47
+ docs/examples/cache
@@ -1,5 +1,7 @@
1
1
  @readme.md
2
2
  @.github/copilot-instructions.md
3
+ @.github/instructions/bibliography.instructions.md
3
4
  @.github/instructions/makefile.instructions.md
5
+ @.github/instructions/observable.instructions.md
4
6
  @.github/instructions/release.instructions.md
5
7
  @.github/instructions/tutorial.instructions.md
@@ -0,0 +1,85 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
7
+
8
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
9
+
10
+ ## Our Standards
11
+
12
+ Examples of behavior that contributes to a positive environment for our community include:
13
+
14
+ * Demonstrating empathy and kindness toward other people
15
+ * Being respectful of differing opinions, viewpoints, and experiences
16
+ * Giving and gracefully accepting constructive feedback
17
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
18
+ * Focusing on what is best not just for us as individuals, but for the overall community
19
+
20
+ Examples of unacceptable behavior include:
21
+
22
+ * The use of sexualized language or imagery, and sexual attention or advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email address, without their explicit permission
26
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
27
+
28
+ ## Enforcement Responsibilities
29
+
30
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
31
+
32
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
33
+
34
+ ## Scope
35
+
36
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
37
+
38
+ ## Enforcement
39
+
40
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at luca@quantmind.com. All complaints will be reviewed and investigated promptly and fairly.
41
+
42
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
43
+
44
+ ## Enforcement Guidelines
45
+
46
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
47
+
48
+ ### 1. Correction
49
+
50
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
51
+
52
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
53
+
54
+ ### 2. Warning
55
+
56
+ **Community Impact**: A violation through a single incident or series of actions.
57
+
58
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
59
+
60
+ ### 3. Temporary Ban
61
+
62
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
63
+
64
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
65
+
66
+ ### 4. Permanent Ban
67
+
68
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
69
+
70
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
71
+
72
+ ## Attribution
73
+
74
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
75
+
76
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
77
+
78
+ For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
79
+
80
+ [homepage]: https://www.contributor-covenant.org
81
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
82
+ [Mozilla CoC]: https://github.com/mozilla/diversity
83
+ [FAQ]: https://www.contributor-covenant.org/faq
84
+ [translations]: https://www.contributor-covenant.org/translations
85
+
@@ -5,11 +5,15 @@ help:
5
5
  @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
6
6
  @echo ================================================================================
7
7
 
8
+ .PHONY: app-serve
9
+ app-serve: ## serve app
10
+ @MICRO_SERVICE_HOST=127.0.0.1 uv run python -m app
11
+
8
12
  .PHONY: docs
9
13
  docs: ## build documentation
10
14
  @cp docs/index.md readme.md
11
15
  @uv run ./dev/build-examples
12
- @uv run mkdocs build
16
+ @uv run mkdocs build --strict
13
17
 
14
18
  .PHONY: docs-bib
15
19
  docs-bib: ## Regenerate docs bibliography
@@ -20,8 +24,17 @@ docs-examples: ## Regenerate docs examples
20
24
  @uv run ./dev/build-examples
21
25
 
22
26
  .PHONY: docs-serve
23
- docs-serve: ## serve documentation
24
- @uv run mkdocs serve --livereload --watch quantflow --watch docs
27
+ docs-serve: ## serve docs, examples, and API with auto-reload
28
+ @bash ./dev/docs-serve
29
+
30
+ .PHONY: frontend-build
31
+ frontend-build: ## build Observable frontend examples
32
+ @rm -rf app/examples
33
+ @npm --prefix frontend run build
34
+
35
+ .PHONY: frontend-serve
36
+ frontend-serve: ## serve Observable frontend with auto-reload
37
+ @bash ./dev/frontend-serve
25
38
 
26
39
  .PHONY: install-dev
27
40
  install-dev: ## Install development dependencies
@@ -35,10 +48,6 @@ lint: ## Lint and fix
35
48
  lint-check: ## Lint check only
36
49
  @uv run ./dev/lint
37
50
 
38
- .PHONY: marimo
39
- marimo: ## Run marimo for editing notebooks
40
- @./dev/marimo edit
41
-
42
51
  .PHONY: outdated
43
52
  outdated: ## Show outdated packages
44
53
  uv tree --outdated
@@ -0,0 +1,84 @@
1
+ Metadata-Version: 2.4
2
+ Name: quantflow
3
+ Version: 1.0.0
4
+ Summary: quantitative analysis
5
+ Project-URL: Homepage, https://github.com/quantmind/quantflow
6
+ Project-URL: Repository, https://github.com/quantmind/quantflow
7
+ Project-URL: Documentation, https://quantflow.quantmind.com
8
+ Project-URL: Issues, https://github.com/quantmind/quantflow/issues
9
+ Author-email: Luca Sbardella <luca@quantmind.com>
10
+ License-Expression: BSD-3-Clause
11
+ License-File: LICENSE
12
+ Keywords: finance,options,pricing,quantitative,stochastic,volatility
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Financial and Insurance Industry
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: BSD License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Office/Business :: Financial
24
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
25
+ Classifier: Typing :: Typed
26
+ Requires-Python: <3.15,>=3.11
27
+ Requires-Dist: ccy>=2.0.0
28
+ Requires-Dist: pandas>=2.0.0
29
+ Requires-Dist: pydantic>=2.0.2
30
+ Requires-Dist: scipy>=1.14.1
31
+ Requires-Dist: statsmodels<0.15.0,>=0.14.6
32
+ Provides-Extra: data
33
+ Requires-Dist: aio-fluid[http]>=2.4.0; extra == 'data'
34
+ Provides-Extra: ml
35
+ Requires-Dist: torch>=2.12.0; extra == 'ml'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # <a href="https://quantmind.github.io/quantflow"><img src="https://raw.githubusercontent.com/quantmind/quantflow/main/docs/assets/logos/quantflow-lockup.svg" width=300 /></a>
39
+
40
+ [![PyPI version](https://badge.fury.io/py/quantflow.svg)](https://badge.fury.io/py/quantflow)
41
+ [![Python versions](https://img.shields.io/pypi/pyversions/quantflow.svg)](https://pypi.org/project/quantflow)
42
+ [![Python downloads](https://static.pepy.tech/badge/quantflow/month)](https://pepy.tech/project/quantflow)
43
+ [![build](https://github.com/quantmind/quantflow/actions/workflows/build.yml/badge.svg)](https://github.com/quantmind/quantflow/actions/workflows/build.yml)
44
+ [![codecov](https://codecov.io/gh/quantmind/quantflow/branch/main/graph/badge.svg?token=wkH9lYKOWP)](https://codecov.io/gh/quantmind/quantflow)
45
+
46
+ Quantitative analysis and pricing tools.
47
+
48
+ ![btcvol](https://github.com/quantmind/quantflow/assets/144320/88ed85d1-c3c5-489c-ac07-21b036593214)
49
+
50
+ ## Installation
51
+
52
+ ```bash
53
+ pip install quantflow
54
+ ```
55
+ ### Optional dependencies
56
+
57
+ * `data` — data retrieval: `pip install quantflow[data]`
58
+ * `ml` — training the Deep Implied Volatility model: `pip install quantflow[ml]`
59
+
60
+ ## Features
61
+
62
+ * **Stochastic Processes**: a library of continuous-time models including Wiener processes, Poisson jumps, CIR mean-reverting dynamics, Heston stochastic volatility, jump-diffusion models, and the Barndorff-Nielsen & Shephard (BNS) model. Each process exposes its [characteristic function](https://quantflow.quantmind.com/theory/characteristic/) for analytical pricing.
63
+
64
+ * **Option Pricing and Calibration**: Black-Scholes pricing, implied volatility surfaces, SVI parameterisation, put/call parity, and model calibration (Heston, Double Heston). Includes support for both inverse (crypto) and standard (equity) quoting conventions.
65
+
66
+ * **Interest Rates**: yield curve construction via Nelson-Siegel and Vasicek models, discount factor calculation, and rate interpolation.
67
+
68
+ * **Market Data**: connectors for [Deribit](https://www.deribit.com), [Yahoo Finance](https://finance.yahoo.com), [Financial Modeling Prep](https://financialmodelingprep.com) (FMP), [FRED](https://fred.stlouisfed.org), the [Federal Reserve](https://www.federalreserve.gov), and [US Fiscal Data](https://fiscaldata.treasury.gov) APIs.
69
+
70
+ * **Time Series Analysis**: exponentially weighted moving averages (EWMA), Kalman filtering, super-smoothers, and OHLC bar utilities.
71
+
72
+ * **JSON Serializable**: all models and pricers are built on [Pydantic](https://docs.pydantic.dev), making them fully serializable to and from JSON.
73
+
74
+ ## Contributing
75
+
76
+ Contributions are welcome! See the [contributing guide](https://quantflow.quantmind.com/contributing/) for how to get started, including documentation contributions, which are a great entry point.
77
+
78
+ ## Citation
79
+
80
+ If you use Quantflow in your research, please cite it using the metadata in [CITATION.cff](https://github.com/quantmind/quantflow/blob/main/CITATION.cff).
81
+
82
+ ## License
83
+
84
+ Released under the [BSD 3-Clause License](https://github.com/quantmind/quantflow/blob/main/LICENSE).
@@ -0,0 +1,88 @@
1
+ import os
2
+
3
+ from dotenv import load_dotenv
4
+ from fastapi import APIRouter, FastAPI
5
+ from fastapi.middleware.cors import CORSMiddleware
6
+ from fastapi.openapi.docs import get_redoc_html
7
+ from fastapi.responses import HTMLResponse
8
+ from fastapi.staticfiles import StaticFiles
9
+ from fluid.utils import log
10
+
11
+ from app.utils.paths import APP_PATH
12
+ from quantflow import __version__
13
+
14
+ from .api.cointegration import cointegration_router
15
+ from .api.deps import instrument_app
16
+ from .api.heston import heston_router
17
+ from .api.hurst import hurst_router
18
+ from .api.rates import rates_router
19
+ from .api.sampling import sampling_router
20
+ from .api.smoother import smoother_router
21
+ from .api.status import status_router
22
+ from .api.volatility import volatility_router
23
+ from .utils.static import HtmlFallbackStaticFiles
24
+
25
+
26
+ def crate_app() -> FastAPI:
27
+ load_dotenv()
28
+ log.config()
29
+ app = FastAPI(
30
+ version=__version__,
31
+ title="Quantflow API",
32
+ description="API for Quantflow",
33
+ )
34
+ instrument_app(app)
35
+ cors_origins = [
36
+ origin.strip()
37
+ for origin in os.environ.get("QUANTFLOW_CORS_ORIGINS", "").split(",")
38
+ if origin.strip()
39
+ ]
40
+ if cors_origins:
41
+ app.add_middleware(
42
+ CORSMiddleware,
43
+ allow_origins=cors_origins,
44
+ allow_credentials=True,
45
+ allow_methods=["*"],
46
+ allow_headers=["*"],
47
+ )
48
+
49
+ api = APIRouter(prefix="/.api")
50
+
51
+ @api.get("/redoc", include_in_schema=False)
52
+ async def api_redoc() -> HTMLResponse:
53
+ return get_redoc_html(
54
+ openapi_url="/openapi.json",
55
+ title="Quantflow API",
56
+ )
57
+
58
+ api.include_router(cointegration_router, tags=["timeseries"])
59
+ api.include_router(heston_router, tags=["pricing"])
60
+ api.include_router(hurst_router, tags=["statistics"])
61
+ api.include_router(rates_router, tags=["pricing"])
62
+ api.include_router(sampling_router, tags=["statistics"])
63
+ api.include_router(smoother_router, tags=["timeseries"])
64
+ api.include_router(volatility_router, tags=["pricing"])
65
+ app.include_router(api)
66
+ app.include_router(status_router, include_in_schema=False)
67
+ examples_dir = APP_PATH / "examples"
68
+ if examples_dir.is_dir():
69
+ app.mount(
70
+ "/examples",
71
+ HtmlFallbackStaticFiles(directory=examples_dir, html=True),
72
+ name="examples",
73
+ )
74
+ docs_dir = APP_PATH / "docs"
75
+ if docs_dir.is_dir():
76
+ app.mount("/", StaticFiles(directory=docs_dir, html=True), name="static")
77
+ return app
78
+
79
+
80
+ # Run the server
81
+ if __name__ == "__main__":
82
+ import uvicorn
83
+
84
+ PORT = int(os.environ.get("MICRO_SERVICE_PORT", "8001"))
85
+ HOST = os.environ.get("MICRO_SERVICE_HOST", "0.0.0.0")
86
+ uvicorn.run(
87
+ crate_app(), host=HOST, port=PORT, proxy_headers=True, forwarded_allow_ips="*"
88
+ )