期权风险检测系统

一个基于LangChain的智能代理系统,通过Black-Scholes和Monte Carlo模型定价引擎及RAG实时新闻分析,检测期权风险并识别理论价格优势。

  • by Mkscode92
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 Mkscode92/Volatility-Sentinel

使用说明

Volatility Sentinel

In the works. Python-based agentic system using LangChain to detect options risk via MCP and RAG. Features a custom MCP server executing Black-Scholes and Monte Carlo models, and a Django REST API that exposes the same pricing engine over HTTP with Redis-backed caching for expensive Monte Carlo simulations. Integrates a RAG pipeline for live market news, enabling the agent to dynamically adjust volatility and identify theoretical price edges in real-time.

Tech Stack:

  • Python
  • Django / Django REST Framework
  • Redis
  • Databricks
  • SQL
  • TypeScript
  • PySpark (Apache Spark)
  • LangChain

Pricing API

Run the Django server:

pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Requires a Redis instance reachable at REDIS_URL (defaults to redis://127.0.0.1:6379/1).

  • POST /api/black-scholes/ — {S, K, T, r, sigma, option_type} → price, delta, vega
  • POST /api/monte-carlo/ — same params plus optional num_simulations; identical requests are served from Redis instead of resimulating