Skip to main content

Advanced derivatives analytics platform for quantitative finance

Project description

🚀 DERIVFLOW-FINANCE

Advanced Derivatives Analytics Platform for Quantitative Finance

PyPI version Python License: MIT Downloads

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

pip install derivflow-finance

Basic Usage

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

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

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

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

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

pip install derivflow-finance

Development Installation

pip install derivflow-finance[dev]

Full Installation (all features)

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 for details.

Development Setup

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 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


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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

derivflow_finance-0.1.1-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file derivflow_finance-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for derivflow_finance-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 81f81fb5a1fb8b1d114180e2abd926c580baeebb0315e9c9024f39976a158ddb
MD5 da46156c38c0af1fad728828c6dd09c2
BLAKE2b-256 e1500aa0fa375125edd86fd9a6874e2a9149c513ecdadc471bb3d33bbdc57e3e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page