Metadata-Version: 2.4
Name: derivflow-finance
Version: 0.1.2
Summary: Advanced derivatives analytics platform for quantitative finance
Home-page: https://github.com/jeevanba273/derivflow-finance
Author: Jeevan B A
Author-email: Jeevan B A <jeevanba273@gmail.com>
Maintainer-email: Jeevan B A <jeevanba273@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/jeevanba273/derivflow-finance
Project-URL: Documentation, https://github.com/jeevanba273/derivflow-finance/wiki
Project-URL: Repository, https://github.com/jeevanba273/derivflow-finance.git
Project-URL: Bug Tracker, https://github.com/jeevanba273/derivflow-finance/issues
Keywords: derivatives,finance,quantitative,options,pricing,risk,analytics,monte-carlo,black-scholes,greeks
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.0
Requires-Dist: scipy>=1.7.0
Requires-Dist: pandas>=1.3.0
Requires-Dist: matplotlib>=3.4.0
Requires-Dist: plotly>=5.0.0
Requires-Dist: numba>=0.56.0
Requires-Dist: yfinance>=0.1.70
Requires-Dist: scikit-learn>=1.0.0
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.9; extra == "dev"
Requires-Dist: mypy>=0.910; extra == "dev"
Requires-Dist: jupyter>=1.0.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=4.0; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.0; extra == "docs"
Requires-Dist: myst-parser>=0.15; extra == "docs"
Provides-Extra: visualization
Requires-Dist: plotly>=5.0.0; extra == "visualization"
Requires-Dist: matplotlib>=3.4.0; extra == "visualization"
Requires-Dist: seaborn>=0.11.0; extra == "visualization"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: platform
Dynamic: requires-python

# 🚀 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**
