derivflow-finance


Namederivflow-finance JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://github.com/jeevanba273/derivflow-finance
SummaryAdvanced derivatives analytics platform for quantitative finance
upload_time2025-07-09 08:36:06
maintainerNone
docs_urlNone
authorJeevan B A
requires_python>=3.8
licenseMIT
keywords derivatives finance quantitative options pricing risk analytics monte-carlo black-scholes greeks
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🚀 DERIVFLOW-FINANCE

**Advanced Derivatives Analytics Platform for Quantitative Finance**

[![PyPI version](https://badge.fury.io/py/derivflow-finance.svg)](https://badge.fury.io/py/derivflow-finance)
[![Python](https://img.shields.io/pypi/pyversions/derivflow-finance.svg)](https://pypi.org/project/derivflow-finance/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://pepy.tech/badge/derivflow-finance)](https://pepy.tech/project/derivflow-finance)

**DERIVFLOW-FINANCE** is a comprehensive, professional-grade derivatives analytics platform built for quantitative finance professionals, researchers, and institutions. It provides advanced pricing models, risk analytics, and portfolio management tools with institutional-quality accuracy and performance.

## 🌟 **Key Features**

### 📊 **Advanced Pricing Models**

- **Multiple Methodologies**: Black-Scholes analytical, Binomial trees, Monte Carlo simulation
- **Exotic Options**: Barrier options (all variants), Asian options (arithmetic/geometric)
- **Stochastic Models**: Heston stochastic volatility model with calibration
- **Greeks Calculation**: Complete 1st, 2nd, and 3rd order Greeks with advanced sensitivities

### 💹 **Real-Time Market Data**

- **Live Data Integration**: Yahoo Finance API with intelligent caching
- **Options Chains**: Complete options data with implied volatilities
- **Historical Analytics**: Volatility calculation and risk-free rate extraction
- **Market Status**: Real-time market hours and trading status

### 📈 **Professional Risk Management**

- **Portfolio Analytics**: Multi-asset portfolio construction and valuation
- **VaR Calculation**: Parametric and Monte Carlo Value-at-Risk
- **Scenario Analysis**: Stress testing with custom scenarios
- **Hedging Optimization**: Delta hedging and risk minimization

### 🎨 **Interactive Visualizations**

- **3D Volatility Surfaces**: Professional volatility modeling with interpolation
- **Greeks Dashboards**: Interactive sensitivity analysis
- **Payoff Diagrams**: Option payoff and P&L visualization
- **Risk Charts**: Portfolio risk decomposition and analytics

## 🚀 **Quick Start**

### Installation

```bash
pip install derivflow-finance
```

### Basic Usage

```python
from derivflow import PricingEngine, GreeksCalculator, VolatilitySurface

# Price a European option
from derivflow.core import price_european_option
price = price_european_option(S=100, K=105, T=0.25, r=0.05, sigma=0.2, option_type='call')
print(f"Option Price: ${price:.2f}")

# Calculate Greeks
from derivflow.greeks import GreeksCalculator
calc = GreeksCalculator()
greeks = calc.calculate_greeks(S=100, K=105, T=0.25, r=0.05, sigma=0.2, option_type='call')
print(f"Delta: {greeks.delta:.4f}")

# Price exotic options
from derivflow.exotic import BarrierOptions, AsianOptions

# Barrier option
barrier = BarrierOptions()
result = barrier.price(S=100, K=105, H=95, T=0.25, r=0.05, sigma=0.2, 
                      barrier_type='down_and_out', option_type='call')
print(f"Barrier Option: ${result.price:.4f}")

# Asian option with variance reduction
asian = AsianOptions()
result = asian.price(S=100, K=105, T=0.25, r=0.05, sigma=0.2, 
                    option_type='call', asian_type='arithmetic')
print(f"Asian Option: ${result.price:.4f} ± {result.std_error:.4f}")
```

### Portfolio Risk Analytics

```python
from derivflow.portfolio import PortfolioRiskAnalyzer

# Create portfolio
portfolio = PortfolioRiskAnalyzer()

# Add positions
portfolio.add_stock_position('AAPL', quantity=100, current_price=150, volatility=0.25)
portfolio.add_option_position('AAPL', quantity=10, current_price=150, 
                             strike=155, expiry=0.25, option_type='call', volatility=0.25)

# Calculate risk metrics
portfolio_value = portfolio.calculate_portfolio_value()
greeks = portfolio.calculate_portfolio_greeks()
var_95, es_95 = portfolio.calculate_var_parametric(0.95)

print(f"Portfolio Value: ${portfolio_value:,.2f}")
print(f"Portfolio Delta: {greeks['delta']:.2f}")
print(f"95% VaR: ${var_95:,.2f}")
```

### Volatility Surface Modeling

```python
from derivflow.volatility import create_sample_surface

# Create and build volatility surface
surface = create_sample_surface()
surface.build_surface()

# Get volatility smile
smile = surface.get_smile(expiry=0.25, num_points=10)

# Interpolate volatility
vol = surface.interpolate(strike=102, expiry=0.33)
print(f"Interpolated Volatility: {vol:.1%}")
```

## 🎯 **Advanced Features**

### Stochastic Volatility Models

```python
from derivflow.models import HestonModel

# Heston stochastic volatility
heston = HestonModel()
heston.set_parameters(v0=0.04, kappa=2.0, theta=0.04, sigma=0.3, rho=-0.7)

# Price with stochastic volatility
result = heston.price_option(S=100, K=105, T=0.25, r=0.05, 
                            option_type='call', method='monte_carlo')
print(f"Heston Price: ${result.price:.4f}")
```

### Real-Time Market Data

```python
from derivflow.utils import AdvancedMarketData

# Get live market data
market_data = AdvancedMarketData()
price, timestamp = market_data.get_current_price('AAPL')
vol = market_data.get_historical_volatility('AAPL', days=30)

print(f"Current AAPL: ${price:.2f}")
print(f"30-day Volatility: {vol:.1%}")
```

## 📊 **Performance Benchmarks**

DERIVFLOW-FINANCE is optimized for institutional-grade performance:

- **Black-Scholes Pricing**: 4,000+ options per second
- **Monte Carlo Simulation**: 10,000 paths in <0.2 seconds
- **Asian Options**: 1,500x variance reduction with control variates
- **Greeks Calculation**: Complete sensitivity analysis in milliseconds

## 🎓 **Use Cases**

### **Investment Banking & Trading**

- Derivatives structuring and pricing
- Real-time risk management
- Volatility trading strategies
- Exotic products development

### **Academic Research**

- Financial engineering research
- Quantitative finance education
- PhD dissertations and papers
- Teaching materials and examples

### **Portfolio Management**

- Multi-asset portfolio construction
- Risk analytics and VaR calculation
- Hedging strategy optimization
- Stress testing and scenario analysis

### **Fintech Development**

- Pricing engines for trading platforms
- Risk management systems
- Regulatory compliance tools
- API development for financial services

## 🛠️ **Installation Options**

### Standard Installation

```bash
pip install derivflow-finance
```

### Development Installation

```bash
pip install derivflow-finance[dev]
```

### Full Installation (all features)

```bash
pip install derivflow-finance[visualization,testing,docs]
```

## 📚 **Documentation**

- **API Reference**: Complete function and class documentation
- **User Guide**: Step-by-step tutorials and examples
- **Theory Guide**: Mathematical foundations and model explanations
- **Examples**: Jupyter notebooks with real-world applications

## 🤝 **Contributing**

We welcome contributions from the quantitative finance community! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

```bash
git clone https://github.com/jeevanba273/derivflow-finance.git
cd derivflow-finance
pip install -e .[dev]
pytest tests/
```

## 📄 **License**

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## 🌟 **Acknowledgments**

- Built with modern Python scientific computing stack
- Inspired by quantitative finance research and industry best practices
- Designed for both academic research and commercial applications

## 📞 **Contact & Support**

- **Author**: Jeevan B A
- **Email**: jeevanba273@gmail.com
- **GitHub**: [@jeevanba273](https://github.com/jeevanba273)
- **Issues**: [GitHub Issues](https://github.com/jeevanba273/derivflow-finance/issues)

---

**⭐ Star this repository if DERIVFLOW-FINANCE helps your quantitative finance projects!**

**🚀 Built for the global quantitative finance community by Jeevan B A**

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/jeevanba273/derivflow-finance",
    "name": "derivflow-finance",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "Jeevan B A <jeevanba273@gmail.com>",
    "keywords": "derivatives, finance, quantitative, options, pricing, risk, analytics, monte-carlo, black-scholes, greeks",
    "author": "Jeevan B A",
    "author_email": "Jeevan B A <jeevanba273@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0a/11/ba39d82ddc00678ded18b040dcf99408ff29d05bfd1083e6c8320902bc69/derivflow_finance-0.1.2.tar.gz",
    "platform": "any",
    "description": "# \ud83d\ude80 DERIVFLOW-FINANCE\r\n\r\n**Advanced Derivatives Analytics Platform for Quantitative Finance**\r\n\r\n[![PyPI version](https://badge.fury.io/py/derivflow-finance.svg)](https://badge.fury.io/py/derivflow-finance)\r\n[![Python](https://img.shields.io/pypi/pyversions/derivflow-finance.svg)](https://pypi.org/project/derivflow-finance/)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Downloads](https://pepy.tech/badge/derivflow-finance)](https://pepy.tech/project/derivflow-finance)\r\n\r\n**DERIVFLOW-FINANCE** is a comprehensive, professional-grade derivatives analytics platform built for quantitative finance professionals, researchers, and institutions. It provides advanced pricing models, risk analytics, and portfolio management tools with institutional-quality accuracy and performance.\r\n\r\n## \ud83c\udf1f **Key Features**\r\n\r\n### \ud83d\udcca **Advanced Pricing Models**\r\n\r\n- **Multiple Methodologies**: Black-Scholes analytical, Binomial trees, Monte Carlo simulation\r\n- **Exotic Options**: Barrier options (all variants), Asian options (arithmetic/geometric)\r\n- **Stochastic Models**: Heston stochastic volatility model with calibration\r\n- **Greeks Calculation**: Complete 1st, 2nd, and 3rd order Greeks with advanced sensitivities\r\n\r\n### \ud83d\udcb9 **Real-Time Market Data**\r\n\r\n- **Live Data Integration**: Yahoo Finance API with intelligent caching\r\n- **Options Chains**: Complete options data with implied volatilities\r\n- **Historical Analytics**: Volatility calculation and risk-free rate extraction\r\n- **Market Status**: Real-time market hours and trading status\r\n\r\n### \ud83d\udcc8 **Professional Risk Management**\r\n\r\n- **Portfolio Analytics**: Multi-asset portfolio construction and valuation\r\n- **VaR Calculation**: Parametric and Monte Carlo Value-at-Risk\r\n- **Scenario Analysis**: Stress testing with custom scenarios\r\n- **Hedging Optimization**: Delta hedging and risk minimization\r\n\r\n### \ud83c\udfa8 **Interactive Visualizations**\r\n\r\n- **3D Volatility Surfaces**: Professional volatility modeling with interpolation\r\n- **Greeks Dashboards**: Interactive sensitivity analysis\r\n- **Payoff Diagrams**: Option payoff and P&L visualization\r\n- **Risk Charts**: Portfolio risk decomposition and analytics\r\n\r\n## \ud83d\ude80 **Quick Start**\r\n\r\n### Installation\r\n\r\n```bash\r\npip install derivflow-finance\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom derivflow import PricingEngine, GreeksCalculator, VolatilitySurface\r\n\r\n# Price a European option\r\nfrom derivflow.core import price_european_option\r\nprice = price_european_option(S=100, K=105, T=0.25, r=0.05, sigma=0.2, option_type='call')\r\nprint(f\"Option Price: ${price:.2f}\")\r\n\r\n# Calculate Greeks\r\nfrom derivflow.greeks import GreeksCalculator\r\ncalc = GreeksCalculator()\r\ngreeks = calc.calculate_greeks(S=100, K=105, T=0.25, r=0.05, sigma=0.2, option_type='call')\r\nprint(f\"Delta: {greeks.delta:.4f}\")\r\n\r\n# Price exotic options\r\nfrom derivflow.exotic import BarrierOptions, AsianOptions\r\n\r\n# Barrier option\r\nbarrier = BarrierOptions()\r\nresult = barrier.price(S=100, K=105, H=95, T=0.25, r=0.05, sigma=0.2, \r\n                      barrier_type='down_and_out', option_type='call')\r\nprint(f\"Barrier Option: ${result.price:.4f}\")\r\n\r\n# Asian option with variance reduction\r\nasian = AsianOptions()\r\nresult = asian.price(S=100, K=105, T=0.25, r=0.05, sigma=0.2, \r\n                    option_type='call', asian_type='arithmetic')\r\nprint(f\"Asian Option: ${result.price:.4f} \u00b1 {result.std_error:.4f}\")\r\n```\r\n\r\n### Portfolio Risk Analytics\r\n\r\n```python\r\nfrom derivflow.portfolio import PortfolioRiskAnalyzer\r\n\r\n# Create portfolio\r\nportfolio = PortfolioRiskAnalyzer()\r\n\r\n# Add positions\r\nportfolio.add_stock_position('AAPL', quantity=100, current_price=150, volatility=0.25)\r\nportfolio.add_option_position('AAPL', quantity=10, current_price=150, \r\n                             strike=155, expiry=0.25, option_type='call', volatility=0.25)\r\n\r\n# Calculate risk metrics\r\nportfolio_value = portfolio.calculate_portfolio_value()\r\ngreeks = portfolio.calculate_portfolio_greeks()\r\nvar_95, es_95 = portfolio.calculate_var_parametric(0.95)\r\n\r\nprint(f\"Portfolio Value: ${portfolio_value:,.2f}\")\r\nprint(f\"Portfolio Delta: {greeks['delta']:.2f}\")\r\nprint(f\"95% VaR: ${var_95:,.2f}\")\r\n```\r\n\r\n### Volatility Surface Modeling\r\n\r\n```python\r\nfrom derivflow.volatility import create_sample_surface\r\n\r\n# Create and build volatility surface\r\nsurface = create_sample_surface()\r\nsurface.build_surface()\r\n\r\n# Get volatility smile\r\nsmile = surface.get_smile(expiry=0.25, num_points=10)\r\n\r\n# Interpolate volatility\r\nvol = surface.interpolate(strike=102, expiry=0.33)\r\nprint(f\"Interpolated Volatility: {vol:.1%}\")\r\n```\r\n\r\n## \ud83c\udfaf **Advanced Features**\r\n\r\n### Stochastic Volatility Models\r\n\r\n```python\r\nfrom derivflow.models import HestonModel\r\n\r\n# Heston stochastic volatility\r\nheston = HestonModel()\r\nheston.set_parameters(v0=0.04, kappa=2.0, theta=0.04, sigma=0.3, rho=-0.7)\r\n\r\n# Price with stochastic volatility\r\nresult = heston.price_option(S=100, K=105, T=0.25, r=0.05, \r\n                            option_type='call', method='monte_carlo')\r\nprint(f\"Heston Price: ${result.price:.4f}\")\r\n```\r\n\r\n### Real-Time Market Data\r\n\r\n```python\r\nfrom derivflow.utils import AdvancedMarketData\r\n\r\n# Get live market data\r\nmarket_data = AdvancedMarketData()\r\nprice, timestamp = market_data.get_current_price('AAPL')\r\nvol = market_data.get_historical_volatility('AAPL', days=30)\r\n\r\nprint(f\"Current AAPL: ${price:.2f}\")\r\nprint(f\"30-day Volatility: {vol:.1%}\")\r\n```\r\n\r\n## \ud83d\udcca **Performance Benchmarks**\r\n\r\nDERIVFLOW-FINANCE is optimized for institutional-grade performance:\r\n\r\n- **Black-Scholes Pricing**: 4,000+ options per second\r\n- **Monte Carlo Simulation**: 10,000 paths in <0.2 seconds\r\n- **Asian Options**: 1,500x variance reduction with control variates\r\n- **Greeks Calculation**: Complete sensitivity analysis in milliseconds\r\n\r\n## \ud83c\udf93 **Use Cases**\r\n\r\n### **Investment Banking & Trading**\r\n\r\n- Derivatives structuring and pricing\r\n- Real-time risk management\r\n- Volatility trading strategies\r\n- Exotic products development\r\n\r\n### **Academic Research**\r\n\r\n- Financial engineering research\r\n- Quantitative finance education\r\n- PhD dissertations and papers\r\n- Teaching materials and examples\r\n\r\n### **Portfolio Management**\r\n\r\n- Multi-asset portfolio construction\r\n- Risk analytics and VaR calculation\r\n- Hedging strategy optimization\r\n- Stress testing and scenario analysis\r\n\r\n### **Fintech Development**\r\n\r\n- Pricing engines for trading platforms\r\n- Risk management systems\r\n- Regulatory compliance tools\r\n- API development for financial services\r\n\r\n## \ud83d\udee0\ufe0f **Installation Options**\r\n\r\n### Standard Installation\r\n\r\n```bash\r\npip install derivflow-finance\r\n```\r\n\r\n### Development Installation\r\n\r\n```bash\r\npip install derivflow-finance[dev]\r\n```\r\n\r\n### Full Installation (all features)\r\n\r\n```bash\r\npip install derivflow-finance[visualization,testing,docs]\r\n```\r\n\r\n## \ud83d\udcda **Documentation**\r\n\r\n- **API Reference**: Complete function and class documentation\r\n- **User Guide**: Step-by-step tutorials and examples\r\n- **Theory Guide**: Mathematical foundations and model explanations\r\n- **Examples**: Jupyter notebooks with real-world applications\r\n\r\n## \ud83e\udd1d **Contributing**\r\n\r\nWe welcome contributions from the quantitative finance community! Please see our [Contributing Guide](CONTRIBUTING.md) for details.\r\n\r\n### Development Setup\r\n\r\n```bash\r\ngit clone https://github.com/jeevanba273/derivflow-finance.git\r\ncd derivflow-finance\r\npip install -e .[dev]\r\npytest tests/\r\n```\r\n\r\n## \ud83d\udcc4 **License**\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## \ud83c\udf1f **Acknowledgments**\r\n\r\n- Built with modern Python scientific computing stack\r\n- Inspired by quantitative finance research and industry best practices\r\n- Designed for both academic research and commercial applications\r\n\r\n## \ud83d\udcde **Contact & Support**\r\n\r\n- **Author**: Jeevan B A\r\n- **Email**: jeevanba273@gmail.com\r\n- **GitHub**: [@jeevanba273](https://github.com/jeevanba273)\r\n- **Issues**: [GitHub Issues](https://github.com/jeevanba273/derivflow-finance/issues)\r\n\r\n---\r\n\r\n**\u2b50 Star this repository if DERIVFLOW-FINANCE helps your quantitative finance projects!**\r\n\r\n**\ud83d\ude80 Built for the global quantitative finance community by Jeevan B A**\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Advanced derivatives analytics platform for quantitative finance",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/jeevanba273/derivflow-finance/issues",
        "Documentation": "https://github.com/jeevanba273/derivflow-finance/wiki",
        "Homepage": "https://github.com/jeevanba273/derivflow-finance",
        "Repository": "https://github.com/jeevanba273/derivflow-finance.git"
    },
    "split_keywords": [
        "derivatives",
        " finance",
        " quantitative",
        " options",
        " pricing",
        " risk",
        " analytics",
        " monte-carlo",
        " black-scholes",
        " greeks"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b63938766b38d24934d906fa62001fe7d6e50bacfbee08a2593821c055bae3db",
                "md5": "cbc8246d527f2747b90254a8dd77d778",
                "sha256": "c8f889194f28fc80dbcb5dc54857617953d03eacb2204756a509af45eef29fbe"
            },
            "downloads": -1,
            "filename": "derivflow_finance-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbc8246d527f2747b90254a8dd77d778",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 57687,
            "upload_time": "2025-07-09T08:36:04",
            "upload_time_iso_8601": "2025-07-09T08:36:04.954211Z",
            "url": "https://files.pythonhosted.org/packages/b6/39/38766b38d24934d906fa62001fe7d6e50bacfbee08a2593821c055bae3db/derivflow_finance-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "0a11ba39d82ddc00678ded18b040dcf99408ff29d05bfd1083e6c8320902bc69",
                "md5": "5cf432ba9c10e6c053e950fbda6bdc09",
                "sha256": "c957de94c7f2d89f1607fdde98cef08f6a5ff19a6a2c480e2bf9ca37bfc66739"
            },
            "downloads": -1,
            "filename": "derivflow_finance-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "5cf432ba9c10e6c053e950fbda6bdc09",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 60931,
            "upload_time": "2025-07-09T08:36:06",
            "upload_time_iso_8601": "2025-07-09T08:36:06.111437Z",
            "url": "https://files.pythonhosted.org/packages/0a/11/ba39d82ddc00678ded18b040dcf99408ff29d05bfd1083e6c8320902bc69/derivflow_finance-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-09 08:36:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jeevanba273",
    "github_project": "derivflow-finance",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "derivflow-finance"
}
        
Elapsed time: 0.63426s