FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
akshare update
tilakpatel22805699bad842
diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/MARKET_DATA_SOURCES.md b/fincept-terminal-desktop/src-tauri/resources/scripts/MARKET_DATA_SOURCES.mdindex af0da0265..44e7addf6 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/MARKET_DATA_SOURCES.md+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/MARKET_DATA_SOURCES.md@@ -12,7 +12,6 @@ Access comprehensive market data from leading financial data providers covering|----------|-----------|---------|-----------------|| 📊 **Yahoo Finance** | `yfinance_data.py` | ❌ No | Global stocks, ETFs, indices, forex, crypto, commodities || 📈 **Alpha Vantage** | `alphavantage_data.py` | 🔑 Required | Stocks, forex, crypto, technical indicators |-| 🔷 **Polygon.io** | `polygon_data.py` | 🔑 Required | US stocks, options, forex, crypto - real-time & historical || 🏛️ **NASDAQ** | `nasdaq_data.py` | ❌ No | NASDAQ-listed stocks, market statistics || 💼 **FMP** | `fmp_data.py` | 🔑 Required | Financial Modeling Prep - fundamentals, financials || 📉 **Trading Economics** | `trading_economics_data.py` | 🔑 Required | Global economic indicators, market forecasts |@@ -24,10 +23,10 @@ Access comprehensive market data from leading financial data providers covering| Category | Sources | Data Types ||----------|---------|------------|-| **Equities** | Yahoo Finance, Polygon, NASDAQ, FMP | Quotes, OHLCV, fundamentals, financials |-| **Options** | Polygon, CBOE | Chains, Greeks, implied volatility, open interest |+| **Equities** | Yahoo Finance, NASDAQ, FMP | Quotes, OHLCV, fundamentals, financials |+| **Options** | CBOE | Chains, Greeks, implied volatility, open interest || **Crypto** | CoinGecko, Yahoo Finance, Alpha Vantage | Prices, market cap, volume, exchanges |-| **Forex** | Yahoo Finance, Alpha Vantage, Polygon | Exchange rates, historical FX data |+| **Forex** | Yahoo Finance, Alpha Vantage | Exchange rates, historical FX data || **Commodities** | Yahoo Finance, Trading Economics | Metals, energy, agriculture || **Derivatives** | CFTC, CBOE | COT reports, futures positioning, volatility |@@ -36,7 +35,6 @@ Access comprehensive market data from leading financial data providers covering```bash# Required for premium featuresexport ALPHA_VANTAGE_API_KEY="your_key_here" # Get from: https://www.alphavantage.co/support/#api-key-export POLYGON_API_KEY="your_key_here" # Get from: https://polygon.io/export FMP_API_KEY="your_key_here" # Get from: https://financialmodelingprep.com/export TRADING_ECONOMICS_KEY="your_key_here" # Get from: https://tradingeconomics.com/api/```@@ -52,10 +50,6 @@ aapl = get_historical_data('AAPL', period='1y', interval='1d')from alphavantage_data import get_technical_indicatorrsi = get_technical_indicator('AAPL', 'RSI', interval='daily')-# Polygon.io - Real-time quotes-from polygon_data import get_quote-quote = get_quote('AAPL')-# CoinGecko - Crypto datafrom coingecko import get_coin_databtc = get_coin_data('bitcoin', vs_currency='usd', days=30)@@ -85,14 +79,6 @@ cot = get_cot_report(commodity='gold')- Fundamental data- 500 calls/day (free tier)-### Polygon.io-- Real-time market data-- Tick-level historical data-- Options chains-- Aggregates (OHLCV)-- News and sentiment-- WebSocket support-### NASDAQ- NASDAQ-listed securities- Market statistics@@ -142,7 +128,6 @@ cot = get_cot_report(commodity='gold')|----------|------------------|------------------|-------------|| Yahoo Finance | Real-time (15min delay) | Decades | None (unofficial API) || Alpha Vantage | Real-time | 20+ years | 500/day (free), unlimited (paid) |-| Polygon.io | Real-time | 2+ years (tick-level) | Based on plan || NASDAQ | Real-time | Varies | Generous || FMP | Daily | 10+ years | 250/day (free), more (paid) || Trading Economics | Varies | 70+ years | Based on plan |@@ -152,7 +137,7 @@ cot = get_cot_report(commodity='gold')## Technical Details-- **Protocol**: REST API (all), WebSocket (Polygon)+- **Protocol**: REST API (all)- **Format**: JSON (primary), CSV (some)- **Authentication**: API keys via headers or query params- **Rate Limiting**: Varies by provider@@ -160,4 +145,4 @@ cot = get_cot_report(commodity='gold')----**Total Sources**: 9 providers | **Free Access**: 4 sources | **Real-time Data**: 5 sources | **Last Updated**: 2025-12-28+**Total Sources**: 8 providers | **Free Access**: 4 sources | **Real-time Data**: 5 sources | **Last Updated**: 2025-01-29diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/README.md b/fincept-terminal-desktop/src-tauri/resources/scripts/README.mdindex c2e3bdec4..13b7a6ed2 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/README.md+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/README.md@@ -45,7 +45,7 @@ scripts/## Key Features### Data Integration (60+ Sources)-- **Market Data**: Yahoo Finance, Polygon.io, Alpha Vantage, TradingView, Databento+- **Market Data**: Yahoo Finance, Alpha Vantage, TradingView, Databento- **Economic Data**: FRED, World Bank, IMF, OECD, ECB, BEA, BLS- **Crypto**: CoinGecko, Kraken, Binance- **Government**: SEC Edgar, Congress.gov, Federal Reservediff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_bonds.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_bonds.pyindex a50f03703..949272430 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_bonds.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_bonds.py@@ -303,11 +303,47 @@ class BondsWrapper:return {"success": True,- "endpoints": endpoints,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Chinese Bond Market": ["bond_cb_jsl", "bond_cb_index_jsl", "bond_zh_cov_spot", "bond_zh_hs_daily", "bond_zh_hs_spot"],+ "Yield Curves": ["bond_china_yield", "bond_china_close_return", "bond_zh_us_rate"],+ "Government Bonds": ["bond_treasure_issue_cninfo", "bond_local_government_issue_cninfo"],+ "Corporate Bonds": ["bond_corporate_issue_cninfo", "bond_cov_issue_cninfo"],+ "Convertible Bonds": ["bond_cb_profile_sina", "bond_cb_summary_sina", "bond_cov_comparison"],+ },+ "timestamp": int(datetime.now().timestamp())+ },"count": len(endpoints),"timestamp": int(datetime.now().timestamp())}-# Export wrapper instance-bonds_wrapper = BondsWrapper()+# ==================== CLI ====================+def main():+ import sys+ wrapper = BondsWrapper()++ if len(sys.argv) < 2:+ print(json.dumps({"error": "Usage: python akshare_bonds.py <endpoint>"}))+ return++ endpoint = sys.argv[1]++ endpoint_map = {+ "get_all_endpoints": wrapper.get_all_available_endpoints,+ "bond_yield": wrapper.get_bond_china_yield,+ "bond_cb_jsl": wrapper.get_bond_cb_jsl,+ "bond_spot": wrapper.get_bond_zh_hs_spot,+ }++ method = endpoint_map.get(endpoint)+ if method:+ result = method()+ print(json.dumps(result, ensure_ascii=True, cls=DateTimeEncoder))+ else:+ print(json.dumps({"error": f"Unknown endpoint: {endpoint}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_company_info.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_company_info.pyindex 13f840cde..1997117e0 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_company_info.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_company_info.py@@ -110,37 +110,66 @@ def get_us_info(symbol):"timestamp": int(datetime.now().timestamp())}+def get_all_endpoints():+ """Get list of all available endpoints"""+ endpoints = ["cn_basic", "cn_profile", "hk_profile", "us_info"]+ return {+ "success": True,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "CN Stocks": ["cn_basic", "cn_profile"],+ "HK Stocks": ["hk_profile"],+ "US Stocks": ["us_info"]+ },+ "timestamp": int(datetime.now().timestamp())+ },+ "count": len(endpoints),+ "timestamp": int(datetime.now().timestamp())+ }+def main():# Reconfigure stdout to UTF-8if sys.platform == 'win32':import iosys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')- if len(sys.argv) < 3:+ if len(sys.argv) < 2:print(json.dumps({"success": False,- "error": "Missing endpoint or symbol parameter"+ "error": "Missing endpoint parameter"}))sys.exit(1)endpoint = sys.argv[1]- symbol = sys.argv[2]-- if endpoint == "cn_basic":- result = get_cn_basic_info(symbol)- elif endpoint == "cn_profile":- result = get_cn_profile(symbol)- elif endpoint == "hk_profile":- result = get_hk_profile(symbol)- elif endpoint == "us_info":- result = get_us_info(symbol)- else:- result = {++ # Handle get_all_endpoints without symbol+ if endpoint == "get_all_endpoints":+ result = get_all_endpoints()+ elif len(sys.argv) < 3:+ print(json.dumps({"success": False,- "error": f"Unknown endpoint: {endpoint}"- }+ "error": "Missing symbol parameter"+ }))+ sys.exit(1)+ else:+ symbol = sys.argv[2]+ if endpoint == "cn_basic":+ result = get_cn_basic_info(symbol)+ elif endpoint == "cn_profile":+ result = get_cn_profile(symbol)+ elif endpoint == "hk_profile":+ result = get_hk_profile(symbol)+ elif endpoint == "us_info":+ result = get_us_info(symbol)+ else:+ result = {+ "success": False,+ "error": f"Unknown endpoint: {endpoint}"+ }- print(json.dumps(result, ensure_ascii=False, default=str))+ print(json.dumps(result, ensure_ascii=True, default=str))if __name__ == "__main__":main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_crypto.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_crypto.pyindex ab547b182..6ef184af2 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_crypto.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_crypto.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_currency.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_currency.pyindex f4158d4f4..50efc4051 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_currency.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_currency.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_data.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_data.pyindex 46556bfda..f65c300af 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_data.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_data.py@@ -350,17 +350,14 @@ class AKShareDataWrapper:# ==================== UTILITY FUNCTIONS ====================def get_all_available_endpoints(self) -> Dict[str, Any]:- """Get list of all available endpoints in this wrapper"""- # Return the actual endpoint names used in endpoint_map, not method names+ """Get list of all WORKING endpoints in this wrapper"""endpoints = [- "stock_zh_spot", "stock_us_spot", "stock_hk_spot", "stock_symbols", "us_stock_symbols",- "fund_etf_spot", "fund_rank",+ "stock_zh_spot", "stock_us_spot", "stock_hk_spot", "stock_symbols",+ "fund_etf_spot", "fund_manager","china_gdp", "china_cpi", "china_pmi","bond_spot", "bond_yield","currency_rates", "forex_spot",- "futures_spot",- "air_quality", "carbon_trading",- "industry_pe", "hot_rank", "north_south_flow"+ "futures_spot"]return {"success": True,@@ -368,14 +365,12 @@ class AKShareDataWrapper:"available_endpoints": endpoints,"total_count": len(endpoints),"categories": {- "Stock Market": ["stock_zh_spot", "stock_us_spot", "stock_hk_spot", "stock_symbols", "us_stock_symbols"],- "Funds": ["fund_etf_spot", "fund_rank"],- "Economic": ["china_gdp", "china_cpi", "china_pmi"],+ "Stocks": ["stock_zh_spot", "stock_us_spot", "stock_hk_spot", "stock_symbols"],+ "Funds": ["fund_etf_spot", "fund_manager"],+ "Macro": ["china_gdp", "china_cpi", "china_pmi"],"Bonds": ["bond_spot", "bond_yield"],- "Currency & Forex": ["currency_rates", "forex_spot"],- "Futures": ["futures_spot"],- "Alternative Data": ["air_quality", "carbon_trading"],- "Market Analytics": ["industry_pe", "hot_rank", "north_south_flow"]+ "Forex": ["currency_rates", "forex_spot"],+ "Futures": ["futures_spot"]},"timestamp": int(datetime.now().timestamp())}@@ -403,29 +398,29 @@ def main():endpoint = sys.argv[1]args = sys.argv[2:] if len(sys.argv) > 2 else []- # Map endpoint names to method calls (original endpoints)+ # Map endpoint names to method calls - ONLY WORKING ENDPOINTSendpoint_map = {"get_all_endpoints": wrapper.get_all_available_endpoints,+ # Stocks - confirmed working"stock_zh_spot": wrapper.get_stock_zh_a_spot,"stock_us_spot": wrapper.get_stock_us_spot,"stock_hk_spot": wrapper.get_stock_hk_spot,"stock_symbols": wrapper.get_stock_info_a_code_name,- "us_stock_symbols": wrapper.get_us_stock_name,+ # Funds - confirmed working"fund_etf_spot": wrapper.get_fund_etf_spot,- "fund_rank": wrapper.get_fund_rank_em,+ "fund_manager": wrapper.get_fund_manager,+ # Macro - confirmed working"china_gdp": wrapper.get_macro_china_gdp,"china_cpi": wrapper.get_macro_china_cpi,"china_pmi": wrapper.get_macro_china_pmi,+ # Bonds - confirmed working"bond_spot": wrapper.get_bond_zh_hs_spot,"bond_yield": wrapper.get_bond_china_yield,+ # Forex - confirmed working"currency_rates": wrapper.get_currency_boc_sina,"forex_spot": wrapper.get_forex_spot,+ # Futures - confirmed working"futures_spot": wrapper.get_futures_zh_spot,- "air_quality": wrapper.get_air_quality_hebei,- "carbon_trading": wrapper.get_energy_carbon,- "industry_pe": wrapper.get_stock_industry_pe,- "hot_rank": wrapper.get_stock_hot_rank,- "north_south_flow": wrapper.get_stock_hsgt,}method = endpoint_map.get(endpoint)diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_derivatives.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_derivatives.pyindex 7aef545c2..c48933c7a 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_derivatives.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_derivatives.py@@ -255,6 +255,72 @@ class DerivativesWrapper:def get_option_vol_shfe(self, symbol: str = "cu") -> Dict[str, Any]:return self._safe_call_with_retry(ak.option_vol_shfe, symbol=symbol)+ # ==================== UTILITY ====================++ def get_all_available_endpoints(self) -> Dict[str, Any]:+ """Get list of all available endpoints"""+ endpoints = [+ "option_cffex_hs300_daily_sina", "option_cffex_hs300_list_sina", "option_cffex_hs300_spot_sina",+ "option_cffex_sz50_daily_sina", "option_cffex_sz50_list_sina", "option_cffex_sz50_spot_sina",+ "option_cffex_zz1000_daily_sina", "option_cffex_zz1000_list_sina", "option_cffex_zz1000_spot_sina",+ "option_comm_info", "option_comm_symbol", "option_commodity_contract_sina",+ "option_commodity_contract_table_sina", "option_commodity_hist_sina", "option_contract_info_ctp",+ "option_current_day_sse", "option_current_day_szse", "option_current_em",+ "option_daily_stats_sse", "option_daily_stats_szse",+ "option_finance_board", "option_finance_minute_sina", "option_finance_sse_underlying",+ "option_hist_czce", "option_hist_dce", "option_hist_gfex", "option_hist_shfe", "option_hist_yearly_czce",+ "option_lhb_em", "option_margin", "option_margin_symbol",+ "option_minute_em", "option_premium_analysis_em", "option_risk_analysis_em",+ "option_risk_indicator_sse", "option_value_analysis_em",+ "option_sse_codes_sina", "option_sse_daily_sina", "option_sse_expire_day_sina",+ "option_sse_greeks_sina", "option_sse_list_sina", "option_sse_minute_sina",+ "option_sse_spot_price_sina", "option_sse_underlying_spot_price_sina",+ "option_vol_gfex", "option_vol_shfe"+ ]-# Export wrapper instance-derivatives_wrapper = DerivativesWrapper()+ return {+ "success": True,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Contract Info": ["option_comm_info", "option_comm_symbol", "option_contract_info_ctp"],+ "Realtime": ["option_current_day_sse", "option_current_day_szse", "option_current_em"],+ "Historical": ["option_hist_czce", "option_hist_dce", "option_hist_gfex", "option_hist_shfe"],+ "Global": ["option_cffex_hs300_daily_sina", "option_cffex_sz50_daily_sina", "option_cffex_zz1000_daily_sina"],+ "CFFEX Options": ["option_cffex_hs300_list_sina", "option_cffex_sz50_list_sina", "option_cffex_zz1000_list_sina"],+ "SSE Options": ["option_sse_codes_sina", "option_sse_daily_sina", "option_sse_greeks_sina"],+ },+ "timestamp": int(datetime.now().timestamp())+ },+ "count": len(endpoints),+ "timestamp": int(datetime.now().timestamp())+ }+++# ==================== CLI ====================+def main():+ wrapper = DerivativesWrapper()++ if len(sys.argv) < 2:+ print(json.dumps({"error": "Usage: python akshare_derivatives.py <endpoint>"}))+ return++ endpoint = sys.argv[1]++ endpoint_map = {+ "get_all_endpoints": wrapper.get_all_available_endpoints,+ "option_comm_info": wrapper.get_option_comm_info,+ "option_current_day_sse": wrapper.get_option_current_day_sse,+ "option_sse_codes_sina": wrapper.get_option_sse_codes_sina,+ }++ method = endpoint_map.get(endpoint)+ if method:+ result = method()+ print(json.dumps(result, ensure_ascii=True, cls=DateTimeEncoder))+ else:+ print(json.dumps({"error": f"Unknown endpoint: {endpoint}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_china.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_china.pyindex ca071dd9b..f2b1babb9 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_china.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_china.py@@ -386,6 +386,83 @@ class ChinaEconomicsWrapper:def get_hk_market_info(self) -> Dict[str, Any]:return self._safe_call_with_retry(ak.macro_china_hk_market_info)+ # ==================== UTILITY ====================++ def get_all_available_endpoints(self) -> Dict[str, Any]:+ """Get list of all available endpoints"""+ endpoints = [+ "gdp", "gdp_yearly", "cpi", "cpi_monthly", "cpi_yearly", "ppi", "ppi_yearly",+ "pmi", "pmi_yearly", "non_man_pmi", "money_supply", "supply_of_money", "m2_yearly",+ "shibor_all", "lpr", "swap_rate", "reserve_requirement_ratio", "new_financial_credit",+ "bank_financing", "central_bank_balance", "trade_balance", "exports_yoy", "imports_yoy",+ "fdi", "fx_reserves_yearly", "fx_gold", "foreign_exchange_gold", "rmb",+ "industrial_production_yoy", "construction_index", "construction_price_index",+ "enterprise_boom_index", "cx_pmi_yearly", "cx_services_pmi_yearly",+ "real_estate", "new_house_price", "consumer_goods_retail", "retail_price_index",+ "agricultural_index", "agricultural_product", "vegetable_basket",+ "daily_energy", "energy_index", "society_electricity", "commodity_price_index", "au_report",+ "urban_unemployment", "national_tax_receipts", "czsr", "gdzctz", "hgjck",+ "gyzjz", "qyspjg", "shrzgm", "wbck", "whxd", "xfzxx",+ "stock_market_cap", "market_margin_sh", "market_margin_sz", "bond_public",+ "insurance", "insurance_income", "freight_index", "bdti_index", "bsi_index",+ "lpi_index", "society_traffic_volume", "passenger_load_factor",+ "postal_telecommunicational", "mobile_number", "international_tourism_fx", "yw_electronic_index",+ "nbs_nation", "nbs_region",+ "hk_cpi", "hk_cpi_ratio", "hk_ppi", "hk_gbp", "hk_gbp_ratio",+ "hk_rate_of_unemployment", "hk_trade_diff_ratio", "hk_building_amount",+ "hk_building_volume", "hk_market_info"+ ]-# Export wrapper instance-china_economics_wrapper = ChinaEconomicsWrapper()+ return {+ "success": True,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Core Indicators": ["gdp", "cpi", "ppi", "pmi", "gdp_yearly", "cpi_yearly", "ppi_yearly"],+ "Monetary & Financial": ["money_supply", "m2_yearly", "shibor_all", "lpr", "swap_rate"],+ "Trade & FX": ["trade_balance", "exports_yoy", "imports_yoy", "fdi", "fx_reserves_yearly"],+ "Industry & Production": ["industrial_production_yoy", "construction_index", "enterprise_boom_index"],+ "Real Estate": ["real_estate", "new_house_price"],+ "Consumption": ["consumer_goods_retail", "retail_price_index"],+ "Agriculture": ["agricultural_index", "agricultural_product", "vegetable_basket"],+ "Energy": ["daily_energy", "energy_index", "society_electricity"],+ "Employment": ["urban_unemployment"],+ "Markets": ["stock_market_cap", "market_margin_sh", "market_margin_sz"],+ "Hong Kong": ["hk_cpi", "hk_gdp", "hk_ppi", "hk_market_info"],+ },+ "timestamp": int(datetime.now().timestamp())+ },+ "count": len(endpoints),+ "timestamp": int(datetime.now().timestamp())+ }+++# ==================== CLI ====================+def main():+ wrapper = ChinaEconomicsWrapper()++ if len(sys.argv) < 2:+ print(json.dumps({"error": "Usage: python akshare_economics_china.py <endpoint>"}))+ return++ endpoint = sys.argv[1]++ endpoint_map = {+ "get_all_endpoints": wrapper.get_all_available_endpoints,+ "gdp": wrapper.get_gdp,+ "cpi": wrapper.get_cpi,+ "pmi": wrapper.get_pmi,+ "money_supply": wrapper.get_money_supply,+ "trade_balance": wrapper.get_trade_balance,+ }++ method = endpoint_map.get(endpoint)+ if method:+ result = method()+ print(json.dumps(result, ensure_ascii=True, cls=DateTimeEncoder))+ else:+ print(json.dumps({"error": f"Unknown endpoint: {endpoint}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_global.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_global.pyindex 596398feb..a86a85cce 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_global.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_economics_global.py@@ -274,11 +274,48 @@ class GlobalEconomicsWrapper:return {"success": True,- "endpoints": endpoints,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "USA": ["macro_usa_gdp_monthly", "macro_usa_cpi_monthly", "macro_usa_unemployment_rate"],+ "Eurozone": ["macro_euro_gdp_yoy", "macro_euro_cpi_yoy", "macro_euro_manufacturing_pmi"],+ "UK": ["macro_uk_gdp_yearly", "macro_uk_cpi_yearly", "macro_uk_unemployment_rate"],+ "Japan": ["macro_japan_cpi_yearly", "macro_japan_unemployment_rate"],+ "Canada": ["macro_canada_gdp_monthly", "macro_canada_cpi_monthly", "macro_canada_unemployment_rate"],+ "Australia": ["macro_australia_cpi_quarterly", "macro_australia_unemployment_rate"],+ },+ "timestamp": int(datetime.now().timestamp())+ },"count": len(endpoints),"timestamp": int(datetime.now().timestamp())}-# Export wrapper instance-global_economics_wrapper = GlobalEconomicsWrapper()+# ==================== CLI ====================+def main():+ wrapper = GlobalEconomicsWrapper()++ if len(sys.argv) < 2:+ print(json.dumps({"error": "Usage: python akshare_economics_global.py <endpoint>"}))+ return++ endpoint = sys.argv[1]++ endpoint_map = {+ "get_all_endpoints": wrapper.get_all_available_endpoints,+ "macro_usa_gdp_monthly": wrapper.get_macro_usa_gdp_monthly,+ "macro_usa_cpi_monthly": wrapper.get_macro_usa_cpi_monthly,+ "macro_euro_gdp_yoy": wrapper.get_macro_euro_gdp_yoy,+ "macro_uk_gdp_yearly": wrapper.get_macro_uk_gdp_yearly,+ }++ method = endpoint_map.get(endpoint)+ if method:+ result = method()+ print(json.dumps(result, ensure_ascii=True, cls=DateTimeEncoder))+ else:+ print(json.dumps({"error": f"Unknown endpoint: {endpoint}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_energy.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_energy.pyindex 2a0e4da37..3d4a65a48 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_energy.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_energy.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):@@ -43,8 +46,12 @@ def safe_call(func, *args, **kwargs):if attempt < max_retries - 1:time.sleep(1)continue- return {"success": False, "error": str(e), "data": []}- return {"success": False, "error": "Max retries exceeded", "data": []}+ error_msg = str(e)+ # Add context for common errors+ if "find_all" in error_msg or "NoneType" in error_msg:+ error_msg = f"Data source unavailable or temporarily down: {error_msg}"+ return {"success": False, "error": error_msg, "data": []}+ return {"success": False, "error": "Data source unavailable after retries", "data": []}# ==================== CARBON TRADING ====================diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_funds_expanded.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_funds_expanded.pyindex a78cef6cc..dac4b9ba1 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_funds_expanded.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_funds_expanded.py@@ -510,11 +510,48 @@ class ExpandedFundsWrapper:return {"success": True,- "available_endpoints": endpoints,- "total_count": len(endpoints),+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Fund Rankings": ["get_fund_open_fund_rank_em", "get_fund_etf_fund_info_em", "get_fund_money_fund_daily_em"],+ "Fund Info": ["get_fund_info_index_em", "get_fund_individual_basic_info_xq", "get_fund_name_em"],+ "Fund Holdings": ["get_fund_portfolio_hold_em", "get_fund_stock_position_lg", "get_fund_balance_position_lg"],+ "Fund Managers": ["get_fund_manager_em", "get_fund_manager_detail", "get_fund_manager_performance"],+ "Fund Flows": ["get_fund_flow_em", "get_fund_flow_daily", "get_fund_flow_weekly"],+ "Fund Dividends": ["get_fund_fh_em", "get_fund_fh_rank_em"],+ },+ "timestamp": int(datetime.now().timestamp())+ },+ "count": len(endpoints),"timestamp": int(datetime.now().timestamp())}-# Export wrapper instance-expanded_funds_wrapper = ExpandedFundsWrapper()+# ==================== CLI ====================+def main():+ import sys+ wrapper = ExpandedFundsWrapper()++ if len(sys.argv) < 2:+ print(json.dumps({"error": "Usage: python akshare_funds_expanded.py <endpoint>"}))+ return++ endpoint = sys.argv[1]++ endpoint_map = {+ "get_all_endpoints": wrapper.get_all_available_endpoints,+ "get_fund_open_fund_rank_em": wrapper.get_fund_open_fund_rank_em,+ "get_fund_etf_fund_info_em": wrapper.get_fund_etf_fund_info_em,+ "get_fund_name_em": wrapper.get_fund_name_em,+ }++ method = endpoint_map.get(endpoint)+ if method:+ result = method()+ print(json.dumps(result, ensure_ascii=True))+ else:+ print(json.dumps({"error": f"Unknown endpoint: {endpoint}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_futures.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_futures.pyindex 094368175..fae9b1e98 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_futures.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_futures.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_index.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_index.pyindex 6d7d8596e..1417ab78a 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_index.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_index.py@@ -30,10 +30,13 @@ def safe_call(func, *args, **kwargs):if isinstance(result, pd.DataFrame):if result.empty:return {"success": True, "data": [], "count": 0}- # Convert timestamps+ # Convert timestamps and handle NaN valuesfor col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float('inf'), float('-inf')], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_macro.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_macro.pyindex 181750983..8efcba6f0 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_macro.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_macro.py@@ -64,6 +64,9 @@ class MacroEconomicWrapper:if pd.api.types.is_datetime64_any_dtype(df[col]):df[col] = df[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ df = df.replace([float('inf'), float('-inf')], None)+ df = df.where(pd.notna(df), None)data = df.to_dict(orient='records')else:data = df@@ -501,6 +504,27 @@ class MacroEconomicWrapper:"""USA S&P Case-Shiller 20-city home price index"""return self._safe_call_with_retry(ak.macro_usa_spcs20)+ def get_all_available_endpoints(self) -> Dict[str, Any]:+ """Get list of all available macro endpoints"""+ endpoints = [name for name in dir(self) if name.startswith('macro_') and callable(getattr(self, name))]+ return {+ "success": True,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Australia": [e for e in endpoints if 'australia' in e],+ "USA": [e for e in endpoints if 'usa' in e],+ "Euro": [e for e in endpoints if 'euro' in e],+ "UK": [e for e in endpoints if 'uk' in e],+ "Japan": [e for e in endpoints if 'japan' in e],+ "Canada": [e for e in endpoints if 'canada' in e],+ "Global": [e for e in endpoints if any(x in e for x in ['china', 'swiss', 'germany', 'brazil', 'india', 'russia'])]+ }+ },+ "count": len(endpoints)+ }+def main():"""CLI interface for macro economic data wrapper"""@@ -531,15 +555,19 @@ def main():wrapper = MacroEconomicWrapper()function_name = sys.argv[1]- if hasattr(wrapper, function_name):+ # Handle get_all_endpoints special case+ if function_name == "get_all_endpoints":+ result = wrapper.get_all_available_endpoints()+ print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=True))+ elif hasattr(wrapper, function_name):func = getattr(wrapper, function_name)result = func()- print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=False, indent=2))+ print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=True))else:print(json.dumps({"error": f"Function '{function_name}' not found","hint": "Use 'python akshare_macro.py' to see available functions"- }, cls=DateTimeEncoder, ensure_ascii=False, indent=2))+ }, cls=DateTimeEncoder, ensure_ascii=True))sys.exit(1)diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_misc.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_misc.pyindex 975d23156..16c330ae4 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_misc.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_misc.py@@ -47,6 +47,9 @@ class MiscWrapper:for col in df.columns:if pd.api.types.is_datetime64_any_dtype(df[col]):df[col] = df[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ df = df.replace([float('inf'), float('-inf')], None)+ df = df.where(pd.notna(df), None)data = df.to_dict(orient='records')else:data = df@@ -594,6 +597,26 @@ class MiscWrapper:"""Xincaifu ranking"""return self._safe_call_with_retry(ak.xincaifu_rank)+ def get_all_available_endpoints(self) -> Dict[str, Any]:+ """Get list of all available misc endpoints"""+ endpoints = [name for name in dir(self) if not name.startswith('_') and callable(getattr(self, name)) and name != 'get_all_available_endpoints']+ return {+ "success": True,+ "data": {+ "available_endpoints": endpoints,+ "total_count": len(endpoints),+ "categories": {+ "Get Functions": [e for e in endpoints if e.startswith('get_')],+ "Spot Functions": [e for e in endpoints if e.startswith('spot_')],+ "AMAC": [e for e in endpoints if 'amac' in e],+ "Stock": [e for e in endpoints if 'stock' in e and not e.startswith('get_')],+ "Air Quality": [e for e in endpoints if 'air' in e],+ "Other": [e for e in endpoints if not any(e.startswith(p) for p in ['get_', 'spot_']) and not any(k in e for k in ['amac', 'stock', 'air'])]+ }+ },+ "count": len(endpoints)+ }+def main():"""CLI interface for miscellaneous functions wrapper"""@@ -631,17 +654,21 @@ def main():wrapper = MiscWrapper()function_name = sys.argv[1]- if hasattr(wrapper, function_name):+ # Handle get_all_endpoints special case+ if function_name == "get_all_endpoints":+ result = wrapper.get_all_available_endpoints()+ print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=True))+ elif hasattr(wrapper, function_name):func = getattr(wrapper, function_name)# Parse additional arguments if neededargs = sys.argv[2:] if len(sys.argv) > 2 else []result = func(*args) if args else func()- print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=False, indent=2))+ print(json.dumps(result, cls=DateTimeEncoder, ensure_ascii=True))else:print(json.dumps({"error": f"Function '{function_name}' not found","hint": "Use 'python akshare_misc.py' to see available functions"- }, cls=DateTimeEncoder, ensure_ascii=False, indent=2))+ }, cls=DateTimeEncoder, ensure_ascii=True))sys.exit(1)diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_news.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_news.pyindex eb9387d91..8b472afed 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_news.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_news.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_reits.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_reits.pyindex fef11049a..952070c06 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_reits.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_reits.py@@ -33,6 +33,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):@@ -57,9 +60,9 @@ def get_reits_hist(symbol="180101", period="daily", start_date="20200101", end_d"""Get REITs historical data"""return safe_call(ak.reits_hist_em, symbol=symbol, period=period, start_date=start_date, end_date=end_date, adjust=adjust)-def get_reits_hist_min(symbol="180101", period="1"):+def get_reits_hist_min(symbol="180101"):"""Get REITs minute historical data"""- return safe_call(ak.reits_hist_min_em, symbol=symbol, period=period)+ return safe_call(ak.reits_hist_min_em, symbol=symbol)# ==================== ENDPOINT REGISTRY ====================diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_board.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_board.pyindex 05aad52c4..e72346d24 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_board.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_board.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_financial.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_financial.pyindex 0ccb6c66f..ef72eb922 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_financial.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_financial.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_funds.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_funds.pyindex db9a15202..9494fb8e9 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_funds.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_funds.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_historical.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_historical.pyindex ee4c8c0ac..a8bd83a83 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_historical.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_historical.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_holders.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_holders.pyindex 33f3e88be..f7282296b 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_holders.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_holders.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):@@ -56,7 +59,7 @@ def get_stock_main_stock_holder(symbol="000001"):def get_stock_circulate_stock_holder(symbol="000001"):"""Get circulating stock holders"""- return safe_call(ak.stock_circulate_stock_holder, stock=symbol)+ return safe_call(ak.stock_circulate_stock_holder, symbol=symbol)def get_stock_zh_a_gdhs(symbol="000001"):"""Get A-shares shareholder count"""@@ -137,7 +140,7 @@ def get_stock_gddh_em():def get_stock_fund_stock_holder(symbol="000001"):"""Get fund stock holdings"""- return safe_call(ak.stock_fund_stock_holder, stock=symbol)+ return safe_call(ak.stock_fund_stock_holder, symbol=symbol)def get_stock_report_fund_hold(symbol="000001", date=""):"""Get fund holding report"""diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_hot.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_hot.pyindex 06d79ef93..2b98acb0e 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_hot.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_hot.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):@@ -169,13 +172,15 @@ def get_stock_comment_detail_zlkp_jgcyd_em(symbol="000001"):# ==================== WEIBO SENTIMENT ====================-def get_stock_js_weibo_report(symbol="000001"):- """Get Weibo stock report"""- return safe_call(ak.stock_js_weibo_report, stock=symbol)+def get_stock_js_weibo_report(time_period="CNHOUR12"):+ """Get Weibo stock report+ time_period: CNHOUR2, CNHOUR6, CNHOUR12, CNHOUR24, CNDAY7, CNDAY30+ """+ return safe_call(ak.stock_js_weibo_report, time_period=time_period)-def get_stock_js_weibo_nlp_time(symbol="000001"):- """Get Weibo NLP time data"""- return safe_call(ak.stock_js_weibo_nlp_time, stock=symbol)+def get_stock_js_weibo_nlp_time():+ """Get Weibo NLP time data (no parameters required)"""+ return safe_call(ak.stock_js_weibo_nlp_time)# ==================== ESG DATA ====================diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_margin.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_margin.pyindex 7cf6ad9ff..30b704a0f 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_margin.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_margin.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_realtime.py b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_realtime.pyindex b3191e3d4..8ded1a99a 100644--- a/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_realtime.py+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/akshare_stocks_realtime.py@@ -34,6 +34,9 @@ def safe_call(func, *args, **kwargs):for col in result.columns:if result[col].dtype == 'datetime64[ns]':result[col] = result[col].astype(str)+ # Replace NaN/Infinity with None for valid JSON+ result = result.replace([float("inf"), float("-inf")], None)+ result = result.where(pd.notna(result), None)data = result.to_dict(orient='records')return {"success": True, "data": data, "count": len(data)}elif isinstance(result, (list, dict)):diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/databento_live.py b/fincept-terminal-desktop/src-tauri/resources/scripts/databento_live.pynew file mode 100644index 000000000..150d82dd5--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/databento_live.py@@ -0,0 +1,384 @@+"""+Databento Live Streaming Provider+==================================+Real-time market data streaming using Databento Live API.+Streams data via stdout for Tauri to capture and forward as events.++Usage:+ python databento_live.py start <args_json>+ python databento_live.py stop++Output format (JSON lines):+ {"type": "data", "schema": "trades", "record": {...}}+ {"type": "status", "message": "Connected", "connected": true}+ {"type": "error", "message": "..."}+"""++import sys+import json+import signal+import threading+from datetime import datetime+from typing import Dict, List, Any, Optional+import os++# Check for databento package+DATABENTO_AVAILABLE = False+DATABENTO_ERROR = None+try:+ import databento as db+ DATABENTO_AVAILABLE = True+except ImportError as e:+ DATABENTO_ERROR = str(e)+++class LiveStreamManager:+ """+ Manages Databento Live streaming connections.+ Outputs data as JSON lines to stdout for Tauri event forwarding.+ """++ def __init__(self, api_key: str):+ if not DATABENTO_AVAILABLE:+ raise ImportError(f"databento package not available: {DATABENTO_ERROR}")++ self.api_key = api_key+ self.client: Optional[db.Live] = None+ self.running = False+ self._stop_event = threading.Event()++ def _emit(self, event_type: str, data: Dict[str, Any]):+ """Emit a JSON line event to stdout"""+ event = {+ "type": event_type,+ "timestamp": int(datetime.now().timestamp() * 1000),+ **data+ }+ # Print JSON line and flush immediately+ print(json.dumps(event, default=str), flush=True)++ def _handle_record(self, record):+ """Process incoming record and emit as event"""+ try:+ # Determine record type+ record_type = type(record).__name__++ # Build base record data+ data = {+ "record_type": record_type,+ "ts_event": str(getattr(record, 'ts_event', 0)),+ "symbol": str(getattr(record, 'symbol', '')),+ }++ # Handle different record types+ if record_type == "TradeMsg":+ price = getattr(record, 'price', 0)+ data.update({+ "schema": "trades",+ "price": price / 1e9 if price > 1e6 else price,+ "size": int(getattr(record, 'size', 0)),+ "side": str(getattr(record, 'side', '')),+ "action": str(getattr(record, 'action', '')),+ })++ elif record_type in ["MBP1Msg", "MBP10Msg", "TBBOMsg"]:+ levels = []+ for level in getattr(record, 'levels', []):+ bid_px = getattr(level, 'bid_px', 0)+ ask_px = getattr(level, 'ask_px', 0)+ levels.append({+ "bid_px": bid_px / 1e9 if bid_px > 1e6 else bid_px,+ "ask_px": ask_px / 1e9 if ask_px > 1e6 else ask_px,+ "bid_sz": int(getattr(level, 'bid_sz', 0)),+ "ask_sz": int(getattr(level, 'ask_sz', 0)),+ })+ data.update({+ "schema": "mbp" if "MBP" in record_type else "tbbo",+ "levels": levels,+ })++ elif record_type == "OHLCVMsg":+ data.update({+ "schema": "ohlcv",+ "open": getattr(record, 'open', 0) / 1e9,+ "high": getattr(record, 'high', 0) / 1e9,+ "low": getattr(record, 'low', 0) / 1e9,+ "close": getattr(record, 'close', 0) / 1e9,+ "volume": int(getattr(record, 'volume', 0)),+ })++ elif record_type == "ImbalanceMsg":+ data.update({+ "schema": "imbalance",+ "ref_price": getattr(record, 'ref_price', 0) / 1e9,+ "paired_qty": int(getattr(record, 'paired_qty', 0)),+ "imbalance_qty": int(getattr(record, 'imbalance_qty', 0)),+ "imbalance_side": str(getattr(record, 'imbalance_side', '')),+ })++ elif record_type == "StatMsg":+ data.update({+ "schema": "statistics",+ "stat_type": str(getattr(record, 'stat_type', '')),+ "price": getattr(record, 'price', 0) / 1e9,+ "quantity": int(getattr(record, 'quantity', 0)),+ })++ elif record_type == "StatusMsg":+ data.update({+ "schema": "status",+ "trading_status": str(getattr(record, 'trading_status', '')),+ "halt_reason": str(getattr(record, 'halt_reason', '')),+ })++ elif record_type == "ErrorMsg":+ data.update({+ "schema": "error",+ "error": str(getattr(record, 'err', '')),+ })+ self._emit("error", {"message": data["error"]})+ return++ elif record_type == "SymbolMappingMsg":+ data.update({+ "schema": "symbol_mapping",+ "stype_in_symbol": str(getattr(record, 'stype_in_symbol', '')),+ "stype_out_symbol": str(getattr(record, 'stype_out_symbol', '')),+ })++ elif record_type == "SystemMsg":+ data.update({+ "schema": "system",+ "msg": str(getattr(record, 'msg', '')),+ })++ else:+ # Generic handling for unknown types+ data["schema"] = "unknown"+ data["raw"] = str(record)++ self._emit("data", {"record": data})++ except Exception as e:+ self._emit("error", {"message": f"Error processing record: {str(e)}"})++ def _on_reconnect(self):+ """Handle reconnection events"""+ self._emit("status", {+ "message": "Reconnecting...",+ "connected": False,+ "reconnecting": True,+ })++ def start(+ self,+ dataset: str,+ schema: str,+ symbols: List[str],+ stype_in: str = "raw_symbol",+ snapshot: bool = False,+ ):+ """+ Start live streaming.++ Args:+ dataset: Dataset to stream from (e.g., 'XNAS.ITCH', 'GLBX.MDP3')+ schema: Data schema (e.g., 'trades', 'mbp-1', 'mbp-10', 'ohlcv-1s')+ symbols: List of symbols to subscribe to+ stype_in: Symbol type (raw_symbol, parent, smart)+ snapshot: Request initial snapshot of current state+ """+ if self.running:+ self._emit("error", {"message": "Stream already running"})+ return++ try:+ self._emit("status", {+ "message": "Initializing connection...",+ "connected": False,+ })++ # Create live client+ self.client = db.Live(key=self.api_key)++ # Add callbacks+ self.client.add_callback(self._handle_record)+ self.client.add_reconnect_callback(self._on_reconnect)++ # Subscribe to data+ self.client.subscribe(+ dataset=dataset,+ schema=schema,+ symbols=symbols,+ stype_in=stype_in,+ snapshot=snapshot,+ )++ self.running = True+ self._emit("status", {+ "message": f"Connected to {dataset}",+ "connected": True,+ "dataset": dataset,+ "schema": schema,+ "symbols": symbols,+ })++ # Start streaming+ self.client.start()++ # Block until stopped+ self.client.block_for_close()++ self._emit("status", {+ "message": "Stream closed",+ "connected": False,+ })++ except Exception as e:+ self._emit("error", {+ "message": f"Stream error: {str(e)}",+ })+ raise+ finally:+ self.running = False+ self.client = None++ def stop(self):+ """Stop the live stream"""+ if self.client and self.running:+ self._emit("status", {+ "message": "Stopping stream...",+ "connected": True,+ })+ try:+ self.client.stop()+ except Exception as e:+ self._emit("error", {"message": f"Error stopping: {str(e)}"})+ finally:+ self.running = False+++def main():+ """CLI entry point for live streaming"""+ if len(sys.argv) < 2:+ print(json.dumps({+ "type": "error",+ "message": "Usage: python databento_live.py <command> <args_json>",+ "commands": ["start", "info"],+ "databento_available": DATABENTO_AVAILABLE,+ }), flush=True)+ sys.exit(1)++ command = sys.argv[1]++ if command == "info":+ # Return info about live streaming capabilities+ print(json.dumps({+ "type": "info",+ "databento_available": DATABENTO_AVAILABLE,+ "databento_error": DATABENTO_ERROR,+ "schemas": [+ "trades",+ "mbp-1",+ "mbp-10",+ "tbbo",+ "ohlcv-1s",+ "ohlcv-1m",+ "imbalance",+ "statistics",+ "status",+ ],+ "datasets": [+ "XNAS.ITCH",+ "XNYS.PILLAR",+ "GLBX.MDP3",+ "OPRA.PILLAR",+ "DBEQ.BASIC",+ ],+ "stype_options": ["raw_symbol", "parent", "smart"],+ }), flush=True)+ return++ if command != "start":+ print(json.dumps({+ "type": "error",+ "message": f"Unknown command: {command}. Use 'start' or 'info'",+ }), flush=True)+ sys.exit(1)++ # Parse args+ args = {}+ if len(sys.argv) > 2:+ try:+ args = json.loads(sys.argv[2])+ except json.JSONDecodeError as e:+ print(json.dumps({+ "type": "error",+ "message": f"Invalid JSON args: {e}",+ }), flush=True)+ sys.exit(1)++ # Check databento availability+ if not DATABENTO_AVAILABLE:+ print(json.dumps({+ "type": "error",+ "message": f"databento package not installed: {DATABENTO_ERROR}",+ }), flush=True)+ sys.exit(1)++ # Get API key+ api_key = args.get('api_key', '').strip()+ if not api_key:+ api_key = os.environ.get('DATABENTO_API_KEY', '').strip()++ if not api_key:+ print(json.dumps({+ "type": "error",+ "message": "API key is required",+ }), flush=True)+ sys.exit(1)++ # Extract streaming parameters+ dataset = args.get('dataset', 'XNAS.ITCH')+ schema = args.get('schema', 'trades')+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ stype_in = args.get('stype_in', 'raw_symbol')+ snapshot = args.get('snapshot', False)++ # Create manager and handle signals+ manager = LiveStreamManager(api_key)++ def signal_handler(signum, frame):+ """Handle shutdown signals"""+ print(json.dumps({+ "type": "status",+ "message": "Received shutdown signal",+ "connected": False,+ }), flush=True)+ manager.stop()+ sys.exit(0)++ # Register signal handlers+ signal.signal(signal.SIGINT, signal_handler)+ signal.signal(signal.SIGTERM, signal_handler)++ try:+ manager.start(+ dataset=dataset,+ schema=schema,+ symbols=symbols,+ stype_in=stype_in,+ snapshot=snapshot,+ )+ except Exception as e:+ print(json.dumps({+ "type": "error",+ "message": str(e),+ }), flush=True)+ sys.exit(1)+++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/databento_provider.py b/fincept-terminal-desktop/src-tauri/resources/scripts/databento_provider.pynew file mode 100644index 000000000..a838f30d9--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/databento_provider.py@@ -0,0 +1,2375 @@+"""+Databento Market Data Provider+===============================+Institutional-grade market data fetching for Surface Analytics.+Provides options chains, historical bars, and volatility surface data.++Based on Databento Python SDK documentation:+- https://databento.com/docs+- https://pypi.org/project/databento/++NOTE: Databento is a paid service - be mindful of API usage costs.+"""++import sys+import json+from datetime import datetime, timedelta+from typing import Dict, List, Optional, Any+import math+import os++# Check for databento package+DATABENTO_AVAILABLE = False+DATABENTO_ERROR = None+try:+ import databento as db+ DATABENTO_AVAILABLE = True+except ImportError as e:+ DATABENTO_ERROR = str(e)++try:+ import pandas as pd+ PANDAS_AVAILABLE = True+except ImportError:+ PANDAS_AVAILABLE = False++try:+ import numpy as np+ NUMPY_AVAILABLE = True+except ImportError:+ NUMPY_AVAILABLE = False+++class DatabentoProvider:+ """+ Databento API wrapper for Surface Analytics.++ Provides:+ - Options chain data for volatility surfaces+ - Historical OHLCV for correlations and PCA+ - Instrument definitions with strikes/expirations+ """++ # Dataset identifiers - Use strings directly+ OPRA_DATASET = "OPRA.PILLAR" # US equity options (paid)+ XNAS_DATASET = "XNAS.ITCH" # NASDAQ equities (paid)+ GLBX_DATASET = "GLBX.MDP3" # CME futures (paid)+ DBEQ_DATASET = "DBEQ.BASIC" # Free sample equity data++ def __init__(self, api_key: str):+ """Initialize Databento client"""+ if not DATABENTO_AVAILABLE:+ raise ImportError(+ f"databento package not available: {DATABENTO_ERROR}. "+ "Run: pip install databento"+ )++ if not api_key:+ raise ValueError("API key is required")++ # Allow keys that might not start with 'db-' in case format changes+ if not api_key.strip():+ raise ValueError("API key cannot be empty")++ self.api_key = api_key.strip()+ try:+ self.client = db.Historical(key=self.api_key)+ except Exception as e:+ raise ValueError(f"Failed to initialize Databento client: {e}")++ def test_connection(self) -> Dict[str, Any]:+ """Test API connection and verify key validity"""+ try:+ # Try to get metadata - this validates the API key+ # Use a minimal request to minimize cost+ result = {+ "error": False,+ "message": "API key validated successfully",+ "key_prefix": self.api_key[:8] + "..." if len(self.api_key) > 8 else "***",+ "timestamp": int(datetime.now().timestamp())+ }+ return result+ except Exception as e:+ error_msg = str(e)+ return {+ "error": True,+ "message": f"Connection test failed: {error_msg}",+ "timestamp": int(datetime.now().timestamp())+ }++ def get_historical_ohlcv(+ self,+ symbols: List[str],+ days: int = 30,+ dataset: str = None,+ schema: str = "ohlcv-1d"+ ) -> Dict[str, Any]:+ """+ Fetch historical OHLCV bars for symbols.+ Uses DBEQ.BASIC (free sample) first, falls back to XNAS.ITCH if available.++ Args:+ symbols: List of ticker symbols (e.g., ['SPY', 'AAPL'])+ days: Number of days of history+ dataset: Override dataset (default: tries free DBEQ.BASIC first)+ schema: OHLCV schema (ohlcv-1d, ohlcv-1h, ohlcv-1m, ohlcv-1s, ohlcv-eod)++ Returns:+ Dict with OHLCV data per symbol+ """+ # Validate schema+ valid_schemas = ['ohlcv-1d', 'ohlcv-1h', 'ohlcv-1m', 'ohlcv-1s', 'ohlcv-eod']+ if schema not in valid_schemas:+ return {+ "error": True,+ "message": f"Invalid schema '{schema}'. Valid options: {', '.join(valid_schemas)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ try:+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ # For high-frequency schemas, limit the time range to avoid excessive costs+ if schema == 'ohlcv-1s' and days > 5:+ start_date = end_date - timedelta(days=5)+ days = 5+ elif schema == 'ohlcv-1m' and days > 30:+ start_date = end_date - timedelta(days=30)+ days = 30+ elif schema == 'ohlcv-1h' and days > 90:+ start_date = end_date - timedelta(days=90)+ days = 90++ # Try different datasets based on availability+ datasets_to_try = [dataset] if dataset else [self.DBEQ_DATASET, self.XNAS_DATASET]+ last_error = None++ for ds in datasets_to_try:+ if not ds:+ continue+ try:+ data = self.client.timeseries.get_range(+ dataset=ds,+ symbols=symbols,+ schema=schema,+ stype_in="raw_symbol",+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ )++ if PANDAS_AVAILABLE:+ df = data.to_df()+ if df.empty:+ continue++ # Process and group by symbol+ result = {}+ for sym in symbols:+ if 'symbol' in df.columns:+ sym_df = df[df['symbol'] == sym]+ else:+ sym_df = df++ # Convert DataFrame to records+ records = []+ for _, row in sym_df.iterrows():+ record = {+ "date": str(row.name) if hasattr(row, 'name') else str(row.get('ts_event', '')),+ "open": float(row.get('open', 0)) / 1e9 if row.get('open', 0) > 1e6 else float(row.get('open', 0)),+ "high": float(row.get('high', 0)) / 1e9 if row.get('high', 0) > 1e6 else float(row.get('high', 0)),+ "low": float(row.get('low', 0)) / 1e9 if row.get('low', 0) > 1e6 else float(row.get('low', 0)),+ "close": float(row.get('close', 0)) / 1e9 if row.get('close', 0) > 1e6 else float(row.get('close', 0)),+ "volume": int(row.get('volume', 0)),+ }+ records.append(record)++ if records:+ result[sym] = records++ if result:+ return {+ "error": False,+ "symbols": symbols,+ "days": days,+ "schema": schema,+ "dataset_used": ds,+ "records": sum(len(v) for v in result.values()),+ "data": result,+ "timestamp": int(datetime.now().timestamp())+ }+ else:+ # Fallback without pandas+ result = {sym: [] for sym in symbols}+ for row in data:+ sym = getattr(row, 'symbol', symbols[0] if symbols else 'UNKNOWN')+ # Handle fixed-point prices (divide by 1e9 if large)+ open_val = getattr(row, 'open', 0)+ high_val = getattr(row, 'high', 0)+ low_val = getattr(row, 'low', 0)+ close_val = getattr(row, 'close', 0)++ record = {+ "ts_event": str(getattr(row, 'ts_event', 0)),+ "open": open_val / 1e9 if open_val > 1e6 else open_val,+ "high": high_val / 1e9 if high_val > 1e6 else high_val,+ "low": low_val / 1e9 if low_val > 1e6 else low_val,+ "close": close_val / 1e9 if close_val > 1e6 else close_val,+ "volume": getattr(row, 'volume', 0),+ }+ if sym in result:+ result[sym].append(record)++ if any(result.values()):+ return {+ "error": False,+ "symbols": symbols,+ "days": days,+ "schema": schema,+ "dataset_used": ds,+ "data": result,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ last_error = str(e)+ continue++ return {+ "error": True,+ "message": f"Failed to fetch data from any dataset. Last error: {last_error}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch historical OHLCV: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_options_definitions(+ self,+ symbol: str,+ date: str = None,+ ) -> Dict[str, Any]:+ """+ Fetch options instrument definitions for a given underlying.+ NOTE: Requires OPRA.PILLAR access (paid dataset).++ Args:+ symbol: Underlying symbol (e.g., 'SPY', 'AAPL')+ date: Date in YYYY-MM-DD format (default: yesterday)++ Returns:+ Dict with options definitions+ """+ try:+ if not date:+ date = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")++ target_date = datetime.strptime(date, "%Y-%m-%d")++ # Fetch option definitions using parent symbology+ data = self.client.timeseries.get_range(+ dataset=self.OPRA_DATASET,+ schema="definition",+ symbols=[f"{symbol}.OPT"],+ stype_in="parent",+ start=target_date.strftime("%Y-%m-%d"),+ end=(target_date + timedelta(days=1)).strftime("%Y-%m-%d"),+ )++ # Process definitions+ options = []+ for row in data:+ # Handle fixed-point strike price+ strike_raw = getattr(row, 'strike_price', 0)+ strike = strike_raw / 1e9 if strike_raw > 1e6 else strike_raw++ options.append({+ "ts_recv": str(getattr(row, 'ts_recv', 0)),+ "raw_symbol": str(getattr(row, 'raw_symbol', '')),+ "expiration": str(getattr(row, 'expiration', 0)),+ "instrument_class": str(getattr(row, 'instrument_class', '')),+ "strike_price": strike,+ "underlying": str(getattr(row, 'underlying', '')),+ "instrument_id": int(getattr(row, 'instrument_id', 0)),+ })++ return {+ "error": False,+ "symbol": symbol,+ "date": date,+ "dataset": self.OPRA_DATASET,+ "records": len(options),+ "data": options,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ error_msg = str(e)+ # Provide helpful error messages+ if "401" in error_msg or "auth" in error_msg.lower() or "unauthorized" in error_msg.lower():+ error_msg = (+ "Authentication failed. Your API key may be invalid or expired. "+ "Please verify your key at https://databento.com/portal/api-keys. "+ f"Original error: {error_msg}"+ )+ elif "403" in error_msg or "forbidden" in error_msg.lower():+ error_msg = (+ f"Access denied. Your API key may not have access to {self.OPRA_DATASET} dataset. "+ "OPRA options data requires a paid subscription. "+ f"Original error: {error_msg}"+ )+ elif "404" in error_msg or "not found" in error_msg.lower():+ error_msg = (+ f"Symbol '{symbol}' not found in {self.OPRA_DATASET} dataset. "+ "Try a different symbol like 'SPY' or 'AAPL'. "+ f"Original error: {error_msg}"+ )++ return {+ "error": True,+ "message": f"Failed to fetch options definitions: {error_msg}",+ "symbol": symbol,+ "date": date,+ "timestamp": int(datetime.now().timestamp())+ }++ def resolve_symbols(+ self,+ symbols: List[str],+ dataset: str = None,+ stype_in: str = "raw_symbol",+ stype_out: str = "instrument_id",+ start_date: str = None,+ end_date: str = None,+ ) -> Dict[str, Any]:+ """+ Resolve/validate symbols using Databento symbology API.+ Useful for searching and validating symbols before queries.++ Args:+ symbols: List of symbols to resolve+ dataset: Dataset to resolve against (default: XNAS.ITCH)+ stype_in: Input symbol type (raw_symbol, parent, smart, figi, isin, etc.)+ stype_out: Output symbol type+ start_date: Start date for resolution+ end_date: End date for resolution++ Returns:+ Dict with resolved symbol mappings+ """+ try:+ if not start_date:+ start_date = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")+ if not end_date:+ end_date = datetime.now().strftime("%Y-%m-%d")++ ds = dataset or self.XNAS_DATASET++ result = self.client.symbology.resolve(+ dataset=ds,+ symbols=symbols,+ stype_in=stype_in,+ stype_out=stype_out,+ start_date=start_date,+ end_date=end_date,+ )++ # Process the symbology result+ mappings = []+ if hasattr(result, 'mappings'):+ for mapping in result.mappings:+ mappings.append({+ "raw_symbol": str(getattr(mapping, 'raw_symbol', '')),+ "instrument_id": str(getattr(mapping, 'instrument_id', '')),+ "start_date": str(getattr(mapping, 'start_date', '')),+ "end_date": str(getattr(mapping, 'end_date', '')),+ })++ return {+ "error": False,+ "symbols": symbols,+ "dataset": ds,+ "stype_in": stype_in,+ "stype_out": stype_out,+ "mappings": mappings,+ "count": len(mappings),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to resolve symbols: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def list_datasets(self) -> Dict[str, Any]:+ """+ List all available datasets from Databento.++ Returns:+ Dict with available datasets and their info+ """+ try:+ datasets = self.client.metadata.list_datasets()++ dataset_list = []+ for ds in datasets:+ dataset_list.append({+ "id": str(ds),+ "name": str(ds),+ })++ return {+ "error": False,+ "datasets": dataset_list,+ "count": len(dataset_list),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to list datasets: {str(e)}",+ "timestamp": int(datetime.now().timestamp())+ }++ def get_dataset_info(self, dataset: str) -> Dict[str, Any]:+ """+ Get detailed info about a dataset including date range.++ Args:+ dataset: Dataset identifier (e.g., 'XNAS.ITCH')++ Returns:+ Dict with dataset information+ """+ try:+ # Get date range+ date_range = self.client.metadata.get_dataset_range(dataset=dataset)++ # Get available schemas+ schemas = self.client.metadata.list_schemas(dataset=dataset)+ schema_list = [str(s) for s in schemas] if schemas else []++ return {+ "error": False,+ "dataset": dataset,+ "start_date": str(date_range.start) if hasattr(date_range, 'start') else None,+ "end_date": str(date_range.end) if hasattr(date_range, 'end') else None,+ "schemas": schema_list,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get dataset info: {str(e)}",+ "dataset": dataset,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_cost_estimate(+ self,+ dataset: str,+ symbols: List[str],+ schema: str,+ start_date: str,+ end_date: str,+ ) -> Dict[str, Any]:+ """+ Estimate the cost of a query before executing it.++ Args:+ dataset: Dataset identifier+ symbols: List of symbols+ schema: Data schema (e.g., 'ohlcv-1d', 'trades', 'mbp-1')+ start_date: Start date (YYYY-MM-DD)+ end_date: End date (YYYY-MM-DD)++ Returns:+ Dict with cost estimate and record count+ """+ try:+ # Get record count+ record_count = self.client.metadata.get_record_count(+ dataset=dataset,+ symbols=symbols,+ schema=schema,+ start=start_date,+ end=end_date,+ )++ # Get cost estimate+ cost = self.client.metadata.get_cost(+ dataset=dataset,+ symbols=symbols,+ schema=schema,+ start=start_date,+ end=end_date,+ )++ return {+ "error": False,+ "dataset": dataset,+ "symbols": symbols,+ "schema": schema,+ "start_date": start_date,+ "end_date": end_date,+ "record_count": int(record_count) if record_count else 0,+ "cost_usd": float(cost) if cost else 0.0,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get cost estimate: {str(e)}",+ "dataset": dataset,+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def list_schemas(self, dataset: str = None) -> Dict[str, Any]:+ """+ List available schemas for a dataset.++ Args:+ dataset: Dataset identifier (optional, defaults to XNAS.ITCH)++ Returns:+ Dict with available schemas+ """+ try:+ ds = dataset or self.XNAS_DATASET+ schemas = self.client.metadata.list_schemas(dataset=ds)++ schema_list = []+ for schema in schemas:+ schema_list.append({+ "id": str(schema),+ "name": str(schema),+ })++ return {+ "error": False,+ "dataset": ds,+ "schemas": schema_list,+ "count": len(schema_list),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to list schemas: {str(e)}",+ "dataset": dataset,+ "timestamp": int(datetime.now().timestamp())+ }++ # ========================================================================+ # Reference Data API (security_master, corporate_actions, adjustment_factors)+ # ========================================================================++ def get_security_master(+ self,+ symbols: List[str],+ dataset: str = None,+ ) -> Dict[str, Any]:+ """+ Get security master data (instrument metadata, fundamental info).+ Uses Reference API.++ Args:+ symbols: List of symbols to get metadata for+ dataset: Dataset identifier++ Returns:+ Dict with security master data+ """+ try:+ ds = dataset or self.XNAS_DATASET++ # Initialize Reference client+ ref_client = db.Reference(key=self.api_key)++ # Get security master data+ result = ref_client.security_master.get(+ dataset=ds,+ symbols=symbols,+ )++ # Process result+ securities = []+ if hasattr(result, '__iter__'):+ for sec in result:+ securities.append({+ "raw_symbol": str(getattr(sec, 'raw_symbol', '')),+ "instrument_id": str(getattr(sec, 'instrument_id', '')),+ "security_type": str(getattr(sec, 'security_type', '')),+ "exchange": str(getattr(sec, 'exchange', '')),+ "currency": str(getattr(sec, 'currency', '')),+ "name": str(getattr(sec, 'name', '')),+ "description": str(getattr(sec, 'description', '')),+ "sector": str(getattr(sec, 'sector', '')),+ "industry": str(getattr(sec, 'industry', '')),+ "market_cap": float(getattr(sec, 'market_cap', 0)) if getattr(sec, 'market_cap', None) else None,+ "shares_outstanding": int(getattr(sec, 'shares_outstanding', 0)) if getattr(sec, 'shares_outstanding', None) else None,+ })++ return {+ "error": False,+ "symbols": symbols,+ "dataset": ds,+ "securities": securities,+ "count": len(securities),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get security master: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_corporate_actions(+ self,+ symbols: List[str],+ start_date: str = None,+ end_date: str = None,+ action_type: str = None,+ ) -> Dict[str, Any]:+ """+ Get corporate actions (dividends, splits, spinoffs, etc.).+ Uses Reference API.++ Args:+ symbols: List of symbols+ start_date: Start date (YYYY-MM-DD)+ end_date: End date (YYYY-MM-DD)+ action_type: Filter by type (dividend, split, spinoff, etc.)++ Returns:+ Dict with corporate actions data+ """+ try:+ if not start_date:+ start_date = (datetime.now() - timedelta(days=365)).strftime("%Y-%m-%d")+ if not end_date:+ end_date = datetime.now().strftime("%Y-%m-%d")++ # Initialize Reference client+ ref_client = db.Reference(key=self.api_key)++ # Build request parameters+ params = {+ "symbols": symbols,+ "start_date": start_date,+ "end_date": end_date,+ }+ if action_type:+ params["action_type"] = action_type++ # Get corporate actions+ result = ref_client.corporate_actions.get(**params)++ # Process result+ actions = []+ if hasattr(result, '__iter__'):+ for action in result:+ actions.append({+ "raw_symbol": str(getattr(action, 'raw_symbol', '')),+ "action_type": str(getattr(action, 'action_type', '')),+ "ex_date": str(getattr(action, 'ex_date', '')),+ "record_date": str(getattr(action, 'record_date', '')),+ "payment_date": str(getattr(action, 'payment_date', '')),+ "amount": float(getattr(action, 'amount', 0)) if getattr(action, 'amount', None) else None,+ "ratio": str(getattr(action, 'ratio', '')) if getattr(action, 'ratio', None) else None,+ "currency": str(getattr(action, 'currency', 'USD')),+ "description": str(getattr(action, 'description', '')),+ })++ return {+ "error": False,+ "symbols": symbols,+ "start_date": start_date,+ "end_date": end_date,+ "actions": actions,+ "count": len(actions),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get corporate actions: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_adjustment_factors(+ self,+ symbols: List[str],+ start_date: str = None,+ end_date: str = None,+ ) -> Dict[str, Any]:+ """+ Get adjustment factors for splits, dividends, etc.+ Used to adjust historical prices.++ Args:+ symbols: List of symbols+ start_date: Start date (YYYY-MM-DD)+ end_date: End date (YYYY-MM-DD)++ Returns:+ Dict with adjustment factors+ """+ try:+ if not start_date:+ start_date = (datetime.now() - timedelta(days=365 * 5)).strftime("%Y-%m-%d")+ if not end_date:+ end_date = datetime.now().strftime("%Y-%m-%d")++ # Initialize Reference client+ ref_client = db.Reference(key=self.api_key)++ # Get adjustment factors+ result = ref_client.adjustment_factors.get(+ symbols=symbols,+ start_date=start_date,+ end_date=end_date,+ )++ # Process result+ factors = []+ if hasattr(result, '__iter__'):+ for factor in result:+ factors.append({+ "raw_symbol": str(getattr(factor, 'raw_symbol', '')),+ "date": str(getattr(factor, 'date', '')),+ "split_factor": float(getattr(factor, 'split_factor', 1.0)),+ "dividend_factor": float(getattr(factor, 'dividend_factor', 1.0)),+ "cumulative_factor": float(getattr(factor, 'cumulative_factor', 1.0)),+ })++ return {+ "error": False,+ "symbols": symbols,+ "start_date": start_date,+ "end_date": end_date,+ "factors": factors,+ "count": len(factors),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get adjustment factors: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ # ========================================================================+ # Order Book Data API (MBO, MBP_1, MBP_10 schemas)+ # ========================================================================++ def get_order_book(+ self,+ symbols: List[str],+ dataset: str = None,+ schema: str = "mbp-1",+ start_time: str = None,+ duration_seconds: int = 60,+ ) -> Dict[str, Any]:+ """+ Get order book data (market-by-price or market-by-order).++ Schemas:+ - mbp-1: Top of book (best bid/ask)+ - mbp-10: 10 price levels+ - mbo: Full market-by-order (every order event)++ Args:+ symbols: List of symbols+ dataset: Dataset identifier (default: XNAS.ITCH)+ schema: Order book schema (mbp-1, mbp-10, mbo)+ start_time: Start datetime (ISO format, default: market open yesterday)+ duration_seconds: Duration in seconds (default: 60)++ Returns:+ Dict with order book data+ """+ try:+ ds = dataset or self.XNAS_DATASET++ # Validate schema+ valid_schemas = ['mbp-1', 'mbp-10', 'mbo', 'tbbo']+ if schema not in valid_schemas:+ return {+ "error": True,+ "message": f"Invalid schema '{schema}'. Valid options: {', '.join(valid_schemas)}",+ "timestamp": int(datetime.now().timestamp())+ }++ # Default start time: yesterday market open+ if not start_time:+ yesterday = datetime.now() - timedelta(days=1)+ market_open = yesterday.replace(hour=9, minute=30, second=0, microsecond=0)+ start_time = market_open.strftime("%Y-%m-%dT%H:%M:%S")++ # Parse start time and calculate end time+ start_dt = datetime.fromisoformat(start_time.replace('Z', ''))+ end_dt = start_dt + timedelta(seconds=duration_seconds)++ # Fetch order book data+ data = self.client.timeseries.get_range(+ dataset=ds,+ schema=schema,+ symbols=symbols,+ stype_in="raw_symbol",+ start=start_dt.strftime("%Y-%m-%dT%H:%M:%S"),+ end=end_dt.strftime("%Y-%m-%dT%H:%M:%S"),+ )++ # Process order book data based on schema+ records = []+ for row in data:+ try:+ record = {+ "ts_event": str(getattr(row, 'ts_event', 0)),+ "symbol": str(getattr(row, 'symbol', '')),+ "action": str(getattr(row, 'action', '')),+ "side": str(getattr(row, 'side', '')),+ }++ # Handle levels for MBP schemas+ if hasattr(row, 'levels'):+ levels = []+ for level in getattr(row, 'levels', []):+ bid_px = getattr(level, 'bid_px', 0)+ ask_px = getattr(level, 'ask_px', 0)+ bid_sz = getattr(level, 'bid_sz', 0)+ ask_sz = getattr(level, 'ask_sz', 0)+ bid_ct = getattr(level, 'bid_ct', 0)+ ask_ct = getattr(level, 'ask_ct', 0)++ # Handle fixed-point prices+ levels.append({+ "bid_px": bid_px / 1e9 if bid_px > 1e6 else bid_px,+ "ask_px": ask_px / 1e9 if ask_px > 1e6 else ask_px,+ "bid_sz": int(bid_sz),+ "ask_sz": int(ask_sz),+ "bid_ct": int(bid_ct),+ "ask_ct": int(ask_ct),+ })+ record["levels"] = levels++ # Handle MBO specific fields+ if schema == 'mbo':+ record["order_id"] = str(getattr(row, 'order_id', ''))+ price = getattr(row, 'price', 0)+ record["price"] = price / 1e9 if price > 1e6 else price+ record["size"] = int(getattr(row, 'size', 0))++ records.append(record)+ except Exception:+ continue++ return {+ "error": False,+ "symbols": symbols,+ "dataset": ds,+ "schema": schema,+ "start_time": start_time,+ "duration_seconds": duration_seconds,+ "records": records,+ "count": len(records),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get order book: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_order_book_snapshot(+ self,+ symbols: List[str],+ dataset: str = None,+ levels: int = 10,+ snapshot_time: str = None,+ ) -> Dict[str, Any]:+ """+ Get order book snapshot at a specific point in time.+ Uses MBP-10 schema and aggregates to show book state.++ Args:+ symbols: List of symbols+ dataset: Dataset identifier+ levels: Number of price levels (1-10)+ snapshot_time: Datetime for snapshot (ISO format)++ Returns:+ Dict with aggregated order book snapshot+ """+ try:+ ds = dataset or self.XNAS_DATASET+ levels = min(max(levels, 1), 10)+ schema = f"mbp-{levels}" if levels > 1 else "mbp-1"++ # Default to yesterday close+ if not snapshot_time:+ yesterday = datetime.now() - timedelta(days=1)+ snapshot_time = yesterday.replace(hour=15, minute=59, second=0).strftime("%Y-%m-%dT%H:%M:%S")++ # Fetch a short window and take the last record+ result = self.get_order_book(+ symbols=symbols,+ dataset=ds,+ schema=schema,+ start_time=snapshot_time,+ duration_seconds=60,+ )++ if result.get("error"):+ return result++ # Aggregate into snapshot per symbol+ snapshots = {}+ for rec in result.get("records", []):+ sym = rec.get("symbol", "")+ if sym and rec.get("levels"):+ snapshots[sym] = {+ "symbol": sym,+ "ts_event": rec.get("ts_event"),+ "levels": rec.get("levels", [])[:levels],+ }++ return {+ "error": False,+ "symbols": symbols,+ "dataset": ds,+ "schema": schema,+ "levels": levels,+ "snapshot_time": snapshot_time,+ "snapshots": list(snapshots.values()),+ "count": len(snapshots),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get order book snapshot: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_options_quotes(+ self,+ symbol: str,+ date: str = None,+ duration_minutes: int = 5,+ ) -> Dict[str, Any]:+ """+ Fetch options quotes (bid/ask) for volatility surface.+ NOTE: Requires OPRA.PILLAR access (paid dataset).++ Args:+ symbol: Underlying symbol (e.g., 'SPY')+ date: Date in YYYY-MM-DD format+ duration_minutes: Duration to fetch (default 5 min to minimize cost)++ Returns:+ Dict with options quotes including mid prices+ """+ try:+ if not date:+ date = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")++ target_date = datetime.strptime(date, "%Y-%m-%d")++ # First get definitions+ definitions = self.get_options_definitions(symbol, date)+ if definitions.get("error"):+ return definitions++ option_symbols = [d["raw_symbol"] for d in definitions.get("data", [])][:100]++ if not option_symbols:+ return {+ "error": True,+ "message": f"No options found for {symbol}",+ "timestamp": int(datetime.now().timestamp())+ }++ # Fetch quotes using cmbp-1 schema (consolidated market-by-price)+ market_open = target_date.replace(hour=9, minute=30)+ market_end = market_open + timedelta(minutes=duration_minutes)++ data = self.client.timeseries.get_range(+ dataset=self.OPRA_DATASET,+ schema="cmbp-1",+ symbols=option_symbols,+ stype_in="raw_symbol",+ start=market_open.strftime("%Y-%m-%dT%H:%M:%S"),+ end=market_end.strftime("%Y-%m-%dT%H:%M:%S"),+ )++ # Process quotes+ quotes = {}+ for row in data:+ try:+ sym = str(getattr(row, 'symbol', ''))+ if not sym:+ continue++ levels = getattr(row, 'levels', [])+ if not levels:+ continue++ bid_px = getattr(levels[0], 'bid_px', 0)+ ask_px = getattr(levels[0], 'ask_px', 0)++ # Skip invalid prices+ if bid_px > (1 << 62) or ask_px > (1 << 62):+ continue++ # Handle fixed-point prices+ bid = bid_px / 1e9 if bid_px > 1e6 else bid_px+ ask = ask_px / 1e9 if ask_px > 1e6 else ask_px+ mid = (bid + ask) / 2++ if sym not in quotes:+ quotes[sym] = {"bid": [], "ask": [], "mid": []}++ quotes[sym]["bid"].append(bid)+ quotes[sym]["ask"].append(ask)+ quotes[sym]["mid"].append(mid)++ except Exception:+ continue++ # Compute average prices+ result = []+ definitions_map = {d["raw_symbol"]: d for d in definitions.get("data", [])}++ for sym, data in quotes.items():+ avg_mid = sum(data["mid"]) / len(data["mid"]) if data["mid"] else 0+ avg_bid = sum(data["bid"]) / len(data["bid"]) if data["bid"] else 0+ avg_ask = sum(data["ask"]) / len(data["ask"]) if data["ask"] else 0++ quote = {+ "symbol": sym,+ "mid_price": avg_mid,+ "bid": avg_bid,+ "ask": avg_ask,+ "quote_count": len(data["mid"]),+ }++ # Merge with definition data+ if sym in definitions_map:+ quote.update(definitions_map[sym])++ result.append(quote)++ return {+ "error": False,+ "symbol": symbol,+ "date": date,+ "dataset": self.OPRA_DATASET,+ "records": len(result),+ "data": result,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ error_msg = str(e)+ if "401" in error_msg or "auth" in error_msg.lower():+ error_msg = f"Authentication failed. Please verify your API key. Original: {error_msg}"+ elif "403" in error_msg:+ error_msg = f"Access denied. OPRA options data requires paid subscription. Original: {error_msg}"++ return {+ "error": True,+ "message": f"Failed to fetch options quotes: {error_msg}",+ "symbol": symbol,+ "timestamp": int(datetime.now().timestamp())+ }++ # ========================================================================+ # Futures API (GLBX.MDP3 dataset, SMART symbology)+ # ========================================================================++ # Common futures contracts reference+ FUTURES_CONTRACTS = {+ # Equity Index Futures+ "ES": {"name": "E-mini S&P 500", "exchange": "CME", "tick_size": 0.25, "multiplier": 50},+ "NQ": {"name": "E-mini NASDAQ-100", "exchange": "CME", "tick_size": 0.25, "multiplier": 20},+ "YM": {"name": "E-mini Dow", "exchange": "CBOT", "tick_size": 1.0, "multiplier": 5},+ "RTY": {"name": "E-mini Russell 2000", "exchange": "CME", "tick_size": 0.1, "multiplier": 50},+ "MES": {"name": "Micro E-mini S&P 500", "exchange": "CME", "tick_size": 0.25, "multiplier": 5},+ "MNQ": {"name": "Micro E-mini NASDAQ", "exchange": "CME", "tick_size": 0.25, "multiplier": 2},+ # Energy Futures+ "CL": {"name": "Crude Oil", "exchange": "NYMEX", "tick_size": 0.01, "multiplier": 1000},+ "NG": {"name": "Natural Gas", "exchange": "NYMEX", "tick_size": 0.001, "multiplier": 10000},+ "RB": {"name": "RBOB Gasoline", "exchange": "NYMEX", "tick_size": 0.0001, "multiplier": 42000},+ "HO": {"name": "Heating Oil", "exchange": "NYMEX", "tick_size": 0.0001, "multiplier": 42000},+ # Metals Futures+ "GC": {"name": "Gold", "exchange": "COMEX", "tick_size": 0.1, "multiplier": 100},+ "SI": {"name": "Silver", "exchange": "COMEX", "tick_size": 0.005, "multiplier": 5000},+ "HG": {"name": "Copper", "exchange": "COMEX", "tick_size": 0.0005, "multiplier": 25000},+ "PL": {"name": "Platinum", "exchange": "NYMEX", "tick_size": 0.1, "multiplier": 50},+ # Agricultural Futures+ "ZC": {"name": "Corn", "exchange": "CBOT", "tick_size": 0.25, "multiplier": 50},+ "ZS": {"name": "Soybeans", "exchange": "CBOT", "tick_size": 0.25, "multiplier": 50},+ "ZW": {"name": "Wheat", "exchange": "CBOT", "tick_size": 0.25, "multiplier": 50},+ # Treasury Futures+ "ZN": {"name": "10-Year T-Note", "exchange": "CBOT", "tick_size": 0.015625, "multiplier": 1000},+ "ZB": {"name": "30-Year T-Bond", "exchange": "CBOT", "tick_size": 0.03125, "multiplier": 1000},+ "ZF": {"name": "5-Year T-Note", "exchange": "CBOT", "tick_size": 0.0078125, "multiplier": 1000},+ # Currency Futures+ "6E": {"name": "Euro FX", "exchange": "CME", "tick_size": 0.00005, "multiplier": 125000},+ "6J": {"name": "Japanese Yen", "exchange": "CME", "tick_size": 0.0000005, "multiplier": 12500000},+ "6B": {"name": "British Pound", "exchange": "CME", "tick_size": 0.0001, "multiplier": 62500},+ }++ def list_futures_contracts(self) -> Dict[str, Any]:+ """+ List available futures contracts with their specifications.++ Returns:+ Dict with futures contract information+ """+ contracts = []+ for symbol, info in self.FUTURES_CONTRACTS.items():+ contracts.append({+ "symbol": symbol,+ "smart_symbol": f"{symbol}.c.0", # Front month continuous+ **info+ })++ return {+ "error": False,+ "contracts": contracts,+ "count": len(contracts),+ "dataset": self.GLBX_DATASET,+ "note": "Use SMART symbology (e.g., ES.c.0) for continuous contracts",+ "timestamp": int(datetime.now().timestamp())+ }++ def get_futures_data(+ self,+ symbols: List[str],+ days: int = 30,+ schema: str = "ohlcv-1d",+ stype_in: str = "smart",+ ) -> Dict[str, Any]:+ """+ Fetch historical futures data using SMART symbology.++ SMART symbology examples:+ - ES.c.0 = Front month E-mini S&P 500+ - ES.c.1 = 2nd month E-mini S&P 500+ - CL.c.0 = Front month Crude Oil++ Args:+ symbols: List of SMART symbols (e.g., ['ES.c.0', 'NQ.c.0'])+ days: Number of days of history+ schema: Data schema (ohlcv-1d, ohlcv-1h, trades, mbp-1, etc.)+ stype_in: Symbol type ('smart' for continuous, 'raw_symbol' for specific contract)++ Returns:+ Dict with futures OHLCV data+ """+ try:+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ # Limit days for high-frequency schemas+ if schema == 'ohlcv-1s' and days > 3:+ start_date = end_date - timedelta(days=3)+ elif schema == 'ohlcv-1m' and days > 14:+ start_date = end_date - timedelta(days=14)+ elif schema in ['trades', 'mbp-1', 'mbp-10'] and days > 1:+ start_date = end_date - timedelta(days=1)++ data = self.client.timeseries.get_range(+ dataset=self.GLBX_DATASET,+ symbols=symbols,+ schema=schema,+ stype_in=stype_in,+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ )++ # Process data based on schema+ if PANDAS_AVAILABLE:+ df = data.to_df()+ if df.empty:+ return {+ "error": True,+ "message": f"No data found for symbols: {symbols}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ result = {}+ for sym in symbols:+ if 'symbol' in df.columns:+ sym_df = df[df['symbol'] == sym]+ else:+ sym_df = df++ records = []+ for _, row in sym_df.iterrows():+ record = {+ "date": str(row.name) if hasattr(row, 'name') else str(row.get('ts_event', '')),+ }++ # OHLCV fields (prices in fixed-point)+ for field in ['open', 'high', 'low', 'close']:+ val = row.get(field, 0)+ record[field] = float(val) / 1e9 if val > 1e6 else float(val)++ if 'volume' in row:+ record['volume'] = int(row.get('volume', 0))++ records.append(record)++ if records:+ result[sym] = records++ return {+ "error": False,+ "symbols": symbols,+ "days": days,+ "schema": schema,+ "stype_in": stype_in,+ "dataset": self.GLBX_DATASET,+ "records": sum(len(v) for v in result.values()),+ "data": result,+ "timestamp": int(datetime.now().timestamp())+ }++ else:+ # Fallback without pandas+ result = {sym: [] for sym in symbols}+ for row in data:+ sym = getattr(row, 'symbol', symbols[0] if symbols else 'UNKNOWN')+ record = {+ "ts_event": str(getattr(row, 'ts_event', 0)),+ }+ for field in ['open', 'high', 'low', 'close']:+ val = getattr(row, field, 0)+ record[field] = val / 1e9 if val > 1e6 else val+ record["volume"] = getattr(row, 'volume', 0)++ if sym in result:+ result[sym].append(record)++ return {+ "error": False,+ "symbols": symbols,+ "schema": schema,+ "dataset": self.GLBX_DATASET,+ "data": result,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ error_msg = str(e)+ if "403" in error_msg or "forbidden" in error_msg.lower():+ error_msg = (+ f"Access denied. Your API key may not have access to {self.GLBX_DATASET} dataset. "+ "CME futures data requires a paid subscription. "+ f"Original error: {error_msg}"+ )+ return {+ "error": True,+ "message": f"Failed to fetch futures data: {error_msg}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_futures_definitions(+ self,+ symbols: List[str],+ date: str = None,+ ) -> Dict[str, Any]:+ """+ Get futures contract definitions (expiration, underlying, etc.)++ Args:+ symbols: List of SMART symbols or raw symbols+ date: Date for definitions (default: yesterday)++ Returns:+ Dict with futures instrument definitions+ """+ try:+ if not date:+ date = (datetime.now() - timedelta(days=1)).strftime("%Y-%m-%d")++ target_date = datetime.strptime(date, "%Y-%m-%d")++ data = self.client.timeseries.get_range(+ dataset=self.GLBX_DATASET,+ schema="definition",+ symbols=symbols,+ stype_in="smart",+ start=target_date.strftime("%Y-%m-%d"),+ end=(target_date + timedelta(days=1)).strftime("%Y-%m-%d"),+ )++ definitions = []+ for row in data:+ expiration_raw = getattr(row, 'expiration', 0)+ # Convert nanoseconds to date+ exp_date = None+ if expiration_raw and expiration_raw > 0:+ exp_date = datetime.fromtimestamp(expiration_raw / 1e9).strftime("%Y-%m-%d")++ definitions.append({+ "raw_symbol": str(getattr(row, 'raw_symbol', '')),+ "instrument_id": int(getattr(row, 'instrument_id', 0)),+ "exchange": str(getattr(row, 'exchange', '')),+ "underlying": str(getattr(row, 'underlying', '')),+ "expiration": exp_date,+ "contract_multiplier": float(getattr(row, 'contract_multiplier', 1)),+ "min_price_increment": float(getattr(row, 'min_price_increment', 0)) / 1e9,+ "currency": str(getattr(row, 'currency', 'USD')),+ })++ return {+ "error": False,+ "symbols": symbols,+ "date": date,+ "dataset": self.GLBX_DATASET,+ "definitions": definitions,+ "count": len(definitions),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get futures definitions: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_futures_term_structure(+ self,+ root_symbol: str,+ num_contracts: int = 6,+ ) -> Dict[str, Any]:+ """+ Get term structure (curve) for a futures contract.+ Fetches prices for multiple expiration months.++ Args:+ root_symbol: Root symbol (e.g., 'ES', 'CL')+ num_contracts: Number of contract months to fetch (default: 6)++ Returns:+ Dict with term structure data+ """+ try:+ # Build SMART symbols for multiple contract months+ symbols = [f"{root_symbol}.c.{i}" for i in range(num_contracts)]++ # Fetch recent OHLCV+ data = self.get_futures_data(symbols, days=1, schema="ohlcv-1d")++ if data.get("error"):+ return data++ # Build term structure+ term_structure = []+ for i, sym in enumerate(symbols):+ if sym in data.get("data", {}):+ records = data["data"][sym]+ if records:+ latest = records[-1]+ term_structure.append({+ "contract_month": i,+ "smart_symbol": sym,+ "close": latest.get("close", 0),+ "volume": latest.get("volume", 0),+ })++ return {+ "error": False,+ "root_symbol": root_symbol,+ "term_structure": term_structure,+ "count": len(term_structure),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to get term structure: {str(e)}",+ "root_symbol": root_symbol,+ "timestamp": int(datetime.now().timestamp())+ }++ # ========================================================================+ # Batch Download API (submit_job, list_jobs, list_files, download)+ # ========================================================================++ def submit_batch_job(+ self,+ dataset: str,+ symbols: List[str],+ schema: str,+ start_date: str,+ end_date: str,+ encoding: str = "dbn",+ compression: str = "zstd",+ stype_in: str = "raw_symbol",+ split_duration: str = "day",+ delivery: str = "download",+ ) -> Dict[str, Any]:+ """+ Submit a batch download job for large data requests.+ Jobs are processed asynchronously and can be downloaded when done.++ Args:+ dataset: Dataset identifier (e.g., 'XNAS.ITCH')+ symbols: List of symbols+ schema: Data schema (e.g., 'trades', 'ohlcv-1d')+ start_date: Start date (YYYY-MM-DD)+ end_date: End date (YYYY-MM-DD)+ encoding: Output encoding ('dbn', 'csv', 'json')+ compression: Compression type ('zstd', 'none')+ stype_in: Symbol type input+ split_duration: How to split output files ('day', 'week', 'month', 'none')+ delivery: Delivery method ('download', 's3', 'disk')++ Returns:+ Dict with job_id and job details+ """+ try:+ result = self.client.batch.submit_job(+ dataset=dataset,+ symbols=symbols,+ schema=schema,+ start=start_date,+ end=end_date,+ encoding=encoding,+ compression=compression,+ stype_in=stype_in,+ split_duration=split_duration,+ delivery=delivery,+ )++ return {+ "error": False,+ "job_id": result.get("job_id", ""),+ "state": result.get("state", ""),+ "dataset": dataset,+ "symbols": symbols,+ "schema": schema,+ "start_date": start_date,+ "end_date": end_date,+ "encoding": encoding,+ "compression": compression,+ "cost": result.get("cost", 0),+ "record_count": result.get("record_count", 0),+ "ts_received": result.get("ts_received", ""),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to submit batch job: {str(e)}",+ "dataset": dataset,+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def list_batch_jobs(+ self,+ states: str = "queued,processing,done",+ since_days: int = 7,+ ) -> Dict[str, Any]:+ """+ List batch download jobs.++ Args:+ states: Comma-separated job states to filter (queued, processing, done, expired)+ since_days: Only show jobs from the last N days++ Returns:+ Dict with list of jobs+ """+ try:+ since = (datetime.now() - timedelta(days=since_days)).strftime("%Y-%m-%d")++ jobs = self.client.batch.list_jobs(+ states=states,+ since=since,+ )++ job_list = []+ for job in jobs:+ job_list.append({+ "job_id": job.get("job_id", ""),+ "state": job.get("state", ""),+ "dataset": job.get("dataset", ""),+ "schema": job.get("schema", ""),+ "symbols": job.get("symbols", []),+ "start": job.get("start", ""),+ "end": job.get("end", ""),+ "encoding": job.get("encoding", ""),+ "compression": job.get("compression", ""),+ "cost": job.get("cost", 0),+ "record_count": job.get("record_count", 0),+ "ts_received": job.get("ts_received", ""),+ "ts_process_start": job.get("ts_process_start", ""),+ "ts_process_done": job.get("ts_process_done", ""),+ "size_bytes": job.get("size_bytes", 0),+ })++ return {+ "error": False,+ "jobs": job_list,+ "count": len(job_list),+ "states_filter": states,+ "since": since,+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to list batch jobs: {str(e)}",+ "timestamp": int(datetime.now().timestamp())+ }++ def list_batch_files(+ self,+ job_id: str,+ ) -> Dict[str, Any]:+ """+ List files available for download from a completed batch job.++ Args:+ job_id: The batch job ID++ Returns:+ Dict with list of downloadable files+ """+ try:+ files = self.client.batch.list_files(job_id=job_id)++ file_list = []+ for f in files:+ file_list.append({+ "filename": f.get("filename", ""),+ "size_bytes": f.get("size_bytes", 0),+ "hash": f.get("hash", ""),+ "urls": f.get("urls", {}),+ })++ return {+ "error": False,+ "job_id": job_id,+ "files": file_list,+ "count": len(file_list),+ "total_size_bytes": sum(f.get("size_bytes", 0) for f in files),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to list batch files: {str(e)}",+ "job_id": job_id,+ "timestamp": int(datetime.now().timestamp())+ }++ def download_batch_job(+ self,+ job_id: str,+ output_dir: str = None,+ filename: str = None,+ ) -> Dict[str, Any]:+ """+ Download files from a completed batch job.++ Args:+ job_id: The batch job ID+ output_dir: Directory to save files (default: temp dir)+ filename: Specific filename to download (optional)++ Returns:+ Dict with downloaded file paths+ """+ try:+ import tempfile++ if not output_dir:+ output_dir = tempfile.gettempdir()++ downloaded_paths = self.client.batch.download(+ job_id=job_id,+ output_dir=output_dir,+ filename_to_download=filename,+ keep_zip=False,+ )++ paths = [str(p) for p in downloaded_paths]++ return {+ "error": False,+ "job_id": job_id,+ "output_dir": output_dir,+ "downloaded_files": paths,+ "count": len(paths),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to download batch job: {str(e)}",+ "job_id": job_id,+ "timestamp": int(datetime.now().timestamp())+ }++ # ==========================================================================+ # Additional Schemas API (TRADES, IMBALANCE, STATISTICS, STATUS)+ # ==========================================================================++ def get_trades_data(+ self,+ symbols: List[str],+ dataset: str = None,+ days: int = 1,+ limit: int = 1000,+ ) -> Dict[str, Any]:+ """+ Fetch trades data for symbols.++ Args:+ symbols: List of symbols+ dataset: Dataset (default: XNAS.ITCH)+ days: Number of days of history+ limit: Maximum number of records per symbol++ Returns:+ Dict with trades data+ """+ try:+ dataset = dataset or self.XNAS_DATASET+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ data = self.client.timeseries.get_range(+ dataset=dataset,+ symbols=symbols,+ schema="trades",+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ limit=limit,+ )++ trades = []+ for record in data:+ trade = {+ "ts_event": str(record.ts_event) if hasattr(record, 'ts_event') else None,+ "symbol": str(record.symbol) if hasattr(record, 'symbol') else None,+ "price": float(record.price) / 1e9 if hasattr(record, 'price') else 0,+ "size": int(record.size) if hasattr(record, 'size') else 0,+ "action": str(record.action) if hasattr(record, 'action') else None,+ "side": str(record.side) if hasattr(record, 'side') else None,+ "sequence": int(record.sequence) if hasattr(record, 'sequence') else 0,+ }+ trades.append(trade)++ return {+ "error": False,+ "schema": "trades",+ "dataset": dataset,+ "symbols": symbols,+ "trades": trades,+ "count": len(trades),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch trades: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_imbalance_data(+ self,+ symbols: List[str],+ dataset: str = None,+ days: int = 1,+ ) -> Dict[str, Any]:+ """+ Fetch auction imbalance data (opening/closing imbalances).++ Args:+ symbols: List of symbols+ dataset: Dataset (default: XNAS.ITCH)+ days: Number of days of history++ Returns:+ Dict with imbalance data+ """+ try:+ dataset = dataset or self.XNAS_DATASET+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ data = self.client.timeseries.get_range(+ dataset=dataset,+ symbols=symbols,+ schema="imbalance",+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ )++ imbalances = []+ for record in data:+ imbalance = {+ "ts_event": str(record.ts_event) if hasattr(record, 'ts_event') else None,+ "symbol": str(record.symbol) if hasattr(record, 'symbol') else None,+ "ref_price": float(record.ref_price) / 1e9 if hasattr(record, 'ref_price') else 0,+ "paired_qty": int(record.paired_qty) if hasattr(record, 'paired_qty') else 0,+ "imbalance_qty": int(record.imbalance_qty) if hasattr(record, 'imbalance_qty') else 0,+ "imbalance_side": str(record.imbalance_side) if hasattr(record, 'imbalance_side') else None,+ "auction_type": str(record.auction_type) if hasattr(record, 'auction_type') else None,+ }+ imbalances.append(imbalance)++ return {+ "error": False,+ "schema": "imbalance",+ "dataset": dataset,+ "symbols": symbols,+ "imbalances": imbalances,+ "count": len(imbalances),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch imbalance data: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_statistics_data(+ self,+ symbols: List[str],+ dataset: str = None,+ days: int = 5,+ ) -> Dict[str, Any]:+ """+ Fetch exchange statistics (trading halts, circuit breakers, etc.).++ Args:+ symbols: List of symbols+ dataset: Dataset (default: XNAS.ITCH)+ days: Number of days of history++ Returns:+ Dict with statistics data+ """+ try:+ dataset = dataset or self.XNAS_DATASET+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ data = self.client.timeseries.get_range(+ dataset=dataset,+ symbols=symbols,+ schema="statistics",+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ )++ statistics = []+ for record in data:+ stat = {+ "ts_event": str(record.ts_event) if hasattr(record, 'ts_event') else None,+ "symbol": str(record.symbol) if hasattr(record, 'symbol') else None,+ "stat_type": str(record.stat_type) if hasattr(record, 'stat_type') else None,+ "price": float(record.price) / 1e9 if hasattr(record, 'price') else 0,+ "quantity": int(record.quantity) if hasattr(record, 'quantity') else 0,+ "sequence": int(record.sequence) if hasattr(record, 'sequence') else 0,+ "ts_ref": str(record.ts_ref) if hasattr(record, 'ts_ref') else None,+ }+ statistics.append(stat)++ return {+ "error": False,+ "schema": "statistics",+ "dataset": dataset,+ "symbols": symbols,+ "statistics": statistics,+ "count": len(statistics),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch statistics: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_status_data(+ self,+ symbols: List[str],+ dataset: str = None,+ days: int = 5,+ ) -> Dict[str, Any]:+ """+ Fetch instrument status (trading status, reg SHO, etc.).++ Args:+ symbols: List of symbols+ dataset: Dataset (default: XNAS.ITCH)+ days: Number of days of history++ Returns:+ Dict with status data+ """+ try:+ dataset = dataset or self.XNAS_DATASET+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ data = self.client.timeseries.get_range(+ dataset=dataset,+ symbols=symbols,+ schema="status",+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ )++ statuses = []+ for record in data:+ status = {+ "ts_event": str(record.ts_event) if hasattr(record, 'ts_event') else None,+ "symbol": str(record.symbol) if hasattr(record, 'symbol') else None,+ "action": str(record.action) if hasattr(record, 'action') else None,+ "reason": str(record.reason) if hasattr(record, 'reason') else None,+ "trading_event": str(record.trading_event) if hasattr(record, 'trading_event') else None,+ "is_short_sell_restricted": bool(record.is_short_sell_restricted) if hasattr(record, 'is_short_sell_restricted') else None,+ }+ statuses.append(status)++ return {+ "error": False,+ "schema": "status",+ "dataset": dataset,+ "symbols": symbols,+ "statuses": statuses,+ "count": len(statuses),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch status data: {str(e)}",+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }++ def get_schema_data(+ self,+ symbols: List[str],+ schema: str,+ dataset: str = None,+ days: int = 1,+ limit: int = 1000,+ ) -> Dict[str, Any]:+ """+ Generic method to fetch data for any schema.++ Args:+ symbols: List of symbols+ schema: Schema type (trades, imbalance, statistics, status, etc.)+ dataset: Dataset (default: XNAS.ITCH)+ days: Number of days of history+ limit: Maximum records++ Returns:+ Dict with schema data+ """+ # Route to specific methods if available+ if schema == "trades":+ return self.get_trades_data(symbols, dataset, days, limit)+ elif schema == "imbalance":+ return self.get_imbalance_data(symbols, dataset, days)+ elif schema == "statistics":+ return self.get_statistics_data(symbols, dataset, days)+ elif schema == "status":+ return self.get_status_data(symbols, dataset, days)++ # Generic handling for other schemas+ try:+ dataset = dataset or self.XNAS_DATASET+ end_date = datetime.now()+ start_date = end_date - timedelta(days=days)++ data = self.client.timeseries.get_range(+ dataset=dataset,+ symbols=symbols,+ schema=schema,+ start=start_date.strftime("%Y-%m-%d"),+ end=end_date.strftime("%Y-%m-%d"),+ limit=limit,+ )++ records = []+ for record in data:+ rec_dict = {}+ for attr in dir(record):+ if not attr.startswith('_'):+ try:+ val = getattr(record, attr)+ if not callable(val):+ if isinstance(val, (int, float)):+ rec_dict[attr] = val+ else:+ rec_dict[attr] = str(val)+ except Exception:+ pass+ records.append(rec_dict)++ return {+ "error": False,+ "schema": schema,+ "dataset": dataset,+ "symbols": symbols,+ "records": records,+ "count": len(records),+ "timestamp": int(datetime.now().timestamp())+ }++ except Exception as e:+ return {+ "error": True,+ "message": f"Failed to fetch {schema} data: {str(e)}",+ "schema": schema,+ "symbols": symbols,+ "timestamp": int(datetime.now().timestamp())+ }+++def compute_implied_volatility(+ option_price: float,+ spot: float,+ strike: float,+ time_to_expiry: float,+ risk_free_rate: float = 0.043,+ is_call: bool = True,+ max_iterations: int = 100,+ tolerance: float = 1e-6,+) -> Optional[float]:+ """+ Compute implied volatility using Newton-Raphson method.+ Based on Black-Scholes model.+ """+ if option_price <= 0 or time_to_expiry <= 0:+ return None++ def norm_cdf(x):+ return 0.5 * (1 + math.erf(x / math.sqrt(2)))++ def norm_pdf(x):+ return math.exp(-0.5 * x * x) / math.sqrt(2 * math.pi)++ def bs_price(sigma):+ d1 = (math.log(spot / strike) + (risk_free_rate + sigma**2 / 2) * time_to_expiry) / (sigma * math.sqrt(time_to_expiry))+ d2 = d1 - sigma * math.sqrt(time_to_expiry)++ if is_call:+ return spot * norm_cdf(d1) - strike * math.exp(-risk_free_rate * time_to_expiry) * norm_cdf(d2)+ else:+ return strike * math.exp(-risk_free_rate * time_to_expiry) * norm_cdf(-d2) - spot * norm_cdf(-d1)++ def bs_vega(sigma):+ d1 = (math.log(spot / strike) + (risk_free_rate + sigma**2 / 2) * time_to_expiry) / (sigma * math.sqrt(time_to_expiry))+ return spot * norm_pdf(d1) * math.sqrt(time_to_expiry)++ # Initial guess+ sigma = math.sqrt(2 * math.pi / time_to_expiry) * option_price / spot+ sigma = max(0.01, min(5.0, sigma))++ for _ in range(max_iterations):+ price = bs_price(sigma)+ diff = price - option_price++ if abs(diff) < tolerance:+ return sigma++ vega = bs_vega(sigma)+ if vega < 1e-10:+ break++ sigma = sigma - diff / vega+ if sigma <= 0.001 or sigma > 10:+ break++ return None+++def main():+ """CLI entry point for Databento data fetching"""+ available_commands = [+ "test_connection",+ "historical_ohlcv",+ "options_definitions",+ "options_chain",+ "options_quotes",+ "resolve_symbols",+ "list_datasets",+ "get_dataset_info",+ "get_cost_estimate",+ "list_schemas",+ # Reference Data+ "security_master",+ "corporate_actions",+ "adjustment_factors",+ # Order Book+ "order_book",+ "order_book_snapshot",+ # Futures+ "list_futures",+ "futures_data",+ "futures_definitions",+ "futures_term_structure",+ # Batch Download+ "submit_batch_job",+ "list_batch_jobs",+ "list_batch_files",+ "download_batch_job",+ # Additional Schemas+ "trades",+ "imbalance",+ "statistics",+ "status",+ "schema_data",+ ]++ if len(sys.argv) < 2:+ print(json.dumps({+ "error": True,+ "message": "Usage: python databento_provider.py <command> <args_json>",+ "available_commands": available_commands,+ "databento_available": DATABENTO_AVAILABLE,+ "databento_error": DATABENTO_ERROR,+ "timestamp": int(datetime.now().timestamp())+ }))+ sys.exit(1)++ command = sys.argv[1]++ # Parse args - support both JSON and simple args+ args = {}+ if len(sys.argv) > 2:+ try:+ args = json.loads(sys.argv[2])+ except json.JSONDecodeError:+ # Treat as simple key=value pairs+ for arg in sys.argv[2:]:+ if '=' in arg:+ k, v = arg.split('=', 1)+ args[k] = v++ try:+ # Check databento availability+ if not DATABENTO_AVAILABLE:+ print(json.dumps({+ "error": True,+ "message": f"databento package not installed. Error: {DATABENTO_ERROR}. Run: pip install databento",+ "timestamp": int(datetime.now().timestamp())+ }))+ sys.exit(1)++ # Get API key from args or environment+ api_key = args.get('api_key', '').strip()+ if not api_key:+ api_key = os.environ.get('DATABENTO_API_KEY', '').strip()++ if not api_key:+ print(json.dumps({+ "error": True,+ "message": "API key is required. Provide via args {'api_key': 'db-...'} or DATABENTO_API_KEY env var",+ "timestamp": int(datetime.now().timestamp())+ }))+ sys.exit(1)++ provider = DatabentoProvider(api_key)++ if command == "test_connection":+ result = provider.test_connection()++ elif command == "historical_ohlcv" or command == "historical_bars":+ symbols = args.get('symbols', ['SPY', 'QQQ'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ days = int(args.get('days', 30))+ dataset = args.get('dataset')+ schema = args.get('schema', 'ohlcv-1d')+ result = provider.get_historical_ohlcv(symbols, days, dataset, schema)++ elif command == "options_definitions" or command == "definitions":+ symbol = args.get('symbol', 'SPY')+ date = args.get('date')+ result = provider.get_options_definitions(symbol, date)++ elif command == "options_chain" or command == "options_quotes":+ symbol = args.get('symbol', 'SPY')+ date = args.get('date')+ duration = int(args.get('duration_minutes', 5))+ result = provider.get_options_quotes(symbol, date, duration)++ elif command == "resolve_symbols" or command == "symbology":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ stype_in = args.get('stype_in', 'raw_symbol')+ stype_out = args.get('stype_out', 'instrument_id')+ start_date = args.get('start_date')+ end_date = args.get('end_date')+ result = provider.resolve_symbols(symbols, dataset, stype_in, stype_out, start_date, end_date)++ elif command == "list_datasets" or command == "datasets":+ result = provider.list_datasets()++ elif command == "get_dataset_info" or command == "dataset_info":+ dataset = args.get('dataset', 'XNAS.ITCH')+ result = provider.get_dataset_info(dataset)++ elif command == "get_cost_estimate" or command == "cost":+ dataset = args.get('dataset', 'XNAS.ITCH')+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ schema = args.get('schema', 'ohlcv-1d')+ start_date = args.get('start_date', (datetime.now() - timedelta(days=30)).strftime("%Y-%m-%d"))+ end_date = args.get('end_date', datetime.now().strftime("%Y-%m-%d"))+ result = provider.get_cost_estimate(dataset, symbols, schema, start_date, end_date)++ elif command == "list_schemas" or command == "schemas":+ dataset = args.get('dataset')+ result = provider.list_schemas(dataset)++ # Reference Data commands+ elif command == "security_master":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ result = provider.get_security_master(symbols, dataset)++ elif command == "corporate_actions":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ start_date = args.get('start_date')+ end_date = args.get('end_date')+ action_type = args.get('action_type')+ result = provider.get_corporate_actions(symbols, start_date, end_date, action_type)++ elif command == "adjustment_factors":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ start_date = args.get('start_date')+ end_date = args.get('end_date')+ result = provider.get_adjustment_factors(symbols, start_date, end_date)++ # Order Book commands+ elif command == "order_book":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ schema = args.get('schema', 'mbp-1')+ start_time = args.get('start_time')+ duration = int(args.get('duration_seconds', 60))+ result = provider.get_order_book(symbols, dataset, schema, start_time, duration)++ elif command == "order_book_snapshot":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ levels = int(args.get('levels', 10))+ snapshot_time = args.get('snapshot_time')+ result = provider.get_order_book_snapshot(symbols, dataset, levels, snapshot_time)++ # Futures commands+ elif command == "list_futures" or command == "futures_contracts":+ result = provider.list_futures_contracts()++ elif command == "futures_data":+ symbols = args.get('symbols', ['ES.c.0'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ days = int(args.get('days', 30))+ schema = args.get('schema', 'ohlcv-1d')+ stype_in = args.get('stype_in', 'smart')+ result = provider.get_futures_data(symbols, days, schema, stype_in)++ elif command == "futures_definitions":+ symbols = args.get('symbols', ['ES.c.0'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ date = args.get('date')+ result = provider.get_futures_definitions(symbols, date)++ elif command == "futures_term_structure" or command == "term_structure":+ root_symbol = args.get('root_symbol', 'ES')+ num_contracts = int(args.get('num_contracts', 6))+ result = provider.get_futures_term_structure(root_symbol, num_contracts)++ # Batch Download commands+ elif command == "submit_batch_job" or command == "batch_submit":+ dataset = args.get('dataset', 'XNAS.ITCH')+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ schema = args.get('schema', 'ohlcv-1d')+ start_date = args.get('start_date', (datetime.now() - timedelta(days=30)).strftime("%Y-%m-%d"))+ end_date = args.get('end_date', datetime.now().strftime("%Y-%m-%d"))+ encoding = args.get('encoding', 'dbn')+ compression = args.get('compression', 'zstd')+ stype_in = args.get('stype_in', 'raw_symbol')+ split_duration = args.get('split_duration', 'day')+ delivery = args.get('delivery', 'download')+ result = provider.submit_batch_job(+ dataset, symbols, schema, start_date, end_date,+ encoding, compression, stype_in, split_duration, delivery+ )++ elif command == "list_batch_jobs" or command == "batch_jobs":+ states = args.get('states', 'queued,processing,done')+ since_days = int(args.get('since_days', 7))+ result = provider.list_batch_jobs(states, since_days)++ elif command == "list_batch_files" or command == "batch_files":+ job_id = args.get('job_id', '')+ if not job_id:+ result = {+ "error": True,+ "message": "job_id is required",+ "timestamp": int(datetime.now().timestamp())+ }+ else:+ result = provider.list_batch_files(job_id)++ elif command == "download_batch_job" or command == "batch_download":+ job_id = args.get('job_id', '')+ if not job_id:+ result = {+ "error": True,+ "message": "job_id is required",+ "timestamp": int(datetime.now().timestamp())+ }+ else:+ output_dir = args.get('output_dir')+ filename = args.get('filename')+ result = provider.download_batch_job(job_id, output_dir, filename)++ # Additional Schemas commands+ elif command == "trades" or command == "get_trades":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ days = int(args.get('days', 1))+ limit = int(args.get('limit', 1000))+ result = provider.get_trades_data(symbols, dataset, days, limit)++ elif command == "imbalance" or command == "get_imbalance":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ days = int(args.get('days', 1))+ result = provider.get_imbalance_data(symbols, dataset, days)++ elif command == "statistics" or command == "get_statistics":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ days = int(args.get('days', 5))+ result = provider.get_statistics_data(symbols, dataset, days)++ elif command == "status" or command == "get_status":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ dataset = args.get('dataset')+ days = int(args.get('days', 5))+ result = provider.get_status_data(symbols, dataset, days)++ elif command == "schema_data" or command == "get_schema_data":+ symbols = args.get('symbols', ['SPY'])+ if isinstance(symbols, str):+ symbols = [s.strip() for s in symbols.split(',')]+ schema = args.get('schema', 'trades')+ dataset = args.get('dataset')+ days = int(args.get('days', 1))+ limit = int(args.get('limit', 1000))+ result = provider.get_schema_data(symbols, schema, dataset, days, limit)++ else:+ result = {+ "error": True,+ "message": f"Unknown command: {command}",+ "available_commands": available_commands,+ "timestamp": int(datetime.now().timestamp())+ }++ print(json.dumps(result, default=str))++ except Exception as e:+ print(json.dumps({+ "error": True,+ "message": str(e),+ "type": type(e).__name__,+ "timestamp": int(datetime.now().timestamp())+ }))+ sys.exit(1)+++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/resources/scripts/translate_text.py b/fincept-terminal-desktop/src-tauri/resources/scripts/translate_text.pynew file mode 100644index 000000000..784bbd5cf--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/resources/scripts/translate_text.py@@ -0,0 +1,46 @@+"""+Simple translation script - returns text as-is (English is default)+For production: integrate Google Translate API or other translation service+"""+import sys+import json++def main():+ if len(sys.argv) < 3:+ print(json.dumps({"success": False, "error": "Usage: translate_text.py batch <json_array> <source_lang> <target_lang>"}))+ return++ mode = sys.argv[1]++ if mode == "batch":+ texts_json = sys.argv[2]+ source_lang = sys.argv[3] if len(sys.argv) > 3 else "auto"+ target_lang = sys.argv[4] if len(sys.argv) > 4 else "en"++ try:+ texts = json.loads(texts_json)++ # For now, return text as-is (no translation)+ # In production, integrate with translation API+ translations = []+ for text in texts:+ translations.append({+ "original": text,+ "translated": text, # No translation for now+ "detected_lang": "zh" if any('\u4e00' <= c <= '\u9fff' for c in str(text)) else "en"+ })++ result = {+ "success": True,+ "translations": translations,+ "error": None+ }++ print(json.dumps(result, ensure_ascii=True))+ except Exception as e:+ print(json.dumps({"success": False, "error": str(e)}))+ else:+ print(json.dumps({"success": False, "error": f"Unknown mode: {mode}"}))++if __name__ == "__main__":+ main()diff --git a/fincept-terminal-desktop/src-tauri/src/commands/akshare.rs b/fincept-terminal-desktop/src-tauri/src/commands/akshare.rsindex de9e3f092..aacdf765f 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/akshare.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/akshare.rs@@ -34,26 +34,17 @@ fn run_python_script_with_symbol(app: &tauri::AppHandle, script: &str, endpoint:#[command]pub async fn akshare_query(app: tauri::AppHandle, script: String, endpoint: String, args: Option<Vec<String>>) -> Result<AKShareResponse, String> {- // Validate script name to prevent path traversal+ // ALL 26 VERIFIED WORKING SCRIPTSlet valid_scripts = vec!["akshare_data.py",- "akshare_bonds.py",- "akshare_derivatives.py",- "akshare_economics_china.py",- "akshare_economics_global.py",- "akshare_funds_expanded.py",- "akshare_alternative.py",- "akshare_analysis.py",- "akshare_company_info.py",- // Market data scripts"akshare_index.py","akshare_futures.py",+ "akshare_bonds.py","akshare_currency.py","akshare_energy.py","akshare_crypto.py","akshare_news.py","akshare_reits.py",- // Stock data scripts (8 batches covering 398 endpoints)"akshare_stocks_realtime.py","akshare_stocks_historical.py","akshare_stocks_financial.py",@@ -62,7 +53,13 @@ pub async fn akshare_query(app: tauri::AppHandle, script: String, endpoint: Stri"akshare_stocks_board.py","akshare_stocks_margin.py","akshare_stocks_hot.py",- // New comprehensive wrappers (219 functions)+ "akshare_alternative.py",+ "akshare_analysis.py",+ "akshare_derivatives.py",+ "akshare_economics_china.py",+ "akshare_economics_global.py",+ "akshare_funds_expanded.py",+ "akshare_company_info.py","akshare_macro.py","akshare_misc.py",];@@ -83,25 +80,17 @@ pub async fn akshare_query(app: tauri::AppHandle, script: String, endpoint: Stri#[command]pub async fn akshare_get_endpoints(app: tauri::AppHandle, script: String) -> Result<AKShareResponse, String> {+ // ALL 26 VERIFIED WORKING SCRIPTSlet valid_scripts = vec!["akshare_data.py",- "akshare_bonds.py",- "akshare_derivatives.py",- "akshare_economics_china.py",- "akshare_economics_global.py",- "akshare_funds_expanded.py",- "akshare_alternative.py",- "akshare_analysis.py",- "akshare_company_info.py",- // Market data scripts"akshare_index.py","akshare_futures.py",+ "akshare_bonds.py","akshare_currency.py","akshare_energy.py","akshare_crypto.py","akshare_news.py","akshare_reits.py",- // Stock data scripts (8 batches covering 398 endpoints)"akshare_stocks_realtime.py","akshare_stocks_historical.py","akshare_stocks_financial.py",@@ -110,7 +99,13 @@ pub async fn akshare_get_endpoints(app: tauri::AppHandle, script: String) -> Res"akshare_stocks_board.py","akshare_stocks_margin.py","akshare_stocks_hot.py",- // New comprehensive wrappers (219 functions)+ "akshare_alternative.py",+ "akshare_analysis.py",+ "akshare_derivatives.py",+ "akshare_economics_china.py",+ "akshare_economics_global.py",+ "akshare_funds_expanded.py",+ "akshare_company_info.py","akshare_macro.py","akshare_misc.py",];diff --git a/fincept-terminal-desktop/src-tauri/src/commands/custom_index.rs b/fincept-terminal-desktop/src-tauri/src/commands/custom_index.rsnew file mode 100644index 000000000..bc3a1a996--- /dev/null+++ b/fincept-terminal-desktop/src-tauri/src/commands/custom_index.rs@@ -0,0 +1,186 @@+// Custom Index Commands - CRUD operations for aggregate index feature+use crate::database::operations;+use crate::database::types::{CustomIndex, IndexConstituent, IndexSnapshot};+use uuid::Uuid;++#[tauri::command]+pub async fn custom_index_create(+ name: String,+ description: Option<String>,+ calculation_method: String,+ base_value: f64,+ cap_weight: Option<f64>,+ currency: String,+ portfolio_id: Option<String>,+) -> Result<CustomIndex, String> {+ let id = Uuid::new_v4().to_string();+ let now = chrono::Utc::now().to_rfc3339();++ let index = CustomIndex {+ id: id.clone(),+ name,+ description,+ calculation_method,+ base_value,+ base_date: now.clone(),+ divisor: 1.0,+ current_value: base_value,+ previous_close: base_value,+ cap_weight,+ currency,+ portfolio_id,+ is_active: true,+ created_at: now.clone(),+ updated_at: now,+ };++ operations::create_custom_index(&index).map_err(|e| e.to_string())?;++ Ok(index)+}++#[tauri::command]+pub async fn custom_index_get_all() -> Result<Vec<CustomIndex>, String> {+ operations::get_all_custom_indices().map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn custom_index_get_by_id(index_id: String) -> Result<Option<CustomIndex>, String> {+ operations::get_custom_index_by_id(&index_id).map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn custom_index_update(+ index_id: String,+ current_value: f64,+ previous_close: f64,+ divisor: f64,+) -> Result<(), String> {+ operations::update_custom_index(&index_id, current_value, previous_close, divisor)+ .map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn custom_index_delete(index_id: String) -> Result<(), String> {+ operations::delete_custom_index(&index_id).map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn custom_index_hard_delete(index_id: String) -> Result<(), String> {+ operations::hard_delete_custom_index(&index_id).map_err(|e| e.to_string())+}++// ============================================================================+// Constituent Commands+// ============================================================================++#[tauri::command]+pub async fn index_constituent_add(+ index_id: String,+ symbol: String,+ shares: Option<f64>,+ weight: Option<f64>,+ market_cap: Option<f64>,+ fundamental_score: Option<f64>,+ custom_price: Option<f64>,+ price_date: Option<String>,+) -> Result<IndexConstituent, String> {+ let id = Uuid::new_v4().to_string();+ let now = chrono::Utc::now().to_rfc3339();++ let constituent = IndexConstituent {+ id: id.clone(),+ index_id: index_id.clone(),+ symbol: symbol.to_uppercase(),+ shares,+ weight,+ market_cap,+ fundamental_score,+ custom_price,+ price_date,+ added_at: now.clone(),+ updated_at: now,+ };++ operations::add_index_constituent(&constituent).map_err(|e| e.to_string())?;++ Ok(constituent)+}++#[tauri::command]+pub async fn index_constituent_get_all(index_id: String) -> Result<Vec<IndexConstituent>, String> {+ operations::get_index_constituents(&index_id).map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn index_constituent_update(+ constituent_id: String,+ shares: Option<f64>,+ weight: Option<f64>,+ market_cap: Option<f64>,+ fundamental_score: Option<f64>,+ custom_price: Option<f64>,+ price_date: Option<String>,+) -> Result<(), String> {+ operations::update_index_constituent(&constituent_id, shares, weight, market_cap, fundamental_score, custom_price, price_date)+ .map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn index_constituent_remove(index_id: String, symbol: String) -> Result<(), String> {+ operations::remove_index_constituent(&index_id, &symbol).map_err(|e| e.to_string())+}++// ============================================================================+// Snapshot Commands+// ============================================================================++#[tauri::command]+pub async fn index_snapshot_save(+ index_id: String,+ index_value: f64,+ day_change: f64,+ day_change_percent: f64,+ total_market_value: f64,+ divisor: f64,+ constituents_data: String,+ snapshot_date: String,+) -> Result<IndexSnapshot, String> {+ let id = Uuid::new_v4().to_string();+ let now = chrono::Utc::now().to_rfc3339();++ let snapshot = IndexSnapshot {+ id: id.clone(),+ index_id,+ index_value,+ day_change,+ day_change_percent,+ total_market_value,+ divisor,+ constituents_data,+ snapshot_date,+ created_at: now,+ };++ operations::save_index_snapshot(&snapshot).map_err(|e| e.to_string())?;++ Ok(snapshot)+}++#[tauri::command]+pub async fn index_snapshot_get_all(+ index_id: String,+ limit: Option<i32>,+) -> Result<Vec<IndexSnapshot>, String> {+ operations::get_index_snapshots(&index_id, limit).map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn index_snapshot_get_latest(index_id: String) -> Result<Option<IndexSnapshot>, String> {+ operations::get_latest_index_snapshot(&index_id).map_err(|e| e.to_string())+}++#[tauri::command]+pub async fn index_snapshot_cleanup(index_id: String, days: i32) -> Result<i32, String> {+ operations::delete_index_snapshots_older_than(&index_id, days).map_err(|e| e.to_string())+}diff --git a/fincept-terminal-desktop/src-tauri/src/commands/databento.rs b/fincept-terminal-desktop/src-tauri/src/commands/databento.rsindex 94f110dc2..b266422a3 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/databento.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/databento.rs@@ -1,21 +1,125 @@// Databento market data commands+// Provides institutional-grade market data for Surface Analyticsuse crate::python;-/// Execute Databento Python script command+/// Test Databento API connection+/// Frontend sends: { apiKey: "..." }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_test_connection(+ app: tauri::AppHandle,+ apiKey: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["test_connection".to_string(), args_json]).await+}++/// Fetch options chain for volatility surface (3D Visualization)+/// Frontend sends: { apiKey: "...", symbol: "SPY", date: "2024-01-15" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_options_chain(+ app: tauri::AppHandle,+ apiKey: String,+ symbol: String,+ date: Option<String>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "symbol": symbol,+ "date": date+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["options_chain".to_string(), args_json]).await+}++/// Fetch options definitions (instrument metadata)+/// Frontend sends: { apiKey: "...", symbol: "SPY", date: "2024-01-15" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_options_definitions(+ app: tauri::AppHandle,+ apiKey: String,+ symbol: String,+ date: Option<String>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "symbol": symbol,+ "date": date+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["options_definitions".to_string(), args_json]).await+}++/// Fetch multi-asset historical OHLCV data for correlation matrix (3D Visualization)+/// Frontend sends: { apiKey: "...", symbols: ["SPY", "QQQ"], days: 60, schema: "ohlcv-1d" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_multi_asset_data(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ days: Option<i32>,+ schema: Option<String>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(60),+ "schema": schema.unwrap_or_else(|| "ohlcv-1d".to_string())+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["historical_ohlcv".to_string(), args_json]).await+}++/// Fetch historical OHLCV data for specific symbols+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], days: 30, dataset: "DBEQ.BASIC", schema: "ohlcv-1d" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_historical_ohlcv(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ days: Option<i32>,+ dataset: Option<String>,+ schema: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(30),+ "schema": schema.unwrap_or_else(|| "ohlcv-1d".to_string())+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["historical_ohlcv".to_string(), args.to_string()]).await+}++// ============================================================================+// Legacy commands for backward compatibility with explore_databento_data.py+// ============================================================================++/// Execute Databento Python script command (legacy)#[tauri::command]pub async fn execute_databento_command(app: tauri::AppHandle,command: String,args: Vec<String>,) -> Result<String, String> {- // Build command argumentslet mut cmd_args = vec![command];cmd_args.extend(args);python::execute(&app, "explore_databento_data.py", cmd_args).await}-/// Get market data+/// Get market data (legacy)#[tauri::command]pub async fn get_databento_market_data(app: tauri::AppHandle,@@ -29,7 +133,7 @@ pub async fn get_databento_market_data(execute_databento_command(app, "market_data".to_string(), args).await}-/// Get available datasets+/// Get available datasets (legacy)#[tauri::command]pub async fn get_databento_datasets(app: tauri::AppHandle,@@ -37,7 +141,7 @@ pub async fn get_databento_datasets(execute_databento_command(app, "datasets".to_string(), vec![]).await}-/// Get historical data+/// Get historical data (legacy)#[tauri::command]pub async fn get_databento_historical(app: tauri::AppHandle,@@ -51,3 +155,741 @@ pub async fn get_databento_historical(}execute_databento_command(app, "historical".to_string(), args).await}++/// Resolve symbols using Databento symbology API+/// Frontend sends: { apiKey: "...", symbols: ["SPY", "AAPL"], dataset: "XNAS.ITCH" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_resolve_symbols(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ stypeIn: Option<String>,+ stypeOut: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }+ if let Some(stype) = stypeIn {+ args["stype_in"] = serde_json::Value::String(stype);+ }+ if let Some(stype) = stypeOut {+ args["stype_out"] = serde_json::Value::String(stype);+ }++ python::execute(&app, "databento_provider.py", vec!["resolve_symbols".to_string(), args.to_string()]).await+}++/// List all available datasets+/// Frontend sends: { apiKey: "..." }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_list_datasets(+ app: tauri::AppHandle,+ apiKey: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["list_datasets".to_string(), args_json]).await+}++/// Get dataset info including date range and available schemas+/// Frontend sends: { apiKey: "...", dataset: "XNAS.ITCH" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_dataset_info(+ app: tauri::AppHandle,+ apiKey: String,+ dataset: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "dataset": dataset+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["get_dataset_info".to_string(), args_json]).await+}++/// Get cost estimate before executing a query+/// Frontend sends: { apiKey: "...", dataset: "XNAS.ITCH", symbols: ["SPY"], schema: "ohlcv-1d", startDate: "2024-01-01", endDate: "2024-01-31" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_cost_estimate(+ app: tauri::AppHandle,+ apiKey: String,+ dataset: String,+ symbols: Vec<String>,+ schema: String,+ startDate: String,+ endDate: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "dataset": dataset,+ "symbols": symbols,+ "schema": schema,+ "start_date": startDate,+ "end_date": endDate+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["get_cost_estimate".to_string(), args_json]).await+}++/// List available schemas for a dataset+/// Frontend sends: { apiKey: "...", dataset: "XNAS.ITCH" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_list_schemas(+ app: tauri::AppHandle,+ apiKey: String,+ dataset: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["list_schemas".to_string(), args.to_string()]).await+}++// ============================================================================+// Reference Data API Commands+// ============================================================================++/// Get security master data (instrument metadata)+/// Frontend sends: { apiKey: "...", symbols: ["SPY", "AAPL"], dataset: "XNAS.ITCH" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_security_master(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["security_master".to_string(), args.to_string()]).await+}++/// Get corporate actions (dividends, splits, etc.)+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], startDate: "2024-01-01", endDate: "2024-12-31", actionType: "dividend" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_corporate_actions(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ startDate: Option<String>,+ endDate: Option<String>,+ actionType: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols+ });++ if let Some(start) = startDate {+ args["start_date"] = serde_json::Value::String(start);+ }+ if let Some(end) = endDate {+ args["end_date"] = serde_json::Value::String(end);+ }+ if let Some(action) = actionType {+ args["action_type"] = serde_json::Value::String(action);+ }++ python::execute(&app, "databento_provider.py", vec!["corporate_actions".to_string(), args.to_string()]).await+}++/// Get adjustment factors for historical price adjustments+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], startDate: "2020-01-01", endDate: "2024-12-31" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_adjustment_factors(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ startDate: Option<String>,+ endDate: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols+ });++ if let Some(start) = startDate {+ args["start_date"] = serde_json::Value::String(start);+ }+ if let Some(end) = endDate {+ args["end_date"] = serde_json::Value::String(end);+ }++ python::execute(&app, "databento_provider.py", vec!["adjustment_factors".to_string(), args.to_string()]).await+}++// ============================================================================+// Order Book API Commands+// ============================================================================++/// Get order book data (MBP or MBO schemas)+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", schema: "mbp-10", startTime: "2024-01-15T09:30:00", durationSeconds: 60 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_order_book(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ schema: Option<String>,+ startTime: Option<String>,+ durationSeconds: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "schema": schema.unwrap_or_else(|| "mbp-1".to_string()),+ "duration_seconds": durationSeconds.unwrap_or(60)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }+ if let Some(start) = startTime {+ args["start_time"] = serde_json::Value::String(start);+ }++ python::execute(&app, "databento_provider.py", vec!["order_book".to_string(), args.to_string()]).await+}++/// Get order book snapshot at a specific time+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", levels: 10, snapshotTime: "2024-01-15T15:59:00" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_order_book_snapshot(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ levels: Option<i32>,+ snapshotTime: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "levels": levels.unwrap_or(10)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }+ if let Some(time) = snapshotTime {+ args["snapshot_time"] = serde_json::Value::String(time);+ }++ python::execute(&app, "databento_provider.py", vec!["order_book_snapshot".to_string(), args.to_string()]).await+}++// ============================================================================+// Live Streaming API Commands+// ============================================================================++use std::sync::Mutex;+use std::collections::HashMap;+use std::process::{Child, Command, Stdio};+use std::io::{BufRead, BufReader};+use tauri::{Emitter, Manager};+use once_cell::sync::Lazy;++// Global storage for live stream processes+static LIVE_STREAMS: Lazy<Mutex<HashMap<String, Child>>> = Lazy::new(|| Mutex::new(HashMap::new()));++/// Get live streaming info (available schemas, datasets, etc.)+/// Frontend sends: { apiKey: "..." }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_live_info(+ app: tauri::AppHandle,+) -> Result<String, String> {+ python::execute(&app, "databento_live.py", vec!["info".to_string()]).await+}++/// Start live data streaming+/// Frontend sends: { apiKey: "...", dataset: "XNAS.ITCH", schema: "trades", symbols: ["SPY"], stypeIn: "raw_symbol", snapshot: false }+/// Returns stream_id that can be used to stop the stream+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_live_start(+ app: tauri::AppHandle,+ apiKey: String,+ dataset: String,+ schema: String,+ symbols: Vec<String>,+ stypeIn: Option<String>,+ snapshot: Option<bool>,+) -> Result<String, String> {+ use std::thread;++ // Generate unique stream ID+ let stream_id = format!("stream_{}_{}", dataset.replace('.', "_"), chrono::Utc::now().timestamp_millis());++ let args = serde_json::json!({+ "api_key": apiKey,+ "dataset": dataset,+ "schema": schema,+ "symbols": symbols,+ "stype_in": stypeIn.unwrap_or_else(|| "raw_symbol".to_string()),+ "snapshot": snapshot.unwrap_or(false)+ });++ // Get Python path from resources+ let python_path = app.path().resolve("resources/python/python.exe", tauri::path::BaseDirectory::Resource)+ .map_err(|e| format!("Failed to resolve Python path: {}", e))?;++ let script_path = app.path().resolve("resources/scripts/databento_live.py", tauri::path::BaseDirectory::Resource)+ .map_err(|e| format!("Failed to resolve script path: {}", e))?;++ // Spawn the live streaming process+ let mut child = Command::new(&python_path)+ .arg(&script_path)+ .arg("start")+ .arg(args.to_string())+ .stdout(Stdio::piped())+ .stderr(Stdio::piped())+ .spawn()+ .map_err(|e| format!("Failed to start live stream: {}", e))?;++ let stdout = child.stdout.take()+ .ok_or_else(|| "Failed to capture stdout".to_string())?;++ // Clone values for the thread+ let app_clone = app.clone();+ let stream_id_clone = stream_id.clone();++ // Spawn thread to read stdout and emit events+ thread::spawn(move || {+ let reader = BufReader::new(stdout);+ for line in reader.lines() {+ match line {+ Ok(data) => {+ // Parse JSON and emit as Tauri event+ if let Ok(json) = serde_json::from_str::<serde_json::Value>(&data) {+ let event_name = format!("databento-live-{}", stream_id_clone);+ let _ = app_clone.emit(&event_name, json);+ }+ }+ Err(_) => break,+ }+ }+ // Stream ended+ let _ = app_clone.emit(&format!("databento-live-{}", stream_id_clone), serde_json::json!({+ "type": "status",+ "message": "Stream ended",+ "connected": false+ }));+ });++ // Store the child process+ if let Ok(mut streams) = LIVE_STREAMS.lock() {+ streams.insert(stream_id.clone(), child);+ }++ Ok(serde_json::json!({+ "error": false,+ "stream_id": stream_id,+ "dataset": dataset,+ "schema": schema,+ "symbols": symbols,+ "message": "Stream started"+ }).to_string())+}++/// Stop a live data stream+/// Frontend sends: { streamId: "stream_XNAS_ITCH_123456" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_live_stop(+ streamId: String,+) -> Result<String, String> {+ if let Ok(mut streams) = LIVE_STREAMS.lock() {+ if let Some(mut child) = streams.remove(&streamId) {+ // Try to kill the process gracefully+ let _ = child.kill();+ let _ = child.wait();+ return Ok(serde_json::json!({+ "error": false,+ "stream_id": streamId,+ "message": "Stream stopped"+ }).to_string());+ }+ }++ Err(format!("Stream not found: {}", streamId))+}++/// List all active live streams+#[tauri::command]+pub async fn databento_live_list() -> Result<String, String> {+ let active_streams: Vec<String> = if let Ok(streams) = LIVE_STREAMS.lock() {+ streams.keys().cloned().collect()+ } else {+ vec![]+ };++ Ok(serde_json::json!({+ "error": false,+ "streams": active_streams,+ "count": active_streams.len()+ }).to_string())+}++/// Stop all active live streams+#[tauri::command]+pub async fn databento_live_stop_all() -> Result<String, String> {+ let mut stopped = 0;++ if let Ok(mut streams) = LIVE_STREAMS.lock() {+ for (_, mut child) in streams.drain() {+ let _ = child.kill();+ let _ = child.wait();+ stopped += 1;+ }+ }++ Ok(serde_json::json!({+ "error": false,+ "message": format!("Stopped {} streams", stopped),+ "stopped": stopped+ }).to_string())+}++// ============================================================================+// Futures API Commands (GLBX.MDP3 dataset, SMART symbology)+// ============================================================================++/// List available futures contracts with specifications+/// Frontend sends: { apiKey: "..." }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_list_futures(+ app: tauri::AppHandle,+ apiKey: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["list_futures".to_string(), args_json]).await+}++/// Fetch futures data using SMART symbology+/// Frontend sends: { apiKey: "...", symbols: ["ES.c.0", "NQ.c.0"], days: 30, schema: "ohlcv-1d", stypeIn: "smart" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_futures_data(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ days: Option<i32>,+ schema: Option<String>,+ stypeIn: Option<String>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(30),+ "schema": schema.unwrap_or_else(|| "ohlcv-1d".to_string()),+ "stype_in": stypeIn.unwrap_or_else(|| "smart".to_string())+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["futures_data".to_string(), args_json]).await+}++/// Get futures contract definitions+/// Frontend sends: { apiKey: "...", symbols: ["ES.c.0"], date: "2024-01-15" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_futures_definitions(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ date: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols+ });++ if let Some(d) = date {+ args["date"] = serde_json::Value::String(d);+ }++ python::execute(&app, "databento_provider.py", vec!["futures_definitions".to_string(), args.to_string()]).await+}++/// Get futures term structure (curve)+/// Frontend sends: { apiKey: "...", rootSymbol: "ES", numContracts: 6 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_futures_term_structure(+ app: tauri::AppHandle,+ apiKey: String,+ rootSymbol: String,+ numContracts: Option<i32>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "root_symbol": rootSymbol,+ "num_contracts": numContracts.unwrap_or(6)+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["futures_term_structure".to_string(), args_json]).await+}++// ============================================================================+// Batch Download API Commands+// ============================================================================++/// Submit a batch download job for large data requests+/// Frontend sends: { apiKey: "...", dataset: "XNAS.ITCH", symbols: ["SPY"], schema: "trades", startDate: "2024-01-01", endDate: "2024-01-31", encoding: "dbn", compression: "zstd", stypeIn: "raw_symbol", splitDuration: "day", delivery: "download" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_submit_batch_job(+ app: tauri::AppHandle,+ apiKey: String,+ dataset: String,+ symbols: Vec<String>,+ schema: String,+ startDate: String,+ endDate: String,+ encoding: Option<String>,+ compression: Option<String>,+ stypeIn: Option<String>,+ splitDuration: Option<String>,+ delivery: Option<String>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "dataset": dataset,+ "symbols": symbols,+ "schema": schema,+ "start_date": startDate,+ "end_date": endDate,+ "encoding": encoding.unwrap_or_else(|| "dbn".to_string()),+ "compression": compression.unwrap_or_else(|| "zstd".to_string()),+ "stype_in": stypeIn.unwrap_or_else(|| "raw_symbol".to_string()),+ "split_duration": splitDuration.unwrap_or_else(|| "day".to_string()),+ "delivery": delivery.unwrap_or_else(|| "download".to_string())+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["submit_batch_job".to_string(), args_json]).await+}++/// List batch download jobs+/// Frontend sends: { apiKey: "...", states: "queued,processing,done", sinceDays: 7 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_list_batch_jobs(+ app: tauri::AppHandle,+ apiKey: String,+ states: Option<String>,+ sinceDays: Option<i32>,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "states": states.unwrap_or_else(|| "queued,processing,done".to_string()),+ "since_days": sinceDays.unwrap_or(7)+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["list_batch_jobs".to_string(), args_json]).await+}++/// List files from a batch job+/// Frontend sends: { apiKey: "...", jobId: "job_123" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_list_batch_files(+ app: tauri::AppHandle,+ apiKey: String,+ jobId: String,+) -> Result<String, String> {+ let args_json = serde_json::json!({+ "api_key": apiKey,+ "job_id": jobId+ }).to_string();++ python::execute(&app, "databento_provider.py", vec!["list_batch_files".to_string(), args_json]).await+}++/// Download files from a completed batch job+/// Frontend sends: { apiKey: "...", jobId: "job_123", outputDir: "/path/to/dir", filename: "specific_file.dbn" }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_download_batch_job(+ app: tauri::AppHandle,+ apiKey: String,+ jobId: String,+ outputDir: Option<String>,+ filename: Option<String>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "job_id": jobId+ });++ if let Some(dir) = outputDir {+ args["output_dir"] = serde_json::Value::String(dir);+ }+ if let Some(file) = filename {+ args["filename"] = serde_json::Value::String(file);+ }++ python::execute(&app, "databento_provider.py", vec!["download_batch_job".to_string(), args.to_string()]).await+}++// ============================================================================+// Additional Schemas API Commands (TRADES, IMBALANCE, STATISTICS, STATUS)+// ============================================================================++/// Get trades data for symbols+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", days: 1, limit: 1000 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_trades(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ days: Option<i32>,+ limit: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(1),+ "limit": limit.unwrap_or(1000)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["trades".to_string(), args.to_string()]).await+}++/// Get auction imbalance data (opening/closing imbalances)+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", days: 1 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_imbalance(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ days: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(1)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["imbalance".to_string(), args.to_string()]).await+}++/// Get exchange statistics (trading halts, circuit breakers)+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", days: 5 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_statistics(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ days: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(5)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["statistics".to_string(), args.to_string()]).await+}++/// Get instrument status (trading status, reg SHO)+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], dataset: "XNAS.ITCH", days: 5 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_status(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ dataset: Option<String>,+ days: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "days": days.unwrap_or(5)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["status".to_string(), args.to_string()]).await+}++/// Generic schema data fetcher+/// Frontend sends: { apiKey: "...", symbols: ["SPY"], schema: "trades", dataset: "XNAS.ITCH", days: 1, limit: 1000 }+#[tauri::command]+#[allow(non_snake_case)]+pub async fn databento_get_schema_data(+ app: tauri::AppHandle,+ apiKey: String,+ symbols: Vec<String>,+ schema: String,+ dataset: Option<String>,+ days: Option<i32>,+ limit: Option<i32>,+) -> Result<String, String> {+ let mut args = serde_json::json!({+ "api_key": apiKey,+ "symbols": symbols,+ "schema": schema,+ "days": days.unwrap_or(1),+ "limit": limit.unwrap_or(1000)+ });++ if let Some(ds) = dataset {+ args["dataset"] = serde_json::Value::String(ds);+ }++ python::execute(&app, "databento_provider.py", vec!["schema_data".to_string(), args.to_string()]).await+}diff --git a/fincept-terminal-desktop/src-tauri/src/commands/mod.rs b/fincept-terminal-desktop/src-tauri/src/commands/mod.rsindex 3596f597a..88802f3f5 100644--- a/fincept-terminal-desktop/src-tauri/src/commands/mod.rs+++ b/fincept-terminal-desktop/src-tauri/src/commands/mod.rs@@ -155,3 +155,6 @@ pub mod akshare;// LLM Models - LiteLLM provider and model listingpub mod llm_models;++// Custom Index - Aggregate Index Feature+pub mod custom_index;diff --git a/fincept-terminal-desktop/src-tauri/src/database/operations.rs b/fincept-terminal-desktop/src-tauri/src/database/operations.rsindex 88d13ff82..2f3afd647 100644--- a/fincept-terminal-desktop/src-tauri/src/database/operations.rs+++ b/fincept-terminal-desktop/src-tauri/src/database/operations.rs@@ -890,3 +890,327 @@ pub fn get_portfolio_transactions(portfolio_id: &str, limit: Option<i32>) -> ResOk(transactions)}++// ============================================================================+// Custom Index Operations (Aggregate Index Feature)+// ============================================================================++use crate::database::types::{CustomIndex, IndexConstituent, IndexSnapshot};++pub fn create_custom_index(index: &CustomIndex) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "INSERT INTO custom_indices (id, name, description, calculation_method, base_value, base_date, divisor, current_value, previous_close, cap_weight, currency, portfolio_id, is_active, created_at, updated_at)+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)",+ params![+ index.id,+ index.name,+ index.description,+ index.calculation_method,+ index.base_value,+ index.base_date,+ index.divisor,+ index.current_value,+ index.previous_close,+ index.cap_weight,+ index.currency,+ index.portfolio_id,+ if index.is_active { 1 } else { 0 }+ ],+ )?;++ Ok(())+}++pub fn get_all_custom_indices() -> Result<Vec<CustomIndex>> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let mut stmt = conn.prepare(+ "SELECT id, name, description, calculation_method, base_value, base_date, divisor, current_value, previous_close, cap_weight, currency, portfolio_id, is_active, created_at, updated_at+ FROM custom_indices WHERE is_active = 1 ORDER BY created_at DESC"+ )?;++ let indices = stmt+ .query_map([], |row| {+ Ok(CustomIndex {+ id: row.get(0)?,+ name: row.get(1)?,+ description: row.get(2)?,+ calculation_method: row.get(3)?,+ base_value: row.get(4)?,+ base_date: row.get(5)?,+ divisor: row.get(6)?,+ current_value: row.get(7)?,+ previous_close: row.get(8)?,+ cap_weight: row.get(9)?,+ currency: row.get(10)?,+ portfolio_id: row.get(11)?,+ is_active: row.get::<_, i32>(12)? != 0,+ created_at: row.get(13)?,+ updated_at: row.get(14)?,+ })+ })?+ .collect::<std::result::Result<Vec<_>, _>>()?;++ Ok(indices)+}++pub fn get_custom_index_by_id(index_id: &str) -> Result<Option<CustomIndex>> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let result = conn+ .query_row(+ "SELECT id, name, description, calculation_method, base_value, base_date, divisor, current_value, previous_close, cap_weight, currency, portfolio_id, is_active, created_at, updated_at+ FROM custom_indices WHERE id = ?1",+ params![index_id],+ |row| {+ Ok(CustomIndex {+ id: row.get(0)?,+ name: row.get(1)?,+ description: row.get(2)?,+ calculation_method: row.get(3)?,+ base_value: row.get(4)?,+ base_date: row.get(5)?,+ divisor: row.get(6)?,+ current_value: row.get(7)?,+ previous_close: row.get(8)?,+ cap_weight: row.get(9)?,+ currency: row.get(10)?,+ portfolio_id: row.get(11)?,+ is_active: row.get::<_, i32>(12)? != 0,+ created_at: row.get(13)?,+ updated_at: row.get(14)?,+ })+ },+ )+ .optional()?;++ Ok(result)+}++pub fn update_custom_index(index_id: &str, current_value: f64, previous_close: f64, divisor: f64) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "UPDATE custom_indices SET current_value = ?1, previous_close = ?2, divisor = ?3, updated_at = CURRENT_TIMESTAMP WHERE id = ?4",+ params![current_value, previous_close, divisor, index_id],+ )?;++ Ok(())+}++pub fn delete_custom_index(index_id: &str) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ // Soft delete by setting is_active to 0+ conn.execute(+ "UPDATE custom_indices SET is_active = 0, updated_at = CURRENT_TIMESTAMP WHERE id = ?1",+ params![index_id],+ )?;++ Ok(())+}++pub fn hard_delete_custom_index(index_id: &str) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute("DELETE FROM custom_indices WHERE id = ?1", params![index_id])?;++ Ok(())+}++// ============================================================================+// Index Constituent Operations+// ============================================================================++pub fn add_index_constituent(constituent: &IndexConstituent) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "INSERT OR REPLACE INTO index_constituents (id, index_id, symbol, shares, weight, market_cap, fundamental_score, custom_price, price_date, added_at, updated_at)+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)",+ params![+ constituent.id,+ constituent.index_id,+ constituent.symbol,+ constituent.shares,+ constituent.weight,+ constituent.market_cap,+ constituent.fundamental_score,+ constituent.custom_price,+ constituent.price_date+ ],+ )?;++ Ok(())+}++pub fn get_index_constituents(index_id: &str) -> Result<Vec<IndexConstituent>> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let mut stmt = conn.prepare(+ "SELECT id, index_id, symbol, shares, weight, market_cap, fundamental_score, custom_price, price_date, added_at, updated_at+ FROM index_constituents WHERE index_id = ?1 ORDER BY symbol"+ )?;++ let constituents = stmt+ .query_map(params![index_id], |row| {+ Ok(IndexConstituent {+ id: row.get(0)?,+ index_id: row.get(1)?,+ symbol: row.get(2)?,+ shares: row.get(3)?,+ weight: row.get(4)?,+ market_cap: row.get(5)?,+ fundamental_score: row.get(6)?,+ custom_price: row.get(7)?,+ price_date: row.get(8)?,+ added_at: row.get(9)?,+ updated_at: row.get(10)?,+ })+ })?+ .collect::<std::result::Result<Vec<_>, _>>()?;++ Ok(constituents)+}++pub fn update_index_constituent(constituent_id: &str, shares: Option<f64>, weight: Option<f64>, market_cap: Option<f64>, fundamental_score: Option<f64>, custom_price: Option<f64>, price_date: Option<String>) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "UPDATE index_constituents SET shares = COALESCE(?1, shares), weight = COALESCE(?2, weight), market_cap = COALESCE(?3, market_cap), fundamental_score = COALESCE(?4, fundamental_score), custom_price = ?5, price_date = ?6, updated_at = CURRENT_TIMESTAMP WHERE id = ?7",+ params![shares, weight, market_cap, fundamental_score, custom_price, price_date, constituent_id],+ )?;++ Ok(())+}++pub fn remove_index_constituent(index_id: &str, symbol: &str) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "DELETE FROM index_constituents WHERE index_id = ?1 AND symbol = ?2",+ params![index_id, symbol],+ )?;++ Ok(())+}++// ============================================================================+// Index Snapshot Operations+// ============================================================================++pub fn save_index_snapshot(snapshot: &IndexSnapshot) -> Result<()> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ conn.execute(+ "INSERT OR REPLACE INTO index_snapshots (id, index_id, index_value, day_change, day_change_percent, total_market_value, divisor, constituents_data, snapshot_date, created_at)+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, CURRENT_TIMESTAMP)",+ params![+ snapshot.id,+ snapshot.index_id,+ snapshot.index_value,+ snapshot.day_change,+ snapshot.day_change_percent,+ snapshot.total_market_value,+ snapshot.divisor,+ snapshot.constituents_data,+ snapshot.snapshot_date+ ],+ )?;++ Ok(())+}++pub fn get_index_snapshots(index_id: &str, limit: Option<i32>) -> Result<Vec<IndexSnapshot>> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let query = if let Some(lim) = limit {+ format!(+ "SELECT id, index_id, index_value, day_change, day_change_percent, total_market_value, divisor, constituents_data, snapshot_date, created_at+ FROM index_snapshots WHERE index_id = ?1 ORDER BY snapshot_date DESC LIMIT {}",+ lim+ )+ } else {+ "SELECT id, index_id, index_value, day_change, day_change_percent, total_market_value, divisor, constituents_data, snapshot_date, created_at+ FROM index_snapshots WHERE index_id = ?1 ORDER BY snapshot_date DESC".to_string()+ };++ let mut stmt = conn.prepare(&query)?;++ let snapshots = stmt+ .query_map(params![index_id], |row| {+ Ok(IndexSnapshot {+ id: row.get(0)?,+ index_id: row.get(1)?,+ index_value: row.get(2)?,+ day_change: row.get(3)?,+ day_change_percent: row.get(4)?,+ total_market_value: row.get(5)?,+ divisor: row.get(6)?,+ constituents_data: row.get(7)?,+ snapshot_date: row.get(8)?,+ created_at: row.get(9)?,+ })+ })?+ .collect::<std::result::Result<Vec<_>, _>>()?;++ Ok(snapshots)+}++pub fn get_latest_index_snapshot(index_id: &str) -> Result<Option<IndexSnapshot>> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let result = conn+ .query_row(+ "SELECT id, index_id, index_value, day_change, day_change_percent, total_market_value, divisor, constituents_data, snapshot_date, created_at+ FROM index_snapshots WHERE index_id = ?1 ORDER BY snapshot_date DESC LIMIT 1",+ params![index_id],+ |row| {+ Ok(IndexSnapshot {+ id: row.get(0)?,+ index_id: row.get(1)?,+ index_value: row.get(2)?,+ day_change: row.get(3)?,+ day_change_percent: row.get(4)?,+ total_market_value: row.get(5)?,+ divisor: row.get(6)?,+ constituents_data: row.get(7)?,+ snapshot_date: row.get(8)?,+ created_at: row.get(9)?,+ })+ },+ )+ .optional()?;++ Ok(result)+}++pub fn delete_index_snapshots_older_than(index_id: &str, days: i32) -> Result<i32> {+ let pool = get_pool()?;+ let conn = pool.get()?;++ let deleted = conn.execute(+ &format!(+ "DELETE FROM index_snapshots WHERE index_id = ?1 AND snapshot_date < date('now', '-{} days')",+ days+ ),+ params![index_id],+ )?;++ Ok(deleted as i32)+}diff --git a/fincept-terminal-desktop/src-tauri/src/database/schema.rs b/fincept-terminal-desktop/src-tauri/src/database/schema.rsindex 06208a848..652854b7f 100644--- a/fincept-terminal-desktop/src-tauri/src/database/schema.rs+++ b/fincept-terminal-desktop/src-tauri/src/database/schema.rs@@ -794,7 +794,78 @@ pub fn create_schema(conn: &Connection) -> Result<()> {);CREATE INDEX IF NOT EXISTS idx_alpha_leaderboard_competition ON alpha_arena_leaderboard(competition_id);- CREATE INDEX IF NOT EXISTS idx_alpha_leaderboard_cycle ON alpha_arena_leaderboard(cycle_number DESC)+ CREATE INDEX IF NOT EXISTS idx_alpha_leaderboard_cycle ON alpha_arena_leaderboard(cycle_number DESC);++ -- =============================================================================+ -- Custom Index Tables (Aggregate Index Feature)+ -- =============================================================================++ -- Custom indices table (user-created indices)+ CREATE TABLE IF NOT EXISTS custom_indices (+ id TEXT PRIMARY KEY,+ name TEXT NOT NULL,+ description TEXT,+ calculation_method TEXT NOT NULL CHECK (calculation_method IN (+ 'price_weighted', 'market_cap_weighted', 'equal_weighted',+ 'float_adjusted', 'fundamental_weighted', 'modified_market_cap',+ 'factor_weighted', 'risk_parity', 'geometric_mean', 'capped_weighted'+ )),+ base_value REAL NOT NULL DEFAULT 100,+ base_date TEXT NOT NULL,+ divisor REAL NOT NULL DEFAULT 1,+ current_value REAL NOT NULL DEFAULT 100,+ previous_close REAL NOT NULL DEFAULT 100,+ cap_weight REAL,+ currency TEXT DEFAULT 'USD',+ portfolio_id TEXT,+ is_active INTEGER DEFAULT 1,+ created_at TEXT DEFAULT CURRENT_TIMESTAMP,+ updated_at TEXT DEFAULT CURRENT_TIMESTAMP,+ FOREIGN KEY (portfolio_id) REFERENCES portfolios(id) ON DELETE SET NULL+ );++ CREATE INDEX IF NOT EXISTS idx_custom_indices_active ON custom_indices(is_active);+ CREATE INDEX IF NOT EXISTS idx_custom_indices_portfolio ON custom_indices(portfolio_id);+ CREATE INDEX IF NOT EXISTS idx_custom_indices_method ON custom_indices(calculation_method);++ -- Index constituents table (stocks/assets in each index)+ CREATE TABLE IF NOT EXISTS index_constituents (+ id TEXT PRIMARY KEY,+ index_id TEXT NOT NULL,+ symbol TEXT NOT NULL,+ shares REAL,+ weight REAL,+ market_cap REAL,+ fundamental_score REAL,+ custom_price REAL,+ price_date TEXT,+ added_at TEXT DEFAULT CURRENT_TIMESTAMP,+ updated_at TEXT DEFAULT CURRENT_TIMESTAMP,+ FOREIGN KEY (index_id) REFERENCES custom_indices(id) ON DELETE CASCADE,+ UNIQUE(index_id, symbol)+ );++ CREATE INDEX IF NOT EXISTS idx_index_constituents_index ON index_constituents(index_id);+ CREATE INDEX IF NOT EXISTS idx_index_constituents_symbol ON index_constituents(symbol);++ -- Index snapshots table (historical values for tracking)+ CREATE TABLE IF NOT EXISTS index_snapshots (+ id TEXT PRIMARY KEY,+ index_id TEXT NOT NULL,+ index_value REAL NOT NULL,+ day_change REAL NOT NULL DEFAULT 0,+ day_change_percent REAL NOT NULL DEFAULT 0,+ total_market_value REAL NOT NULL,+ divisor REAL NOT NULL,+ constituents_data TEXT NOT NULL,+ snapshot_date TEXT NOT NULL,+ created_at TEXT DEFAULT CURRENT_TIMESTAMP,+ FOREIGN KEY (index_id) REFERENCES custom_indices(id) ON DELETE CASCADE+ );++ CREATE INDEX IF NOT EXISTS idx_index_snapshots_index ON index_snapshots(index_id);+ CREATE INDEX IF NOT EXISTS idx_index_snapshots_date ON index_snapshots(snapshot_date DESC);+ CREATE UNIQUE INDEX IF NOT EXISTS idx_index_snapshots_unique ON index_snapshots(index_id, snapshot_date)",)?;diff --git a/fincept-terminal-desktop/src-tauri/src/database/types.rs b/fincept-terminal-desktop/src-tauri/src/database/types.rsindex 0ae8db93b..49169bc7a 100644--- a/fincept-terminal-desktop/src-tauri/src/database/types.rs+++ b/fincept-terminal-desktop/src-tauri/src/database/types.rs@@ -378,3 +378,55 @@ pub struct AgentConfig {pub created_at: String,pub updated_at: String,}++// ============================================================================+// Custom Index (Aggregate Index Feature)+// ============================================================================++#[derive(Debug, Clone, Serialize, Deserialize)]+pub struct CustomIndex {+ pub id: String,+ pub name: String,+ pub description: Option<String>,+ pub calculation_method: String,+ pub base_value: f64,+ pub base_date: String,+ pub divisor: f64,+ pub current_value: f64,+ pub previous_close: f64,+ pub cap_weight: Option<f64>,+ pub currency: String,+ pub portfolio_id: Option<String>,+ pub is_active: bool,+ pub created_at: String,+ pub updated_at: String,+}++#[derive(Debug, Clone, Serialize, Deserialize)]+pub struct IndexConstituent {+ pub id: String,+ pub index_id: String,+ pub symbol: String,+ pub shares: Option<f64>,+ pub weight: Option<f64>,+ pub market_cap: Option<f64>,+ pub fundamental_score: Option<f64>,+ pub custom_price: Option<f64>,+ pub price_date: Option<String>,+ pub added_at: String,+ pub updated_at: String,+}++#[derive(Debug, Clone, Serialize, Deserialize)]+pub struct IndexSnapshot {+ pub id: String,+ pub index_id: String,+ pub index_value: f64,+ pub day_change: f64,+ pub day_change_percent: f64,+ pub total_market_value: f64,+ pub divisor: f64,+ pub constituents_data: String,+ pub snapshot_date: String,+ pub created_at: String,+}diff --git a/fincept-terminal-desktop/src-tauri/src/lib.rs b/fincept-terminal-desktop/src-tauri/src/lib.rsindex 6d2131db6..e287a0a83 100644--- a/fincept-terminal-desktop/src-tauri/src/lib.rs+++ b/fincept-terminal-desktop/src-tauri/src/lib.rs@@ -1306,10 +1306,49 @@ pub fn run() {commands::economic_calendar::get_economic_calendar_by_country,commands::economic_calendar::get_economic_calendar_high_impact,// Databento Commands+ commands::databento::databento_test_connection,+ commands::databento::databento_get_options_chain,+ commands::databento::databento_get_options_definitions,+ commands::databento::databento_get_multi_asset_data,+ commands::databento::databento_get_historical_ohlcv,commands::databento::execute_databento_command,commands::databento::get_databento_market_data,commands::databento::get_databento_datasets,commands::databento::get_databento_historical,+ commands::databento::databento_resolve_symbols,+ commands::databento::databento_list_datasets,+ commands::databento::databento_get_dataset_info,+ commands::databento::databento_get_cost_estimate,+ commands::databento::databento_list_schemas,+ // Databento Reference Data Commands+ commands::databento::databento_get_security_master,+ commands::databento::databento_get_corporate_actions,+ commands::databento::databento_get_adjustment_factors,+ // Databento Order Book Commands+ commands::databento::databento_get_order_book,+ commands::databento::databento_get_order_book_snapshot,+ // Databento Live Streaming Commands+ commands::databento::databento_live_info,+ commands::databento::databento_live_start,+ commands::databento::databento_live_stop,+ commands::databento::databento_live_list,+ commands::databento::databento_live_stop_all,+ // Databento Futures Commands+ commands::databento::databento_list_futures,+ commands::databento::databento_get_futures_data,+ commands::databento::databento_get_futures_definitions,+ commands::databento::databento_get_futures_term_structure,+ // Databento Batch Download Commands+ commands::databento::databento_submit_batch_job,+ commands::databento::databento_list_batch_jobs,+ commands::databento::databento_list_batch_files,+ commands::databento::databento_download_batch_job,+ // Databento Additional Schemas Commands+ commands::databento::databento_get_trades,+ commands::databento::databento_get_imbalance,+ commands::databento::databento_get_statistics,+ commands::databento::databento_get_status,+ commands::databento::databento_get_schema_data,// Sentinel Hub Commandscommands::sentinelhub::execute_sentinelhub_command,commands::sentinelhub::get_sentinelhub_imagery,@@ -1355,6 +1394,21 @@ pub fn run() {commands::portfolio_management::portfolio_get_assets,commands::portfolio_management::portfolio_update_asset_symbol,commands::portfolio_management::portfolio_get_transactions,+ // Custom Index Commands (Aggregate Index Feature)+ commands::custom_index::custom_index_create,+ commands::custom_index::custom_index_get_all,+ commands::custom_index::custom_index_get_by_id,+ commands::custom_index::custom_index_update,+ commands::custom_index::custom_index_delete,+ commands::custom_index::custom_index_hard_delete,+ commands::custom_index::index_constituent_add,+ commands::custom_index::index_constituent_get_all,+ commands::custom_index::index_constituent_update,+ commands::custom_index::index_constituent_remove,+ commands::custom_index::index_snapshot_save,+ commands::custom_index::index_snapshot_get_all,+ commands::custom_index::index_snapshot_get_latest,+ commands::custom_index::index_snapshot_cleanup,// Portfolio Analyticscommands::portfolio::calculate_portfolio_metrics,commands::portfolio::optimize_portfolio,diff --git a/fincept-terminal-desktop/src/components/command-bar/commandRegistry.ts b/fincept-terminal-desktop/src/components/command-bar/commandRegistry.tsindex a789c67e5..110779cfe 100644--- a/fincept-terminal-desktop/src/components/command-bar/commandRegistry.ts+++ b/fincept-terminal-desktop/src/components/command-bar/commandRegistry.ts@@ -128,11 +128,11 @@ export const COMMANDS: Command[] = [id: 'prof',name: 'Profile',description: 'User profile settings',- aliases: ['prof', 'profile', 'account', 'settings'],+ aliases: ['prof', 'profile', 'account'],category: 'navigation',action: 'profile',shortcut: 'F12',- keywords: ['profile', 'account', 'user', 'settings', 'preferences']+ keywords: ['profile', 'account', 'user', 'preferences']},// Additional Navigation Commands@@ -210,12 +210,12 @@ export const COMMANDS: Command[] = [},{id: '3dviz',- name: '3D Visualization',- description: '3D data visualization',- aliases: ['3dviz', '3d', 'viz', 'visualization'],+ name: 'Surface Analytics',+ description: 'Options volatility surface, correlation matrix, yield curve, PCA analysis',+ aliases: ['surface', 'volsurface', 'iv', 'vol', 'volatility', 'correlation', '3d', '3dviz'],category: 'navigation',action: '3d-viz',- keywords: ['3d', 'visualization', 'graphics', 'visual']+ keywords: ['surface', 'volatility', 'options', 'iv', 'correlation', 'yield', 'pca', 'databento', '3d']},// Tools@@ -351,7 +351,7 @@ export const COMMANDS: Command[] = [id: 'support',name: 'Support',description: 'Support tickets',- aliases: ['support', 'ticket', 'help'],+ aliases: ['support', 'ticket', 'tickets'],category: 'system',action: 'support',keywords: ['support', 'ticket', 'help', 'assistance']@@ -364,6 +364,62 @@ export const COMMANDS: Command[] = [category: 'system',action: 'settings',keywords: ['settings', 'preferences', 'configuration', 'options']+ },++ // Missing Tabs - Added+ {+ id: 'analytics',+ name: 'Analytics',+ description: 'Financial analytics and models',+ aliases: ['analytics', 'analysis', 'models'],+ category: 'data',+ action: 'analytics',+ keywords: ['analytics', 'analysis', 'financial', 'models', 'statistics']+ },+ {+ id: 'akshare',+ name: 'AKShare Data',+ description: 'Chinese financial data (AKShare)',+ aliases: ['akshare', 'aks', 'chinese'],+ category: 'data',+ action: 'akshare',+ keywords: ['akshare', 'chinese', 'data', 'china', 'financial']+ },+ {+ id: 'asia',+ name: 'Asia Markets',+ description: 'Asian market data',+ aliases: ['asia', 'asian', 'apac'],+ category: 'navigation',+ action: 'asia-markets',+ keywords: ['asia', 'asian', 'markets', 'apac', 'regional']+ },+ {+ id: 'tradeviz',+ name: 'Trade Visualization',+ description: 'Trade flow visualization',+ aliases: ['tradeviz', 'tradegraph', 'flow'],+ category: 'tool',+ action: 'trade-viz',+ keywords: ['trade', 'visualization', 'flow', 'graph', 'network']+ },+ {+ id: 'about',+ name: 'About',+ description: 'About Fincept Terminal',+ aliases: ['about', 'info', 'version'],+ category: 'system',+ action: 'about',+ keywords: ['about', 'information', 'version', 'credits']+ },+ {+ id: 'alphaarena',+ name: 'Alpha Arena',+ description: 'Trading competition platform',+ aliases: ['alphaarena', 'alpha', 'arena', 'competition'],+ category: 'navigation',+ action: 'alpha-arena',+ keywords: ['alpha', 'arena', 'competition', 'trading', 'leaderboard']}];diff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsxindex 282dbcddd..667a214be 100644--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx@@ -59,7 +59,7 @@ const MaritimeTab = React.lazy(() => import('@/components/tabs/maritime'));const ReportBuilderTab = React.lazy(() => import('@/components/tabs/report-builder'));const DataMappingTab = React.lazy(() => import('@/components/tabs/data-mapping'));const ExcelTab = React.lazy(() => import('@/components/tabs/excel'));-const Visualization3DTab = React.lazy(() => import('@/components/tabs/visualization-3d'));+const SurfaceAnalyticsTab = React.lazy(() => import('@/components/tabs/surface-analytics'));const PolymarketTab = React.lazy(() => import('@/components/tabs/polymarket'));const TradeVisualizationTab = React.lazy(() => import('@/components/tabs/trade-visualization'));const AlphaArenaTab = React.lazy(() => import('@/components/tabs/alpha-arena'));@@ -1066,7 +1066,7 @@ function FinxeptTerminalContent() {</TabsContent><TabsContent value="3d-viz" className="h-full m-0 p-0"><React.Suspense fallback={<TabLoadingFallback />}>- <Visualization3DTab />+ <SurfaceAnalyticsTab /></React.Suspense></TabsContent><TabsContent value="alpha-arena" className="h-full m-0 p-0">diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsxindex 4b7074f53..0c065936a 100644--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/NodeEditorTab.tsx@@ -711,8 +711,39 @@ export default function NodeEditorTab() {} else if (cloned.type === 'agent-mediator') {cloned.data.onExecute = () => {};cloned.data.onConfigChange = () => {};+ } else if (cloned.type === 'python-agent') {+ // Ensure parameters exist+ if (!cloned.data.parameters) {+ cloned.data.parameters = {};+ }+ cloned.data.onExecute = () => {};+ cloned.data.onParameterChange = () => {};+ cloned.data.onLLMChange = () => {};+ } else if (cloned.type === 'backtest') {+ // Ensure parameters exist+ if (!cloned.data.parameters) {+ cloned.data.parameters = {};+ }+ } else if (cloned.type === 'optimization') {+ // Ensure parameters exist+ if (!cloned.data.parameters) {+ cloned.data.parameters = {};+ }+ } else if (cloned.type === 'mcp-tool') {+ // Ensure parameters exist+ if (!cloned.data.parameters) {+ cloned.data.parameters = {};+ }+ cloned.data.onExecute = () => {};+ cloned.data.onParameterChange = () => {};} else if (cloned.type === 'custom') {cloned.data.onLabelChange = handleLabelChange;+ // Ensure parameters exist for custom nodes+ if (!cloned.data.parameters) {+ cloned.data.parameters = {};+ }+ } else if (cloned.type === 'results-display') {+ // Results display nodes don't need callbacks}return cloned;});diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/nodes/BacktestNode.tsx b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/nodes/BacktestNode.tsxindex d96c0a4b7..ed2a24706 100644--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/nodes/BacktestNode.tsx+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/nodes/BacktestNode.tsx@@ -68,7 +68,7 @@ const BacktestNode: React.FC<BacktestNodeProps> = ({ data, selected }) => {};const formatPerformance = () => {- if (!data.result) return null;+ if (!data.result || !data.result.performance) return null;const perf = data.result.performance;return {totalReturn: (perf.totalReturn * 100).toFixed(2) + '%',diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.tsnew file mode 100644index 000000000..4eb08b4e1--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates-COMPLETE-ALL-82-NODES.ts@@ -0,0 +1,1559 @@+/**+ * COMPLETE WORKFLOW TEMPLATE - ALL 82 NODES+ *+ * Institutional-Grade Algorithmic Trading System+ * A comprehensive workflow demonstrating all 82 node types in a logical,+ * realistic trading system architecture.+ *+ * Architecture: 10-Phase Intelligent Trading Pipeline+ * 1. Trigger Layer - Multiple entry points+ * 2. Data Acquisition - Market data + company relationships+ * 3. Data Processing - Cleaning, transformation, utilities+ * 4. Analysis Layer - Technical + fundamental + risk analytics+ * 5. AI Decision Layer - Multi-agent strategy formation+ * 6. Risk Management - Safety checks and position sizing+ * 7. Execution Control - Flow control and error handling+ * 8. Trading Operations - Order execution and management+ * 9. Monitoring & Alerts - Multi-channel notifications+ * 10. Visualization - Results display and reporting+ */++import { Node, Edge, MarkerType } from 'reactflow';+import { WorkflowTemplate } from './workflowTemplates';++const edgeStyle = { stroke: '#ea580c', strokeWidth: 2 };+const markerEnd = { type: MarkerType.ArrowClosed, color: '#ea580c' };++function makeEdge(id: string, source: string, target: string, sourceHandle?: string, targetHandle?: string, label?: string): Edge {+ return {+ id,+ source,+ target,+ sourceHandle,+ targetHandle,+ animated: true,+ style: edgeStyle,+ markerEnd,+ label,+ };+}++// ============================================================================+// PHASE 1: TRIGGER LAYER (6 nodes) - Y: 0-150+// Horizontal spacing: 350px between nodes+// ============================================================================+const phase1Triggers: Node[] = [+ // Trigger 1: Manual+ {+ id: 'trigger_manual',+ type: 'custom',+ position: { x: 200, y: 50 },+ data: {+ label: 'Manual Trigger',+ nodeTypeName: 'manualTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { enabled: true },+ },+ },+ // Trigger 2: Schedule (Market Open)+ {+ id: 'trigger_schedule',+ type: 'custom',+ position: { x: 550, y: 50 },+ data: {+ label: 'Market Open (9:30 AM)',+ nodeTypeName: 'scheduleTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { schedule: '30 9 * * 1-5', timezone: 'America/New_York' },+ },+ },+ // Trigger 3: Price Alert+ {+ id: 'trigger_price',+ type: 'custom',+ position: { x: 900, y: 50 },+ data: {+ label: 'Price Break Alert',+ nodeTypeName: 'priceAlertTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'SPY', condition: 'crosses_above', threshold: 450, operator: 'greater_than' },+ },+ },+ // Trigger 4: News Event+ {+ id: 'trigger_news',+ type: 'custom',+ position: { x: 1250, y: 50 },+ data: {+ label: 'Earnings/M&A News',+ nodeTypeName: 'newsEventTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { keywords: ['earnings', 'merger', 'acquisition'], sources: ['bloomberg', 'reuters'] },+ },+ },+ // Trigger 5: Market Event (Volatility)+ {+ id: 'trigger_market',+ type: 'custom',+ position: { x: 1600, y: 50 },+ data: {+ label: 'VIX Spike Alert',+ nodeTypeName: 'marketEventTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { eventType: 'volatilitySpike', threshold: 25, metric: 'VIX' },+ },+ },+ // Trigger 6: Webhook (External Signal)+ {+ id: 'trigger_webhook',+ type: 'custom',+ position: { x: 1950, y: 50 },+ data: {+ label: 'External Signal API',+ nodeTypeName: 'webhookTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: { path: '/webhook/trading-signal', method: 'POST', authentication: 'api_key' },+ },+ },+];++// ============================================================================+// PHASE 2: DATA ACQUISITION (15 nodes) - Y: 250-450+// Market Data (7) + Relationship Map (8)+// ============================================================================+const phase2DataAcquisition: Node[] = [+ // Control: Merge all triggers+ {+ id: 'merge_triggers',+ type: 'custom',+ position: { x: 1100, y: 250 },+ data: {+ label: 'Merge All Triggers',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'any', waitForAll: false },+ },+ },++ // Market Data Layer+ {+ id: 'market_quote',+ type: 'custom',+ position: { x: 200, y: 450 },+ data: {+ label: 'Real-Time Quotes',+ nodeTypeName: 'getQuote',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbols: ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'META'], provider: 'yahoo', updateFrequency: '1s' },+ },+ },+ {+ id: 'market_historical',+ type: 'custom',+ position: { x: 550, y: 450 },+ data: {+ label: 'Historical OHLCV',+ nodeTypeName: 'getHistoricalData',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbols: 'AAPL,MSFT,GOOGL,AMZN,META', interval: '1d', period: '2y' },+ },+ },+ {+ id: 'market_depth',+ type: 'custom',+ position: { x: 900, y: 450 },+ data: {+ label: 'L2 Order Book',+ nodeTypeName: 'getMarketDepth',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', levels: 20, exchange: 'NASDAQ' },+ },+ },+ {+ id: 'market_stream',+ type: 'custom',+ position: { x: 1250, y: 450 },+ data: {+ label: 'WebSocket Stream',+ nodeTypeName: 'streamQuotes',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbols: ['AAPL', 'SPY'], channels: ['trades', 'quotes'], provider: 'alpaca' },+ },+ },+ {+ id: 'market_fundamentals',+ type: 'custom',+ position: { x: 1600, y: 450 },+ data: {+ label: 'Company Fundamentals',+ nodeTypeName: 'getFundamentals',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', metrics: ['pe_ratio', 'eps', 'revenue', 'profit_margin'] },+ },+ },+ {+ id: 'market_stats',+ type: 'custom',+ position: { x: 1950, y: 450 },+ data: {+ label: 'Ticker Statistics',+ nodeTypeName: 'getTickerStats',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', stats: ['volume', 'avg_volume', '52w_high', '52w_low'] },+ },+ },+ {+ id: 'market_yfinance',+ type: 'custom',+ position: { x: 2300, y: 450 },+ data: {+ label: 'YFinance Data',+ nodeTypeName: 'yfinance',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', period: '1y', interval: '1d', metrics: 'all' },+ },+ },++ // Relationship Map Layer (Company Intelligence)+ {+ id: 'rel_company',+ type: 'custom',+ position: { x: 200, y: 700 },+ data: {+ label: 'Company Entity (AAPL)',+ nodeTypeName: 'companyNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', name: 'Apple Inc.', sector: 'Technology' },+ },+ },+ {+ id: 'rel_peers',+ type: 'custom',+ position: { x: 550, y: 700 },+ data: {+ label: 'Peer Companies',+ nodeTypeName: 'peerNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { baseSymbol: 'AAPL', peers: ['MSFT', 'GOOGL', 'META', 'AMZN'] },+ },+ },+ {+ id: 'rel_institutional',+ type: 'custom',+ position: { x: 900, y: 700 },+ data: {+ label: 'Institutional Holders',+ nodeTypeName: 'institutionalHolderNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', minOwnership: 1, topN: 10 },+ },+ },+ {+ id: 'rel_funds',+ type: 'custom',+ position: { x: 1250, y: 700 },+ data: {+ label: 'Fund Families',+ nodeTypeName: 'fundFamilyNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', families: ['Vanguard', 'BlackRock', 'State Street'] },+ },+ },+ {+ id: 'rel_insiders',+ type: 'custom',+ position: { x: 1600, y: 700 },+ data: {+ label: 'Company Insiders',+ nodeTypeName: 'insiderNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', includeOfficers: true, includeDirectors: true },+ },+ },+ {+ id: 'rel_events',+ type: 'custom',+ position: { x: 1950, y: 700 },+ data: {+ label: 'Corporate Events',+ nodeTypeName: 'eventNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', eventTypes: ['earnings', 'dividends', 'splits', 'buybacks'] },+ },+ },+ {+ id: 'rel_metrics',+ type: 'custom',+ position: { x: 2300, y: 700 },+ data: {+ label: 'Metrics Cluster',+ nodeTypeName: 'metricsClusterNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', clusterType: 'valuation', metrics: ['PE', 'PB', 'PS', 'EV/EBITDA'] },+ },+ },+ {+ id: 'rel_supply_chain',+ type: 'custom',+ position: { x: 2650, y: 700 },+ data: {+ label: 'Supply Chain Map',+ nodeTypeName: 'supplyChainNode',+ color: '#3b82f6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', depth: 2, includeSuppliers: true, includeCustomers: true },+ },+ },+];++// ============================================================================+// PHASE 3: DATA PROCESSING (13 nodes) - Y: 600-750+// Transform (8) + Core Utilities (5)+// ============================================================================+const phase3DataProcessing: Node[] = [+ // Merge market data and relationship data+ {+ id: 'merge_data_sources',+ type: 'custom',+ position: { x: 1100, y: 950 },+ data: {+ label: 'Merge Data Sources',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all', waitForAll: true },+ },+ },++ // Transform Layer+ {+ id: 'transform_filter',+ type: 'custom',+ position: { x: 200, y: 1150 },+ data: {+ label: 'Filter High Volume',+ nodeTypeName: 'filter',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { field: 'volume', operator: 'greaterThan', value: 5000000, description: 'Only high-liquidity stocks' },+ },+ },+ {+ id: 'transform_map',+ type: 'custom',+ position: { x: 550, y: 1150 },+ data: {+ label: 'Calculate Returns',+ nodeTypeName: 'map',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { expression: '(close - open) / open * 100', outputField: 'daily_return' },+ },+ },+ {+ id: 'transform_aggregate',+ type: 'custom',+ position: { x: 900, y: 1150 },+ data: {+ label: 'Total Volume',+ nodeTypeName: 'aggregate',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { operation: 'sum', field: 'volume', groupBy: 'symbol' },+ },+ },+ {+ id: 'transform_sort',+ type: 'custom',+ position: { x: 1250, y: 1150 },+ data: {+ label: 'Rank by Performance',+ nodeTypeName: 'sort',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { field: 'daily_return', direction: 'descending', limit: 10 },+ },+ },+ {+ id: 'transform_groupby',+ type: 'custom',+ position: { x: 1600, y: 1150 },+ data: {+ label: 'Group by Sector',+ nodeTypeName: 'groupBy',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { field: 'sector', aggregations: { avg_return: 'mean', total_volume: 'sum' } },+ },+ },+ {+ id: 'transform_join',+ type: 'custom',+ position: { x: 1950, y: 1150 },+ data: {+ label: 'Join Price + Fundamentals',+ nodeTypeName: 'join',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { joinKey: 'symbol', joinType: 'inner', leftSource: 'prices', rightSource: 'fundamentals' },+ },+ },+ {+ id: 'transform_dedupe',+ type: 'custom',+ position: { x: 2300, y: 1150 },+ data: {+ label: 'Remove Duplicates',+ nodeTypeName: 'deduplicate',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { uniqueField: 'symbol', keepFirst: true },+ },+ },+ {+ id: 'transform_reshape',+ type: 'custom',+ position: { x: 2650, y: 1150 },+ data: {+ label: 'Format for Analytics',+ nodeTypeName: 'reshape',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { outputFormat: 'timeseries', indexField: 'date', columnsField: 'symbol' },+ },+ },++ // Core Utility Nodes+ {+ id: 'util_code',+ type: 'custom',+ position: { x: 200, y: 1400 },+ data: {+ label: 'Custom Code Logic',+ nodeTypeName: 'code',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { language: 'javascript', code: 'return items.map(item => ({ ...item, processed: true }));' },+ },+ },+ {+ id: 'util_filter',+ type: 'custom',+ position: { x: 550, y: 1400 },+ data: {+ label: 'Utility Filter',+ nodeTypeName: 'filterUtil',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { conditions: [{ field: 'price', op: '>', value: 50 }] },+ },+ },+ {+ id: 'util_merge',+ type: 'custom',+ position: { x: 900, y: 1400 },+ data: {+ label: 'Utility Merge',+ nodeTypeName: 'mergeUtil',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { strategy: 'concat' },+ },+ },+ {+ id: 'util_set',+ type: 'custom',+ position: { x: 1250, y: 1400 },+ data: {+ label: 'Set Variables',+ nodeTypeName: 'set',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { variables: { portfolio_size: 100000, max_position: 0.1 } },+ },+ },+ {+ id: 'util_switch',+ type: 'custom',+ position: { x: 1600, y: 1400 },+ data: {+ label: 'Utility Switch',+ nodeTypeName: 'switchUtil',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { field: 'market_condition', cases: { bullish: 'path1', bearish: 'path2', neutral: 'path3' } },+ },+ },+];++// ============================================================================+// PHASE 4: ANALYSIS LAYER (7 nodes) - Y: 950-1100+// ============================================================================+const phase4Analytics: Node[] = [+ // Merge processed data+ {+ id: 'merge_processed',+ type: 'custom',+ position: { x: 1100, y: 1650 },+ data: {+ label: 'Merge Processed Data',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all' },+ },+ },++ {+ id: 'analytics_indicators',+ type: 'technical-indicator',+ position: { x: 200, y: 1850 },+ data: {+ label: 'Technical Indicators',+ dataSource: 'yfinance',+ symbol: 'AAPL',+ period: '1y',+ csvPath: '',+ jsonData: '',+ categories: ['momentum', 'trend', 'volatility', 'volume'],+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ {+ id: 'analytics_portfolio_opt',+ type: 'custom',+ position: { x: 550, y: 1850 },+ data: {+ label: 'MPT Optimization',+ nodeTypeName: 'portfolioOptimization',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { method: 'max_sharpe', constraints: { max_weight: 0.3, min_weight: 0.05 }, riskFreeRate: 0.05 },+ },+ },+ {+ id: 'analytics_backtest',+ type: 'backtest',+ position: { x: 900, y: 1850 },+ data: {+ label: 'Strategy Backtest',+ color: '#06b6d4',+ status: 'idle',+ parameters: {+ strategy: 'MA_Crossover',+ initialCapital: 100000,+ commission: 0.001,+ shortWindow: 20,+ longWindow: 50,+ slippage: 0.0005,+ },+ },+ },+ {+ id: 'analytics_risk',+ type: 'custom',+ position: { x: 1250, y: 1850 },+ data: {+ label: 'Risk Metrics (VaR/CVaR)',+ nodeTypeName: 'riskAnalysis',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { confidenceLevel: 0.95, timeHorizon: '1d', riskMetrics: ['var', 'cvar', 'maxDrawdown', 'sharpe', 'sortino'] },+ },+ },+ {+ id: 'analytics_performance',+ type: 'custom',+ position: { x: 1600, y: 1850 },+ data: {+ label: 'Performance vs Benchmark',+ nodeTypeName: 'performanceMetrics',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { benchmarkSymbol: 'SPY', riskFreeRate: 0.05, metrics: ['alpha', 'beta', 'sharpe', 'information_ratio'] },+ },+ },+ {+ id: 'analytics_correlation',+ type: 'custom',+ position: { x: 1950, y: 1850 },+ data: {+ label: 'Correlation Matrix',+ nodeTypeName: 'correlationMatrix',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { method: 'pearson', minCorrelation: 0.5, visualize: true },+ },+ },+];++// ============================================================================+// PHASE 5: AI DECISION LAYER (6 nodes) - Y: 1200-1350+// ============================================================================+const phase5AIDecision: Node[] = [+ // Merge analytics+ {+ id: 'merge_analytics',+ type: 'custom',+ position: { x: 1100, y: 2100 },+ data: {+ label: 'Merge Analytics Results',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all' },+ },+ },++ {+ id: 'agent_python',+ type: 'python-agent',+ position: { x: 200, y: 2300 },+ data: {+ agentType: 'portfolio_analysis',+ agentCategory: 'financial',+ label: 'Python Quant Agent',+ icon: 'brain',+ color: '#8b5cf6',+ parameters: { analysisType: 'comprehensive', model: 'advanced', outputFormat: 'json' },+ selectedLLM: 'active',+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ onLLMChange: () => {},+ },+ },+ {+ id: 'agent_geopolitics',+ type: 'custom',+ position: { x: 550, y: 2300 },+ data: {+ label: 'Geopolitics Risk Agent',+ nodeTypeName: 'geopoliticsAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { region: 'global', analysisType: 'macro_risk', factors: ['trade', 'sanctions', 'conflicts'] },+ },+ },+ {+ id: 'agent_hedgefund',+ type: 'custom',+ position: { x: 900, y: 2300 },+ data: {+ label: 'Hedge Fund Strategy',+ nodeTypeName: 'hedgeFundAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { strategy: 'long_short_equity', leverage: 2.0, hedgeRatio: 0.7 },+ },+ },+ {+ id: 'agent_investor',+ type: 'custom',+ position: { x: 1250, y: 2300 },+ data: {+ label: 'Investor Persona (Buffett)',+ nodeTypeName: 'investorAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { persona: 'warren_buffett', strategy: 'value_investing', timeHorizon: 'long_term' },+ },+ },+ {+ id: 'agent_multi',+ type: 'custom',+ position: { x: 1600, y: 2300 },+ data: {+ label: 'Multi-Agent Committee',+ nodeTypeName: 'multiAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { agents: ['technical_analyst', 'fundamental_analyst', 'risk_manager', 'portfolio_manager'], votingMethod: 'weighted' },+ },+ },+ {+ id: 'agent_mediator',+ type: 'agent-mediator',+ position: { x: 1100, y: 2550 },+ data: {+ label: 'AI Decision Mediator',+ selectedProvider: undefined,+ customPrompt: 'Synthesize all agent recommendations and provide final trading decision with confidence score',+ status: 'idle',+ result: undefined,+ error: undefined,+ inputData: undefined,+ onExecute: () => {},+ onConfigChange: () => {},+ },+ },+];++// ============================================================================+// PHASE 6: RISK MANAGEMENT (4 nodes) - Y: 1500-1650+// ============================================================================+const phase6RiskManagement: Node[] = [+ {+ id: 'safety_risk_check',+ type: 'custom',+ position: { x: 200, y: 2750 },+ data: {+ label: 'Pre-Trade Risk Check',+ nodeTypeName: 'riskCheck',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { maxRiskPerTrade: 0.02, maxPortfolioRisk: 0.1, checkCorrelation: true },+ },+ },+ {+ id: 'safety_position_size',+ type: 'custom',+ position: { x: 550, y: 2750 },+ data: {+ label: 'Kelly Criterion Sizing',+ nodeTypeName: 'positionSizeLimit',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { method: 'kelly', maxPositionSize: 20000, minPositionSize: 1000, fractionalKelly: 0.25 },+ },+ },+ {+ id: 'safety_loss_limit',+ type: 'custom',+ position: { x: 900, y: 2750 },+ data: {+ label: 'Loss Limits & Circuit Breaker',+ nodeTypeName: 'lossLimit',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { maxDailyLoss: 2000, maxWeeklyLoss: 5000, stopAllOnBreach: true },+ },+ },+ {+ id: 'safety_trading_hours',+ type: 'custom',+ position: { x: 1250, y: 2750 },+ data: {+ label: 'Trading Hours Gate',+ nodeTypeName: 'tradingHoursCheck',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { marketHours: '09:30-16:00', timezone: 'America/New_York', allowPreMarket: false, allowAfterHours: false },+ },+ },+];++// ============================================================================+// PHASE 7: EXECUTION CONTROL (7 nodes) - Y: 1750-1900+// ============================================================================+const phase7ExecutionControl: Node[] = [+ {+ id: 'control_ifelse',+ type: 'custom',+ position: { x: 200, y: 3000 },+ data: {+ label: 'Trade or Hold Decision',+ nodeTypeName: 'ifElse',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { condition: 'confidence_score > 0.75 && risk_score < 0.3', trueLabel: 'EXECUTE', falseLabel: 'HOLD' },+ },+ },+ {+ id: 'control_switch',+ type: 'custom',+ position: { x: 550, y: 3000 },+ data: {+ label: 'Strategy Router',+ nodeTypeName: 'switch',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { field: 'strategy_type', cases: { momentum: 'momentum_execution', mean_reversion: 'mean_reversion_execution', breakout: 'breakout_execution' } },+ },+ },+ {+ id: 'control_loop',+ type: 'custom',+ position: { x: 900, y: 3000 },+ data: {+ label: 'Order Slicing Loop',+ nodeTypeName: 'loop',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { maxIterations: 10, breakCondition: 'order_filled || attempts > 10', loopVariable: 'slice_index' },+ },+ },+ {+ id: 'control_wait',+ type: 'custom',+ position: { x: 1250, y: 3000 },+ data: {+ label: 'Order Execution Delay',+ nodeTypeName: 'wait',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { duration: 2000, unit: 'milliseconds', reason: 'rate_limiting' },+ },+ },+ {+ id: 'control_split',+ type: 'custom',+ position: { x: 200, y: 3250 },+ data: {+ label: 'Split Order Flow',+ nodeTypeName: 'split',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { splitCount: 3, splitBy: 'symbol', parallel: true },+ },+ },+ {+ id: 'control_merge2',+ type: 'custom',+ position: { x: 550, y: 3250 },+ data: {+ label: 'Merge Execution Paths',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all', waitForAll: true },+ },+ },+ {+ id: 'control_error',+ type: 'custom',+ position: { x: 900, y: 3250 },+ data: {+ label: 'Error Handler & Retry',+ nodeTypeName: 'errorHandler',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { retryCount: 3, retryDelay: 1000, fallbackBehavior: 'cancel_order', logErrors: true },+ },+ },+];++// ============================================================================+// PHASE 8: TRADING OPERATIONS (8 nodes) - Y: 2100-2300+// ============================================================================+const phase8TradingOps: Node[] = [+ {+ id: 'trading_place_order',+ type: 'custom',+ position: { x: 200, y: 3500 },+ data: {+ label: 'Place Smart Order',+ nodeTypeName: 'placeOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', side: 'buy', quantity: 100, orderType: 'limit', timeInForce: 'day', smartRouting: true },+ },+ },+ {+ id: 'trading_modify_order',+ type: 'custom',+ position: { x: 550, y: 3500 },+ data: {+ label: 'Modify Price/Quantity',+ nodeTypeName: 'modifyOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { orderId: 'dynamic', newPrice: 'nbbo_mid', newQuantity: 'partial_fill_remainder' },+ },+ },+ {+ id: 'trading_cancel_order',+ type: 'custom',+ position: { x: 900, y: 3500 },+ data: {+ label: 'Cancel Unfilled Orders',+ nodeTypeName: 'cancelOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { orderId: 'all_pending', cancelAfter: 300, reason: 'timeout' },+ },+ },+ {+ id: 'trading_get_positions',+ type: 'custom',+ position: { x: 1250, y: 3500 },+ data: {+ label: 'Get Open Positions',+ nodeTypeName: 'getPositions',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { account: 'main', includeUnrealizedPnL: true, filterSymbols: [] },+ },+ },+ {+ id: 'trading_get_holdings',+ type: 'custom',+ position: { x: 1600, y: 3500 },+ data: {+ label: 'Portfolio Holdings',+ nodeTypeName: 'getHoldings',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { account: 'main', includeMarketValue: true, includeCostBasis: true },+ },+ },+ {+ id: 'trading_get_orders',+ type: 'custom',+ position: { x: 1950, y: 3500 },+ data: {+ label: 'Order History',+ nodeTypeName: 'getOrders',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { status: 'all', startDate: 'today', limit: 100 },+ },+ },+ {+ id: 'trading_get_balance',+ type: 'custom',+ position: { x: 200, y: 3750 },+ data: {+ label: 'Account Balance & Buying Power',+ nodeTypeName: 'getBalance',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { account: 'main', includeBuyingPower: true, includeMarginUsed: true },+ },+ },+ {+ id: 'trading_close_position',+ type: 'custom',+ position: { x: 550, y: 3750 },+ data: {+ label: 'Close Position (SL/TP)',+ nodeTypeName: 'closePosition',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { symbol: 'AAPL', closeType: 'market', reason: 'stop_loss_hit', percentage: 100 },+ },+ },+];++// ============================================================================+// PHASE 9: MONITORING & ALERTS (6 nodes) - Y: 2450-2600+// ============================================================================+const phase9Monitoring: Node[] = [+ // Merge trading results+ {+ id: 'merge_trading',+ type: 'custom',+ position: { x: 1100, y: 4000 },+ data: {+ label: 'Merge Trading Results',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all' },+ },+ },++ {+ id: 'notify_webhook',+ type: 'custom',+ position: { x: 200, y: 4200 },+ data: {+ label: 'Webhook to Portfolio Tracker',+ nodeTypeName: 'webhookNotification',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { url: 'https://api.portfolio-tracker.com/webhook', method: 'POST', headers: { 'Authorization': 'Bearer token' } },+ },+ },+ {+ id: 'notify_email',+ type: 'custom',+ position: { x: 550, y: 4200 },+ data: {+ label: 'Email Alert',+ nodeTypeName: 'email',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { to: '[email protected]', subject: 'Trade Execution Alert', template: 'trade_confirmation', priority: 'high' },+ },+ },+ {+ id: 'notify_telegram',+ type: 'custom',+ position: { x: 900, y: 4200 },+ data: {+ label: 'Telegram to Trading Team',+ nodeTypeName: 'telegram',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { chatId: '123456789', botToken: 'env.TELEGRAM_BOT_TOKEN', parseMode: 'markdown' },+ },+ },+ {+ id: 'notify_discord',+ type: 'custom',+ position: { x: 1250, y: 4200 },+ data: {+ label: 'Discord Trading Channel',+ nodeTypeName: 'discord',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { webhookUrl: 'https://discord.com/api/webhooks/...', username: 'TradingBot', embeds: true },+ },+ },+ {+ id: 'notify_slack',+ type: 'custom',+ position: { x: 1600, y: 4200 },+ data: {+ label: 'Slack #algo-trading',+ nodeTypeName: 'slack',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { channel: '#algo-trading', webhookUrl: 'env.SLACK_WEBHOOK', attachments: true },+ },+ },+ {+ id: 'notify_sms',+ type: 'custom',+ position: { x: 1950, y: 4200 },+ data: {+ label: 'SMS for Critical Alerts',+ nodeTypeName: 'sms',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { phoneNumber: '+1234567890', service: 'twilio', onlyCritical: true },+ },+ },+];++// ============================================================================+// PHASE 10: VISUALIZATION & REPORTING (10 nodes) - Y: 2700-2900+// ============================================================================+const phase10Visualization: Node[] = [+ // Merge notifications+ {+ id: 'merge_notifications',+ type: 'custom',+ position: { x: 1100, y: 4450 },+ data: {+ label: 'Merge Notifications',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all' },+ },+ },++ {+ id: 'ui_datasource',+ type: 'data-source',+ position: { x: 200, y: 4650 },+ data: {+ label: 'Data Source Connector',+ dataSource: 'yfinance',+ symbol: 'AAPL',+ period: '1y',+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ {+ id: 'ui_mcp',+ type: 'mcp-tool',+ position: { x: 550, y: 4650 },+ data: {+ label: 'MCP Financial API',+ serverName: 'financial-data-api',+ toolName: 'get_comprehensive_data',+ parameters: { symbols: ['AAPL'], metrics: 'all' },+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ {+ id: 'ui_technical_indicator',+ type: 'technical-indicator',+ position: { x: 900, y: 4650 },+ data: {+ label: 'Indicator Dashboard',+ dataSource: 'yfinance',+ symbol: 'AAPL',+ period: '1y',+ csvPath: '',+ jsonData: '',+ categories: ['momentum', 'trend', 'volatility', 'volume', 'others'],+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ {+ id: 'ui_backtest',+ type: 'backtest',+ position: { x: 1250, y: 4650 },+ data: {+ label: 'Backtest Results',+ color: '#06b6d4',+ status: 'idle',+ parameters: { displayMetrics: ['sharpe', 'returns', 'drawdown', 'win_rate'] },+ },+ },+ {+ id: 'ui_optimization',+ type: 'optimization',+ position: { x: 1600, y: 4650 },+ data: {+ label: 'Parameter Optimization Results',+ color: '#a855f7',+ status: 'idle',+ parameters: { displayBest: 10, visualizeSpace: true },+ },+ },+ {+ id: 'ui_agent_mediator',+ type: 'agent-mediator',+ position: { x: 1950, y: 4650 },+ data: {+ label: 'AI Insights Summary',+ selectedProvider: undefined,+ customPrompt: 'Generate executive summary of trading session',+ status: 'idle',+ result: undefined,+ error: undefined,+ inputData: undefined,+ onExecute: () => {},+ onConfigChange: () => {},+ },+ },+ {+ id: 'ui_system',+ type: 'custom',+ position: { x: 200, y: 4900 },+ data: {+ label: 'System Metrics Logger',+ nodeTypeName: 'system',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { action: 'log_and_save', logLevel: 'info', saveToDatabase: true },+ },+ },+ {+ id: 'ui_results_summary',+ type: 'results-display',+ position: { x: 550, y: 4900 },+ data: {+ label: 'Trading Session Summary',+ color: '#10b981',+ inputData: undefined,+ },+ },++ // Final comprehensive results+ {+ id: 'final_merge',+ type: 'custom',+ position: { x: 1100, y: 5150 },+ data: {+ label: 'Final Comprehensive Merge',+ nodeTypeName: 'merge',+ color: '#ea580c',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: { mergeMode: 'all', includeMetadata: true },+ },+ },+ {+ id: 'final_results',+ type: 'results-display',+ position: { x: 1100, y: 5400 },+ data: {+ label: 'COMPLETE WORKFLOW RESULTS',+ color: '#ea580c',+ inputData: undefined,+ },+ },+];++// ============================================================================+// COMBINE ALL PHASES+// ============================================================================+export const completeWorkflowAllNodesV2: Node[] = [+ ...phase1Triggers,+ ...phase2DataAcquisition,+ ...phase3DataProcessing,+ ...phase4Analytics,+ ...phase5AIDecision,+ ...phase6RiskManagement,+ ...phase7ExecutionControl,+ ...phase8TradingOps,+ ...phase9Monitoring,+ ...phase10Visualization,+];++// ============================================================================+// INTELLIGENT EDGE CONNECTIONS+// ============================================================================+export const completeWorkflowEdgesV2: Edge[] = [+ // ========== PHASE 1 → PHASE 2: Triggers to Data Merge ==========+ makeEdge('e1_1', 'trigger_manual', 'merge_triggers'),+ makeEdge('e1_2', 'trigger_schedule', 'merge_triggers'),+ makeEdge('e1_3', 'trigger_price', 'merge_triggers'),+ makeEdge('e1_4', 'trigger_news', 'merge_triggers'),+ makeEdge('e1_5', 'trigger_market', 'merge_triggers'),+ makeEdge('e1_6', 'trigger_webhook', 'merge_triggers'),++ // ========== PHASE 2: Trigger Merge to Data Acquisition ==========+ // Market Data Branch+ makeEdge('e2_1', 'merge_triggers', 'market_quote', undefined, undefined, 'real-time'),+ makeEdge('e2_2', 'merge_triggers', 'market_historical', undefined, undefined, 'historical'),+ makeEdge('e2_3', 'merge_triggers', 'market_depth', undefined, undefined, 'L2'),+ makeEdge('e2_4', 'merge_triggers', 'market_stream', undefined, undefined, 'stream'),+ makeEdge('e2_5', 'merge_triggers', 'market_fundamentals', undefined, undefined, 'fundamentals'),+ makeEdge('e2_6', 'merge_triggers', 'market_stats', undefined, undefined, 'stats'),+ makeEdge('e2_7', 'merge_triggers', 'market_yfinance', undefined, undefined, 'yfinance'),++ // Relationship Map Branch (parallel to market data)+ makeEdge('e2_8', 'merge_triggers', 'rel_company'),+ makeEdge('e2_9', 'rel_company', 'rel_peers'),+ makeEdge('e2_10', 'rel_peers', 'rel_institutional'),+ makeEdge('e2_11', 'rel_institutional', 'rel_funds'),+ makeEdge('e2_12', 'rel_funds', 'rel_insiders'),+ makeEdge('e2_13', 'rel_insiders', 'rel_events'),+ makeEdge('e2_14', 'rel_events', 'rel_metrics'),+ makeEdge('e2_15', 'rel_metrics', 'rel_supply_chain'),++ // ========== PHASE 2 → PHASE 3: Data Acquisition to Processing ==========+ // Market data to merge+ makeEdge('e3_1', 'market_quote', 'merge_data_sources'),+ makeEdge('e3_2', 'market_historical', 'merge_data_sources'),+ makeEdge('e3_3', 'market_depth', 'merge_data_sources'),+ makeEdge('e3_4', 'market_stream', 'merge_data_sources'),+ makeEdge('e3_5', 'market_fundamentals', 'merge_data_sources'),+ makeEdge('e3_6', 'market_stats', 'merge_data_sources'),+ makeEdge('e3_7', 'market_yfinance', 'merge_data_sources'),+ makeEdge('e3_8', 'rel_supply_chain', 'merge_data_sources', undefined, undefined, 'relationships'),++ // ========== PHASE 3: Data Processing Pipeline ==========+ // Transform chain+ makeEdge('e3_9', 'merge_data_sources', 'transform_filter', undefined, undefined, 'raw'),+ makeEdge('e3_10', 'transform_filter', 'transform_map', undefined, undefined, 'filtered'),+ makeEdge('e3_11', 'transform_map', 'transform_aggregate', undefined, undefined, 'mapped'),+ makeEdge('e3_12', 'transform_aggregate', 'transform_sort', undefined, undefined, 'aggregated'),+ makeEdge('e3_13', 'transform_sort', 'transform_groupby', undefined, undefined, 'sorted'),+ makeEdge('e3_14', 'transform_groupby', 'transform_join', undefined, undefined, 'grouped'),+ makeEdge('e3_15', 'transform_join', 'transform_dedupe', undefined, undefined, 'joined'),+ makeEdge('e3_16', 'transform_dedupe', 'transform_reshape', undefined, undefined, 'clean'),++ // Core utilities (parallel processing)+ makeEdge('e3_17', 'transform_reshape', 'util_code'),+ makeEdge('e3_18', 'util_code', 'util_filter'),+ makeEdge('e3_19', 'util_filter', 'util_merge'),+ makeEdge('e3_20', 'util_merge', 'util_set'),+ makeEdge('e3_21', 'util_set', 'util_switch'),++ // ========== PHASE 3 → PHASE 4: Processing to Analytics ==========+ makeEdge('e4_1', 'util_switch', 'merge_processed', undefined, undefined, 'processed'),+ makeEdge('e4_2', 'transform_reshape', 'merge_processed', undefined, undefined, 'reshaped'),++ // Analytics pipeline+ makeEdge('e4_3', 'merge_processed', 'analytics_indicators', undefined, undefined, 'data'),+ makeEdge('e4_4', 'merge_processed', 'analytics_portfolio_opt', undefined, undefined, 'portfolio'),+ makeEdge('e4_5', 'analytics_indicators', 'analytics_backtest', undefined, undefined, 'signals'),+ makeEdge('e4_6', 'analytics_portfolio_opt', 'analytics_risk', undefined, undefined, 'weights'),+ makeEdge('e4_7', 'analytics_backtest', 'analytics_performance', undefined, undefined, 'results'),+ makeEdge('e4_8', 'analytics_risk', 'analytics_correlation', undefined, undefined, 'risk'),+ makeEdge('e4_9', 'analytics_performance', 'analytics_correlation', undefined, undefined, 'metrics'),++ // ========== PHASE 4 → PHASE 5: Analytics to AI Decision ==========+ makeEdge('e5_1', 'analytics_correlation', 'merge_analytics', undefined, undefined, 'analytics'),+ makeEdge('e5_2', 'analytics_performance', 'merge_analytics'),+ makeEdge('e5_3', 'analytics_risk', 'merge_analytics'),++ // AI Agents (parallel analysis)+ makeEdge('e5_4', 'merge_analytics', 'agent_python', undefined, undefined, 'quant'),+ makeEdge('e5_5', 'merge_analytics', 'agent_geopolitics', undefined, undefined, 'macro'),+ makeEdge('e5_6', 'merge_analytics', 'agent_hedgefund', undefined, undefined, 'strategy'),+ makeEdge('e5_7', 'merge_analytics', 'agent_investor', undefined, undefined, 'value'),+ makeEdge('e5_8', 'merge_analytics', 'agent_multi', undefined, undefined, 'committee'),++ // All agents to mediator+ makeEdge('e5_9', 'agent_python', 'agent_mediator'),+ makeEdge('e5_10', 'agent_geopolitics', 'agent_mediator'),+ makeEdge('e5_11', 'agent_hedgefund', 'agent_mediator'),+ makeEdge('e5_12', 'agent_investor', 'agent_mediator'),+ makeEdge('e5_13', 'agent_multi', 'agent_mediator'),++ // ========== PHASE 5 → PHASE 6: AI Decision to Risk Management ==========+ makeEdge('e6_1', 'agent_mediator', 'safety_risk_check', undefined, undefined, 'decision'),+ makeEdge('e6_2', 'safety_risk_check', 'safety_position_size', undefined, undefined, 'approved'),+ makeEdge('e6_3', 'safety_position_size', 'safety_loss_limit', undefined, undefined, 'sized'),+ makeEdge('e6_4', 'safety_loss_limit', 'safety_trading_hours', undefined, undefined, 'checked'),++ // ========== PHASE 6 → PHASE 7: Risk Management to Execution Control ==========+ makeEdge('e7_1', 'safety_trading_hours', 'control_ifelse', undefined, undefined, 'safe'),+ makeEdge('e7_2', 'control_ifelse', 'control_switch', undefined, undefined, 'execute'),+ makeEdge('e7_3', 'control_switch', 'control_loop', undefined, undefined, 'route'),+ makeEdge('e7_4', 'control_loop', 'control_wait', undefined, undefined, 'slice'),+ makeEdge('e7_5', 'control_wait', 'control_split', undefined, undefined, 'delayed'),+ makeEdge('e7_6', 'control_split', 'control_merge2', undefined, undefined, 'parallel'),+ makeEdge('e7_7', 'control_merge2', 'control_error', undefined, undefined, 'merged'),++ // ========== PHASE 7 → PHASE 8: Execution Control to Trading Ops ==========+ makeEdge('e8_1', 'control_error', 'trading_place_order', undefined, undefined, 'orders'),+ makeEdge('e8_2', 'trading_place_order', 'trading_modify_order', undefined, undefined, 'placed'),+ makeEdge('e8_3', 'trading_modify_order', 'trading_cancel_order', undefined, undefined, 'modified'),+ makeEdge('e8_4', 'trading_cancel_order', 'trading_get_positions', undefined, undefined, 'managed'),+ makeEdge('e8_5', 'trading_get_positions', 'trading_get_holdings', undefined, undefined, 'positions'),+ makeEdge('e8_6', 'trading_get_holdings', 'trading_get_orders', undefined, undefined, 'holdings'),+ makeEdge('e8_7', 'trading_get_orders', 'trading_get_balance', undefined, undefined, 'orders'),+ makeEdge('e8_8', 'trading_get_balance', 'trading_close_position', undefined, undefined, 'balance'),++ // ========== PHASE 8 → PHASE 9: Trading Ops to Monitoring ==========+ makeEdge('e9_1', 'trading_close_position', 'merge_trading', undefined, undefined, 'trades'),+ makeEdge('e9_2', 'trading_get_orders', 'merge_trading'),+ makeEdge('e9_3', 'trading_get_balance', 'merge_trading'),++ // Notifications (parallel alerts)+ makeEdge('e9_4', 'merge_trading', 'notify_webhook', undefined, undefined, 'webhook'),+ makeEdge('e9_5', 'merge_trading', 'notify_email', undefined, undefined, 'email'),+ makeEdge('e9_6', 'merge_trading', 'notify_telegram', undefined, undefined, 'telegram'),+ makeEdge('e9_7', 'merge_trading', 'notify_discord', undefined, undefined, 'discord'),+ makeEdge('e9_8', 'merge_trading', 'notify_slack', undefined, undefined, 'slack'),+ makeEdge('e9_9', 'merge_trading', 'notify_sms', undefined, undefined, 'sms'),++ // ========== PHASE 9 → PHASE 10: Monitoring to Visualization ==========+ makeEdge('e10_1', 'notify_webhook', 'merge_notifications'),+ makeEdge('e10_2', 'notify_email', 'merge_notifications'),+ makeEdge('e10_3', 'notify_telegram', 'merge_notifications'),+ makeEdge('e10_4', 'notify_discord', 'merge_notifications'),+ makeEdge('e10_5', 'notify_slack', 'merge_notifications'),+ makeEdge('e10_6', 'notify_sms', 'merge_notifications'),++ // Visualization nodes+ makeEdge('e10_7', 'merge_notifications', 'ui_datasource', undefined, undefined, 'display'),+ makeEdge('e10_8', 'ui_datasource', 'ui_mcp'),+ makeEdge('e10_9', 'ui_mcp', 'ui_technical_indicator'),+ makeEdge('e10_10', 'ui_technical_indicator', 'ui_backtest'),+ makeEdge('e10_11', 'ui_backtest', 'ui_optimization'),+ makeEdge('e10_12', 'ui_optimization', 'ui_agent_mediator'),+ makeEdge('e10_13', 'ui_agent_mediator', 'ui_system'),+ makeEdge('e10_14', 'ui_system', 'ui_results_summary'),++ // ========== FINAL MERGE: Aggregate all key results ==========+ makeEdge('e11_1', 'ui_results_summary', 'final_merge', undefined, undefined, 'ui'),+ makeEdge('e11_2', 'merge_trading', 'final_merge', undefined, undefined, 'trading'),+ makeEdge('e11_3', 'merge_analytics', 'final_merge', undefined, undefined, 'analytics'),+ makeEdge('e11_4', 'agent_mediator', 'final_merge', undefined, undefined, 'ai'),+ makeEdge('e11_5', 'merge_data_sources', 'final_merge', undefined, undefined, 'data'),++ // Final results display+ makeEdge('e_final', 'final_merge', 'final_results', undefined, undefined, 'COMPLETE'),+];++// Export as template+export const COMPLETE_WORKFLOW_ALL_82_NODES: WorkflowTemplate = {+ id: 'complete-institutional-trading-system-all-82-nodes',+ name: 'Complete Institutional Trading System - ALL 82 NODES',+ description: 'A comprehensive, production-grade algorithmic trading system demonstrating ALL 82 node types organized in 10 logical phases: (1) Multi-Trigger Entry Points, (2) Market Data + Company Intelligence Acquisition, (3) Data Processing & Transformation with Utilities, (4) Multi-Layered Analytics (Technical/Fundamental/Risk), (5) AI-Powered Multi-Agent Decision Making, (6) Pre-Trade Risk Management & Safety Checks, (7) Intelligent Execution Control Flow, (8) Full Trading Operations Lifecycle, (9) Multi-Channel Monitoring & Alerts, (10) Comprehensive Visualization & Reporting. This workflow represents a real institutional-grade trading pipeline with proper data flow, error handling, and intelligent connections.',+ category: 'advanced',+ tags: [+ 'complete',+ 'all-nodes',+ 'institutional',+ 'algorithmic-trading',+ 'multi-agent-ai',+ 'risk-management',+ 'production-grade',+ 'comprehensive',+ '10-phase-pipeline',+ '82-nodes',+ 'enterprise',+ ],+ nodes: completeWorkflowAllNodesV2,+ edges: completeWorkflowEdgesV2,+};diff --git a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates.ts b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates.tsindex dd3243c84..a7445dff5 100644--- a/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates.ts+++ b/fincept-terminal-desktop/src/components/tabs/ai-quant-lab/workflowTemplates.ts@@ -6,6 +6,7 @@*/import { Node, Edge, MarkerType } from 'reactflow';+import { COMPLETE_WORKFLOW_ALL_82_NODES } from './workflowTemplates-COMPLETE-ALL-82-NODES';export interface WorkflowTemplate {id: string;@@ -715,6 +716,1238 @@ const optimizationEdges: Edge[] = [makeEdge('tpl_op_e3', 'tpl_op_3', 'tpl_op_4'),];+// ─── Template 9: Complete Financial Workflow - ALL NODES ───────────────────+const completeFinancialNodes: Node[] = [+ // ========== TRIGGER NODES (Row 1) ==========+ // 1. ManualTriggerNode+ {+ id: 'complete_trigger_manual',+ type: 'custom',+ position: { x: 50, y: 50 },+ data: {+ label: 'Manual Trigger',+ nodeTypeName: 'manualTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ // 2. ScheduleTriggerNode+ {+ id: 'complete_trigger_schedule',+ type: 'custom',+ position: { x: 250, y: 50 },+ data: {+ label: 'Schedule Trigger',+ nodeTypeName: 'scheduleTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {+ schedule: '0 9 * * 1-5', // Weekdays at 9 AM+ },+ },+ },+ // 3. PriceAlertTriggerNode+ {+ id: 'complete_trigger_price',+ type: 'custom',+ position: { x: 450, y: 50 },+ data: {+ label: 'Price Alert',+ nodeTypeName: 'priceAlertTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ condition: 'above',+ threshold: 180,+ },+ },+ },+ // 4. NewsEventTriggerNode+ {+ id: 'complete_trigger_news',+ type: 'custom',+ position: { x: 650, y: 50 },+ data: {+ label: 'News Event',+ nodeTypeName: 'newsEventTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {+ keywords: ['earnings', 'merger'],+ },+ },+ },+ // 5. MarketEventTriggerNode+ {+ id: 'complete_trigger_market',+ type: 'custom',+ position: { x: 850, y: 50 },+ data: {+ label: 'Market Event',+ nodeTypeName: 'marketEventTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {+ eventType: 'volatilitySpike',+ },+ },+ },+ // 6. WebhookTriggerNode+ {+ id: 'complete_trigger_webhook',+ type: 'custom',+ position: { x: 1050, y: 50 },+ data: {+ label: 'Webhook Trigger',+ nodeTypeName: 'webhookTrigger',+ color: '#a855f7',+ hasInput: false,+ hasOutput: true,+ status: 'idle',+ parameters: {+ path: '/webhook/trading-signal',+ },+ },+ },++ // ========== CONTROL FLOW - MERGE (Row 2) ==========+ // Merge all triggers+ {+ id: 'complete_control_merge1',+ type: 'custom',+ position: { x: 550, y: 200 },+ data: {+ label: 'Merge Triggers',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ mergeMode: 'all',+ },+ },+ },++ // ========== MARKET DATA NODES (Row 3) ==========+ // 7. GetQuoteNode+ {+ id: 'complete_market_quote',+ type: 'custom',+ position: { x: 50, y: 350 },+ data: {+ label: 'Get Quote',+ nodeTypeName: 'getQuote',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ provider: 'yahoo',+ },+ },+ },+ // 8. GetHistoricalDataNode+ {+ id: 'complete_market_historical',+ type: 'custom',+ position: { x: 250, y: 350 },+ data: {+ label: 'Historical Data',+ nodeTypeName: 'getHistoricalData',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbols: 'AAPL,MSFT,GOOGL,AMZN,META',+ interval: '1d',+ period: '1y',+ },+ },+ },+ // 9. GetMarketDepthNode+ {+ id: 'complete_market_depth',+ type: 'custom',+ position: { x: 450, y: 350 },+ data: {+ label: 'Market Depth',+ nodeTypeName: 'getMarketDepth',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ levels: 10,+ },+ },+ },+ // 10. StreamQuotesNode+ {+ id: 'complete_market_stream',+ type: 'custom',+ position: { x: 650, y: 350 },+ data: {+ label: 'Stream Quotes',+ nodeTypeName: 'streamQuotes',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbols: ['AAPL', 'MSFT'],+ },+ },+ },+ // 11. GetFundamentalsNode+ {+ id: 'complete_market_fundamentals',+ type: 'custom',+ position: { x: 850, y: 350 },+ data: {+ label: 'Fundamentals',+ nodeTypeName: 'getFundamentals',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ },+ },+ },+ // 12. GetTickerStatsNode+ {+ id: 'complete_market_stats',+ type: 'custom',+ position: { x: 1050, y: 350 },+ data: {+ label: 'Ticker Stats',+ nodeTypeName: 'getTickerStats',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ },+ },+ },+ // 13. YFinanceNode+ {+ id: 'complete_market_yfinance',+ type: 'custom',+ position: { x: 1250, y: 350 },+ data: {+ label: 'YFinance Data',+ nodeTypeName: 'yfinance',+ color: '#22c55e',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ period: '1y',+ },+ },+ },++ // ========== TRANSFORM NODES (Row 4) ==========+ // 14. FilterNode+ {+ id: 'complete_transform_filter',+ type: 'custom',+ position: { x: 50, y: 550 },+ data: {+ label: 'Filter Data',+ nodeTypeName: 'filter',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ field: 'volume',+ operator: 'greaterThan',+ value: 1000000,+ },+ },+ },+ // 15. MapNode+ {+ id: 'complete_transform_map',+ type: 'custom',+ position: { x: 250, y: 550 },+ data: {+ label: 'Map Transform',+ nodeTypeName: 'map',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ expression: 'item.close * 1.05',+ },+ },+ },+ // 16. AggregateNode+ {+ id: 'complete_transform_aggregate',+ type: 'custom',+ position: { x: 450, y: 550 },+ data: {+ label: 'Aggregate',+ nodeTypeName: 'aggregate',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ operation: 'sum',+ field: 'volume',+ },+ },+ },+ // 17. SortNode+ {+ id: 'complete_transform_sort',+ type: 'custom',+ position: { x: 650, y: 550 },+ data: {+ label: 'Sort Data',+ nodeTypeName: 'sort',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ field: 'volume',+ direction: 'descending',+ },+ },+ },+ // 18. GroupByNode+ {+ id: 'complete_transform_groupby',+ type: 'custom',+ position: { x: 850, y: 550 },+ data: {+ label: 'Group By',+ nodeTypeName: 'groupBy',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ field: 'sector',+ },+ },+ },+ // 19. JoinNode+ {+ id: 'complete_transform_join',+ type: 'custom',+ position: { x: 1050, y: 550 },+ data: {+ label: 'Join Datasets',+ nodeTypeName: 'join',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ joinKey: 'symbol',+ joinType: 'inner',+ },+ },+ },+ // 20. DeduplicateNode+ {+ id: 'complete_transform_dedupe',+ type: 'custom',+ position: { x: 1250, y: 550 },+ data: {+ label: 'Deduplicate',+ nodeTypeName: 'deduplicate',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ uniqueField: 'symbol',+ },+ },+ },+ // 21. ReshapeNode+ {+ id: 'complete_transform_reshape',+ type: 'custom',+ position: { x: 1450, y: 550 },+ data: {+ label: 'Reshape',+ nodeTypeName: 'reshape',+ color: '#ec4899',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ outputFormat: 'array',+ },+ },+ },++ // ========== ANALYTICS NODES (Row 5) ==========+ // 22. TechnicalIndicatorsNode+ {+ id: 'complete_analytics_indicators',+ type: 'technical-indicator',+ position: { x: 50, y: 750 },+ data: {+ label: 'Tech Indicators',+ dataSource: 'yfinance',+ symbol: 'AAPL',+ period: '1y',+ csvPath: '',+ jsonData: '',+ categories: ['momentum', 'trend', 'volatility'],+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ // 23. PortfolioOptimizationNode+ {+ id: 'complete_analytics_portfolio_opt',+ type: 'custom',+ position: { x: 300, y: 750 },+ data: {+ label: 'Portfolio Optimization',+ nodeTypeName: 'portfolioOptimization',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ method: 'max_sharpe',+ riskFreeRate: 0.05,+ },+ },+ },+ // 24. BacktestEngineNode+ {+ id: 'complete_analytics_backtest',+ type: 'backtest',+ position: { x: 550, y: 750 },+ data: {+ label: 'Backtest Engine',+ color: '#06b6d4',+ status: 'idle',+ parameters: {+ strategy: 'MA_Crossover',+ initialCapital: 100000,+ commission: 0.001,+ shortWindow: 20,+ longWindow: 50,+ },+ },+ },+ // 25. RiskAnalysisNode+ {+ id: 'complete_analytics_risk',+ type: 'custom',+ position: { x: 800, y: 750 },+ data: {+ label: 'Risk Analysis',+ nodeTypeName: 'riskAnalysis',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ confidenceLevel: 0.95,+ riskMetrics: ['var', 'cvar', 'maxDrawdown'],+ },+ },+ },+ // 26. PerformanceMetricsNode+ {+ id: 'complete_analytics_performance',+ type: 'custom',+ position: { x: 1050, y: 750 },+ data: {+ label: 'Performance Metrics',+ nodeTypeName: 'performanceMetrics',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ benchmarkSymbol: 'SPY',+ riskFreeRate: 0.05,+ },+ },+ },+ // 27. CorrelationMatrixNode+ {+ id: 'complete_analytics_correlation',+ type: 'custom',+ position: { x: 1300, y: 750 },+ data: {+ label: 'Correlation Matrix',+ nodeTypeName: 'correlationMatrix',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ method: 'pearson',+ },+ },+ },++ // ========== CONTROL FLOW NODES (Row 6) ==========+ // 28. IfElseNode+ {+ id: 'complete_control_ifelse',+ type: 'custom',+ position: { x: 50, y: 950 },+ data: {+ label: 'If-Else Branch',+ nodeTypeName: 'ifElse',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ condition: 'sharpe_ratio > 1.5',+ },+ },+ },+ // 29. SwitchNode+ {+ id: 'complete_control_switch',+ type: 'custom',+ position: { x: 300, y: 950 },+ data: {+ label: 'Switch',+ nodeTypeName: 'switch',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ cases: ['bullish', 'bearish', 'neutral'],+ },+ },+ },+ // 30. LoopNode+ {+ id: 'complete_control_loop',+ type: 'custom',+ position: { x: 550, y: 950 },+ data: {+ label: 'Loop',+ nodeTypeName: 'loop',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ maxIterations: 100,+ },+ },+ },+ // 31. WaitNode+ {+ id: 'complete_control_wait',+ type: 'custom',+ position: { x: 800, y: 950 },+ data: {+ label: 'Wait/Delay',+ nodeTypeName: 'wait',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ duration: 5000, // 5 seconds+ },+ },+ },+ // 32. SplitNode+ {+ id: 'complete_control_split',+ type: 'custom',+ position: { x: 1050, y: 950 },+ data: {+ label: 'Split Data',+ nodeTypeName: 'split',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ splitCount: 3,+ },+ },+ },+ // 33. ErrorHandlerNode+ {+ id: 'complete_control_error',+ type: 'custom',+ position: { x: 1300, y: 950 },+ data: {+ label: 'Error Handler',+ nodeTypeName: 'errorHandler',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ retryCount: 3,+ fallbackBehavior: 'continue',+ },+ },+ },++ // ========== SAFETY NODES (Row 7) ==========+ // 34. RiskCheckNode+ {+ id: 'complete_safety_risk_check',+ type: 'custom',+ position: { x: 50, y: 1150 },+ data: {+ label: 'Risk Check',+ nodeTypeName: 'riskCheck',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ maxRiskPerTrade: 0.02,+ },+ },+ },+ // 35. PositionSizeLimitNode+ {+ id: 'complete_safety_position_size',+ type: 'custom',+ position: { x: 350, y: 1150 },+ data: {+ label: 'Position Size Limit',+ nodeTypeName: 'positionSizeLimit',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ maxPositionSize: 10000,+ },+ },+ },+ // 36. LossLimitNode+ {+ id: 'complete_safety_loss_limit',+ type: 'custom',+ position: { x: 650, y: 1150 },+ data: {+ label: 'Loss Limit',+ nodeTypeName: 'lossLimit',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ maxDailyLoss: 1000,+ },+ },+ },+ // 37. TradingHoursCheckNode+ {+ id: 'complete_safety_trading_hours',+ type: 'custom',+ position: { x: 950, y: 1150 },+ data: {+ label: 'Trading Hours Check',+ nodeTypeName: 'tradingHoursCheck',+ color: '#ef4444',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ marketHours: '09:30-16:00',+ },+ },+ },++ // ========== TRADING NODES (Row 8) ==========+ // 38. PlaceOrderNode+ {+ id: 'complete_trading_place_order',+ type: 'custom',+ position: { x: 50, y: 1350 },+ data: {+ label: 'Place Order',+ nodeTypeName: 'placeOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ side: 'buy',+ quantity: 100,+ orderType: 'limit',+ price: 180,+ },+ },+ },+ // 39. ModifyOrderNode+ {+ id: 'complete_trading_modify_order',+ type: 'custom',+ position: { x: 300, y: 1350 },+ data: {+ label: 'Modify Order',+ nodeTypeName: 'modifyOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ orderId: '12345',+ newPrice: 185,+ },+ },+ },+ // 40. CancelOrderNode+ {+ id: 'complete_trading_cancel_order',+ type: 'custom',+ position: { x: 550, y: 1350 },+ data: {+ label: 'Cancel Order',+ nodeTypeName: 'cancelOrder',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ orderId: '12345',+ },+ },+ },+ // 41. GetPositionsNode+ {+ id: 'complete_trading_get_positions',+ type: 'custom',+ position: { x: 800, y: 1350 },+ data: {+ label: 'Get Positions',+ nodeTypeName: 'getPositions',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ // 42. GetHoldingsNode+ {+ id: 'complete_trading_get_holdings',+ type: 'custom',+ position: { x: 1050, y: 1350 },+ data: {+ label: 'Get Holdings',+ nodeTypeName: 'getHoldings',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ // 43. GetOrdersNode+ {+ id: 'complete_trading_get_orders',+ type: 'custom',+ position: { x: 1300, y: 1350 },+ data: {+ label: 'Get Orders',+ nodeTypeName: 'getOrders',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ // 44. GetBalanceNode+ {+ id: 'complete_trading_get_balance',+ type: 'custom',+ position: { x: 50, y: 1500 },+ data: {+ label: 'Get Balance',+ nodeTypeName: 'getBalance',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ // 45. ClosePositionNode+ {+ id: 'complete_trading_close_position',+ type: 'custom',+ position: { x: 300, y: 1500 },+ data: {+ label: 'Close Position',+ nodeTypeName: 'closePosition',+ color: '#10b981',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ symbol: 'AAPL',+ },+ },+ },++ // ========== AGENT NODES (Row 9) ==========+ // 46. AgentMediatorNode+ {+ id: 'complete_agent_mediator',+ type: 'agent-mediator',+ position: { x: 550, y: 1500 },+ data: {+ label: 'Agent Mediator',+ selectedProvider: undefined,+ customPrompt: 'Synthesize all analysis results',+ status: 'idle',+ result: undefined,+ error: undefined,+ inputData: undefined,+ onExecute: () => {},+ onConfigChange: () => {},+ },+ },+ // 47. PythonAgentNode+ {+ id: 'complete_agent_python',+ type: 'python-agent',+ position: { x: 800, y: 1500 },+ data: {+ agentType: 'portfolio_analysis',+ agentCategory: 'financial',+ label: 'Python Agent',+ icon: 'brain',+ color: '#8b5cf6',+ parameters: {+ analysisType: 'risk',+ timeframe: '1y',+ },+ selectedLLM: 'active',+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ onLLMChange: () => {},+ },+ },+ // 48. GeopoliticsAgentNode+ {+ id: 'complete_agent_geopolitics',+ type: 'custom',+ position: { x: 1050, y: 1500 },+ data: {+ label: 'Geopolitics Agent',+ nodeTypeName: 'geopoliticsAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ region: 'global',+ analysisType: 'risk',+ },+ },+ },+ // 49. HedgeFundAgentNode+ {+ id: 'complete_agent_hedgefund',+ type: 'custom',+ position: { x: 1300, y: 1500 },+ data: {+ label: 'Hedge Fund Agent',+ nodeTypeName: 'hedgeFundAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ strategy: 'long_short_equity',+ },+ },+ },+ // 50. InvestorAgentNode+ {+ id: 'complete_agent_investor',+ type: 'custom',+ position: { x: 550, y: 1650 },+ data: {+ label: 'Investor Agent',+ nodeTypeName: 'investorAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ persona: 'warren_buffett',+ },+ },+ },+ // 51. MultiAgentNode+ {+ id: 'complete_agent_multi',+ type: 'custom',+ position: { x: 800, y: 1650 },+ data: {+ label: 'Multi-Agent',+ nodeTypeName: 'multiAgent',+ color: '#8b5cf6',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ agents: ['analyst', 'trader', 'risk_manager'],+ },+ },+ },++ // ========== NOTIFICATION NODES (Row 10) ==========+ // 52. WebhookNotificationNode+ {+ id: 'complete_notify_webhook',+ type: 'custom',+ position: { x: 50, y: 1800 },+ data: {+ label: 'Webhook Notify',+ nodeTypeName: 'webhookNotification',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ url: 'https://example.com/webhook',+ },+ },+ },+ // 53. EmailNode+ {+ id: 'complete_notify_email',+ type: 'custom',+ position: { x: 300, y: 1800 },+ data: {+ label: 'Email Notify',+ nodeTypeName: 'email',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ to: '[email protected]',+ subject: 'Trading Alert',+ },+ },+ },+ // 54. TelegramNode+ {+ id: 'complete_notify_telegram',+ type: 'custom',+ position: { x: 550, y: 1800 },+ data: {+ label: 'Telegram',+ nodeTypeName: 'telegram',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ chatId: '123456789',+ },+ },+ },+ // 55. DiscordNode+ {+ id: 'complete_notify_discord',+ type: 'custom',+ position: { x: 800, y: 1800 },+ data: {+ label: 'Discord',+ nodeTypeName: 'discord',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ webhookUrl: 'https://discord.com/webhook',+ },+ },+ },+ // 56. SlackNode+ {+ id: 'complete_notify_slack',+ type: 'custom',+ position: { x: 1050, y: 1800 },+ data: {+ label: 'Slack',+ nodeTypeName: 'slack',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ channel: '#trading-alerts',+ },+ },+ },+ // 57. SMSNode+ {+ id: 'complete_notify_sms',+ type: 'custom',+ position: { x: 1300, y: 1800 },+ data: {+ label: 'SMS',+ nodeTypeName: 'sms',+ color: '#06b6d4',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ phoneNumber: '+1234567890',+ },+ },+ },++ // ========== UI/VISUAL NODES (Row 11) ==========+ // 58. DataSourceNode+ {+ id: 'complete_ui_datasource',+ type: 'data-source',+ position: { x: 50, y: 2000 },+ data: {+ label: 'Data Source',+ dataSource: 'yfinance',+ symbol: 'AAPL',+ period: '1y',+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ // 59. MCPToolNode+ {+ id: 'complete_ui_mcp',+ type: 'mcp-tool',+ position: { x: 300, y: 2000 },+ data: {+ label: 'MCP Tool',+ serverName: 'financial-api',+ toolName: 'fetch_market_data',+ parameters: {},+ status: 'idle',+ result: undefined,+ error: undefined,+ onExecute: () => {},+ onParameterChange: () => {},+ },+ },+ // 60. OptimizationNode+ {+ id: 'complete_ui_optimization',+ type: 'optimization',+ position: { x: 550, y: 2000 },+ data: {+ label: 'Optimization',+ color: '#a855f7',+ status: 'idle',+ parameters: {+ method: 'bayesian',+ objective: 'sharpe_ratio',+ },+ },+ },+ // 61. SystemNode+ {+ id: 'complete_ui_system',+ type: 'custom',+ position: { x: 800, y: 2000 },+ data: {+ label: 'System Node',+ nodeTypeName: 'system',+ color: '#64748b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {+ action: 'log',+ },+ },+ },+ // 62. ResultsDisplayNode+ {+ id: 'complete_ui_results',+ type: 'results-display',+ position: { x: 1050, y: 2000 },+ data: {+ label: 'Results Display',+ color: '#f59e0b',+ inputData: undefined,+ },+ },++ // ========== FINAL MERGE & DISPLAY (Row 12) ==========+ {+ id: 'complete_final_merge',+ type: 'custom',+ position: { x: 550, y: 2200 },+ data: {+ label: 'Final Merge',+ nodeTypeName: 'merge',+ color: '#f59e0b',+ hasInput: true,+ hasOutput: true,+ status: 'idle',+ parameters: {},+ },+ },+ {+ id: 'complete_final_results',+ type: 'results-display',+ position: { x: 550, y: 2400 },+ data: {+ label: 'Complete Workflow Results',+ color: '#10b981',+ inputData: undefined,+ },+ },+];++const completeFinancialEdges: Edge[] = [+ // Connect all triggers to first merge+ makeEdge('e_trig_1', 'complete_trigger_manual', 'complete_control_merge1'),+ makeEdge('e_trig_2', 'complete_trigger_schedule', 'complete_control_merge1'),+ makeEdge('e_trig_3', 'complete_trigger_price', 'complete_control_merge1'),+ makeEdge('e_trig_4', 'complete_trigger_news', 'complete_control_merge1'),+ makeEdge('e_trig_5', 'complete_trigger_market', 'complete_control_merge1'),+ makeEdge('e_trig_6', 'complete_trigger_webhook', 'complete_control_merge1'),++ // Connect merge to market data nodes+ makeEdge('e_md_1', 'complete_control_merge1', 'complete_market_quote'),+ makeEdge('e_md_2', 'complete_control_merge1', 'complete_market_historical'),+ makeEdge('e_md_3', 'complete_control_merge1', 'complete_market_depth'),+ makeEdge('e_md_4', 'complete_control_merge1', 'complete_market_stream'),+ makeEdge('e_md_5', 'complete_control_merge1', 'complete_market_fundamentals'),+ makeEdge('e_md_6', 'complete_control_merge1', 'complete_market_stats'),+ makeEdge('e_md_7', 'complete_control_merge1', 'complete_market_yfinance'),++ // Connect market data to transform nodes+ makeEdge('e_tf_1', 'complete_market_historical', 'complete_transform_filter'),+ makeEdge('e_tf_2', 'complete_market_historical', 'complete_transform_map'),+ makeEdge('e_tf_3', 'complete_transform_filter', 'complete_transform_aggregate'),+ makeEdge('e_tf_4', 'complete_transform_map', 'complete_transform_sort'),+ makeEdge('e_tf_5', 'complete_transform_aggregate', 'complete_transform_groupby'),+ makeEdge('e_tf_6', 'complete_transform_sort', 'complete_transform_join'),+ makeEdge('e_tf_7', 'complete_transform_groupby', 'complete_transform_dedupe'),+ makeEdge('e_tf_8', 'complete_transform_join', 'complete_transform_reshape'),++ // Connect transform to analytics nodes+ makeEdge('e_an_1', 'complete_transform_reshape', 'complete_analytics_indicators'),+ makeEdge('e_an_2', 'complete_transform_reshape', 'complete_analytics_portfolio_opt'),+ makeEdge('e_an_3', 'complete_analytics_indicators', 'complete_analytics_backtest'),+ makeEdge('e_an_4', 'complete_analytics_portfolio_opt', 'complete_analytics_risk'),+ makeEdge('e_an_5', 'complete_analytics_backtest', 'complete_analytics_performance'),+ makeEdge('e_an_6', 'complete_analytics_risk', 'complete_analytics_correlation'),++ // Connect analytics to control flow+ makeEdge('e_cf_1', 'complete_analytics_correlation', 'complete_control_ifelse'),+ makeEdge('e_cf_2', 'complete_control_ifelse', 'complete_control_switch'),+ makeEdge('e_cf_3', 'complete_control_switch', 'complete_control_loop'),+ makeEdge('e_cf_4', 'complete_control_loop', 'complete_control_wait'),+ makeEdge('e_cf_5', 'complete_control_wait', 'complete_control_split'),+ makeEdge('e_cf_6', 'complete_control_split', 'complete_control_error'),++ // Connect control flow to safety nodes+ makeEdge('e_sf_1', 'complete_control_error', 'complete_safety_risk_check'),+ makeEdge('e_sf_2', 'complete_safety_risk_check', 'complete_safety_position_size'),+ makeEdge('e_sf_3', 'complete_safety_position_size', 'complete_safety_loss_limit'),+ makeEdge('e_sf_4', 'complete_safety_loss_limit', 'complete_safety_trading_hours'),++ // Connect safety to trading nodes+ makeEdge('e_tr_1', 'complete_safety_trading_hours', 'complete_trading_place_order'),+ makeEdge('e_tr_2', 'complete_trading_place_order', 'complete_trading_modify_order'),+ makeEdge('e_tr_3', 'complete_trading_modify_order', 'complete_trading_cancel_order'),+ makeEdge('e_tr_4', 'complete_trading_cancel_order', 'complete_trading_get_positions'),+ makeEdge('e_tr_5', 'complete_trading_get_positions', 'complete_trading_get_holdings'),+ makeEdge('e_tr_6', 'complete_trading_get_holdings', 'complete_trading_get_orders'),+ makeEdge('e_tr_7', 'complete_trading_get_orders', 'complete_trading_get_balance'),+ makeEdge('e_tr_8', 'complete_trading_get_balance', 'complete_trading_close_position'),++ // Connect trading to agent nodes+ makeEdge('e_ag_1', 'complete_trading_close_position', 'complete_agent_mediator'),+ makeEdge('e_ag_2', 'complete_agent_mediator', 'complete_agent_python'),+ makeEdge('e_ag_3', 'complete_agent_python', 'complete_agent_geopolitics'),+ makeEdge('e_ag_4', 'complete_agent_geopolitics', 'complete_agent_hedgefund'),+ makeEdge('e_ag_5', 'complete_agent_hedgefund', 'complete_agent_investor'),+ makeEdge('e_ag_6', 'complete_agent_investor', 'complete_agent_multi'),++ // Connect agents to notifications+ makeEdge('e_nt_1', 'complete_agent_multi', 'complete_notify_webhook'),+ makeEdge('e_nt_2', 'complete_notify_webhook', 'complete_notify_email'),+ makeEdge('e_nt_3', 'complete_notify_email', 'complete_notify_telegram'),+ makeEdge('e_nt_4', 'complete_notify_telegram', 'complete_notify_discord'),+ makeEdge('e_nt_5', 'complete_notify_discord', 'complete_notify_slack'),+ makeEdge('e_nt_6', 'complete_notify_slack', 'complete_notify_sms'),++ // Connect notifications to UI nodes+ makeEdge('e_ui_1', 'complete_notify_sms', 'complete_ui_datasource'),+ makeEdge('e_ui_2', 'complete_ui_datasource', 'complete_ui_mcp'),+ makeEdge('e_ui_3', 'complete_ui_mcp', 'complete_ui_optimization'),+ makeEdge('e_ui_4', 'complete_ui_optimization', 'complete_ui_system'),+ makeEdge('e_ui_5', 'complete_ui_system', 'complete_ui_results'),++ // Connect UI results to final merge+ makeEdge('e_final_1', 'complete_ui_results', 'complete_final_merge'),+ // Also merge in some earlier results+ makeEdge('e_final_2', 'complete_market_quote', 'complete_final_merge'),+ makeEdge('e_final_3', 'complete_analytics_performance', 'complete_final_merge'),+ makeEdge('e_final_4', 'complete_trading_get_balance', 'complete_final_merge'),++ // Final display+ makeEdge('e_final_display', 'complete_final_merge', 'complete_final_results'),+];+// ─── Export All Templates ───────────────────────────────────────────────────export const WORKFLOW_TEMPLATES: WorkflowTemplate[] = [{@@ -789,4 +2022,15 @@ export const WORKFLOW_TEMPLATES: WorkflowTemplate[] = [nodes: optimizationNodes,edges: optimizationEdges,},+ {+ id: 'complete-financial-workflow',+ name: 'Complete Financial Workflow - ALL NODES',+ description: 'ULTIMATE DEMO: A comprehensive workflow showcasing ALL 60+ node types in the platform. Includes triggers, market data, transforms, analytics, control flow, safety checks, trading execution, AI agents, notifications, and results display. This template demonstrates the full power of the workflow system and serves as a complete reference for all available nodes.',+ category: 'advanced',+ tags: ['complete', 'all-nodes', 'comprehensive', 'showcase', 'demo', 'reference', 'enterprise'],+ nodes: completeFinancialNodes,+ edges: completeFinancialEdges,+ },+ // NEW: Comprehensive 82-node institutional trading system+ COMPLETE_WORKFLOW_ALL_82_NODES,];diff --git a/fincept-terminal-desktop/src/components/tabs/akshare-data/AkShareDataTab.tsx b/fincept-terminal-desktop/src/components/tabs/akshare-data/AkShareDataTab.tsxindex 880e484f3..3a6ba2c58 100644--- a/fincept-terminal-desktop/src/components/tabs/akshare-data/AkShareDataTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/akshare-data/AkShareDataTab.tsx@@ -1,13 +1,16 @@/*** AKShare Data Explorer Tab*- * Comprehensive interface for exploring AKShare data sources including:- * - Bonds (Chinese & International)- * - Derivatives (Options, Futures)- * - China Economics (GDP, CPI, PMI, etc.)- * - Global Economics (US, EU, UK, Japan, etc.)- * - Funds (ETFs, Mutual Funds)- * - Alternative Data (Air Quality, Carbon, Real Estate, etc.)+ * Comprehensive interface for exploring 26 AKShare data sources with 1000+ endpoints:+ * - Bonds (Chinese & International) - 28 endpoints+ * - Derivatives (Options, Futures) - 46 endpoints+ * - China Economics (GDP, CPI, PMI, etc.) - 85 endpoints+ * - Global Economics (US, EU, UK, Japan, etc.) - 35 endpoints+ * - Funds (ETFs, Mutual Funds) - 70+ endpoints+ * - Stocks (Realtime, Historical, Financial) - 150+ endpoints+ * - Alternative Data (Air Quality, Carbon, Real Estate, etc.) - 14 endpoints+ * - Macro Global (96 endpoints) - Multi-country economic indicators+ * - Miscellaneous (129 endpoints) - AMAC, FRED, Car Sales, Movies, etc.*/import React, { useState, useEffect, useCallback, useMemo } from 'react';@@ -137,6 +140,15 @@ const AkShareDataTab: React.FC = () => {const [showHistory, setShowHistory] = useState(false);const [showFavorites, setShowFavorites] = useState(false);+ // Query Parameters+ const [symbol, setSymbol] = useState('000001');+ const [startDate, setStartDate] = useState('');+ const [endDate, setEndDate] = useState('');+ const [period, setPeriod] = useState('daily');+ const [market, setMarket] = useState('sh');+ const [adjust, setAdjust] = useState('');+ const [showParameters, setShowParameters] = useState(false);+// Debug: Log language on mount and changesuseEffect(() => {console.log('AkShare Tab - Current Language:', currentLanguage);@@ -207,6 +219,48 @@ const AkShareDataTab: React.FC = () => {}}, []);+ // Helper function to build parameters based on endpoint name+ const buildParametersForEndpoint = (endpoint: string): string[] | undefined => {+ const params: string[] = [];++ // Detect if endpoint needs symbol/stock parameter+ const needsSymbol = endpoint.includes('stock') || endpoint.includes('holder') ||+ endpoint.includes('fund') || endpoint.includes('esg') ||+ endpoint.includes('comment') || endpoint.includes('individual');++ // Detect if endpoint needs date parameters+ const needsDates = endpoint.includes('hist') || endpoint.includes('historical');++ // Detect if endpoint needs period parameter+ const needsPeriod = endpoint.includes('hist') && !endpoint.includes('min');++ // Detect if endpoint needs market parameter+ const needsMarket = endpoint.includes('individual_fund_flow');++ if (needsSymbol && symbol) {+ params.push(symbol);+ }++ if (needsPeriod && period) {+ params.push(period);+ }++ if (needsDates) {+ if (startDate) params.push(startDate);+ if (endDate) params.push(endDate);+ }++ if (adjust) {+ params.push(adjust);+ }++ if (needsMarket && market) {+ params.push(market);+ }++ return params.length > 0 ? params : undefined;+ };+const loadEndpoints = async (script: string) => {setLoadingEndpoints(true);setEndpoints([]);@@ -218,7 +272,7 @@ const AkShareDataTab: React.FC = () => {if (response.success && response.data) {// Don't use the parser for endpoints - they have a special structure// Handle nested data structure from Python directly- let endpointData = response.data;+ let endpointData = response.data as any;// Handle nested data.data structure (common from Python)if (endpointData.data && typeof endpointData.data === 'object') {@@ -309,7 +363,7 @@ const AkShareDataTab: React.FC = () => {}};- const executeQuery = async (script: string, endpoint: string) => {+ const executeQuery = async (script: string, endpoint: string, customParams?: string[]) => {setLoading(true);setError(null);setData(null);@@ -321,7 +375,9 @@ const AkShareDataTab: React.FC = () => {setTranslatedPages(new Map());try {- const response = await AKShareAPI.query(script, endpoint);+ // Build parameters array if provided+ const params = customParams || buildParametersForEndpoint(endpoint);+ const response = await AKShareAPI.query(script, endpoint, params);console.log('Raw AKShare response:', response);@@ -687,7 +743,8 @@ const AkShareDataTab: React.FC = () => {textAlign: 'left',backgroundColor: isSelected ? `${FINCEPT.ORANGE}15` : 'transparent',borderLeft: isSelected ? `2px solid ${FINCEPT.ORANGE}` : '2px solid transparent',- border: 'none',+ borderTop: 'none',+ borderRight: 'none',borderBottom: `1px solid ${FINCEPT.BORDER}`,cursor: 'pointer',transition: 'all 0.2s',@@ -883,7 +940,9 @@ const AkShareDataTab: React.FC = () => {backgroundColor: isActive ? `${FINCEPT.ORANGE}15` : 'transparent',borderLeft: isActive ? `2px solid ${FINCEPT.ORANGE}` : '2px solid transparent',color: isActive ? FINCEPT.CYAN : FINCEPT.WHITE,- border: 'none',+ borderTop: 'none',+ borderRight: 'none',+ borderBottom: 'none',borderRadius: '2px',cursor: 'pointer',transition: 'all 0.2s',@@ -936,7 +995,9 @@ const AkShareDataTab: React.FC = () => {backgroundColor: isActive ? `${FINCEPT.ORANGE}15` : 'transparent',borderLeft: isActive ? `2px solid ${FINCEPT.ORANGE}` : '2px solid transparent',color: isActive ? FINCEPT.CYAN : FINCEPT.WHITE,- border: 'none',+ borderTop: 'none',+ borderRight: 'none',+ borderBottom: 'none',borderRadius: '2px',cursor: 'pointer',transition: 'all 0.2s',@@ -1159,6 +1220,30 @@ const AkShareDataTab: React.FC = () => {</>)}+ {/* Parameters Toggle Button */}+ {selectedEndpoint && selectedSource && (+ <button+ onClick={() => setShowParameters(!showParameters)}+ style={{+ padding: '6px 12px',+ borderRadius: '2px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ backgroundColor: showParameters ? FINCEPT.PURPLE : 'transparent',+ color: showParameters ? FINCEPT.WHITE : FINCEPT.MUTED,+ border: `1px solid ${showParameters ? FINCEPT.PURPLE : FINCEPT.BORDER}`,+ fontSize: '9px',+ fontWeight: 700,+ cursor: 'pointer',+ }}+ title="Toggle Parameters"+ >+ <Filter size={12} />+ PARAMS+ </button>+ )}+{selectedEndpoint && selectedSource && (<buttononClick={() => executeQuery(selectedSource.script, selectedEndpoint)}@@ -1185,6 +1270,174 @@ const AkShareDataTab: React.FC = () => {</div></div>+ {/* Parameters Panel */}+ {showParameters && selectedEndpoint && (+ <div style={{+ backgroundColor: FINCEPT.PANEL_BG,+ borderTop: `1px solid ${FINCEPT.BORDER}`,+ borderBottom: `1px solid ${FINCEPT.BORDER}`,+ padding: '16px',+ }}>+ <div style={{ fontSize: '9px', fontWeight: 700, color: FINCEPT.ORANGE, marginBottom: '12px', letterSpacing: '0.5px' }}>+ QUERY PARAMETERS+ </div>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(180px, 1fr))', gap: '12px' }}>+ {/* Symbol/Stock Input */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ SYMBOL / STOCK+ </label>+ <input+ type="text"+ value={symbol}+ onChange={(e) => setSymbol(e.target.value)}+ placeholder="e.g., 000001, 600000"+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ }}+ />+ </div>++ {/* Period Selector */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ PERIOD+ </label>+ <select+ value={period}+ onChange={(e) => setPeriod(e.target.value)}+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ cursor: 'pointer',+ }}+ >+ <option value="daily">Daily</option>+ <option value="weekly">Weekly</option>+ <option value="monthly">Monthly</option>+ </select>+ </div>++ {/* Market Selector */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ MARKET+ </label>+ <select+ value={market}+ onChange={(e) => setMarket(e.target.value)}+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ cursor: 'pointer',+ }}+ >+ <option value="sh">Shanghai (sh)</option>+ <option value="sz">Shenzhen (sz)</option>+ </select>+ </div>++ {/* Adjust Type */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ ADJUST+ </label>+ <select+ value={adjust}+ onChange={(e) => setAdjust(e.target.value)}+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ cursor: 'pointer',+ }}+ >+ <option value="">No Adjustment</option>+ <option value="qfq">Forward (qfq)</option>+ <option value="hfq">Backward (hfq)</option>+ </select>+ </div>++ {/* Start Date */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ START DATE+ </label>+ <input+ type="date"+ value={startDate}+ onChange={(e) => setStartDate(e.target.value)}+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ }}+ />+ </div>++ {/* End Date */}+ <div>+ <label style={{ display: 'block', fontSize: '9px', color: FINCEPT.MUTED, marginBottom: '6px', fontWeight: 600 }}>+ END DATE+ </label>+ <input+ type="date"+ value={endDate}+ onChange={(e) => setEndDate(e.target.value)}+ style={{+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT.DARK_BG,+ border: `1px solid ${FINCEPT.BORDER}`,+ borderRadius: '2px',+ color: FINCEPT.WHITE,+ fontSize: '10px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ }}+ />+ </div>+ </div>+ <div style={{ marginTop: '12px', fontSize: '9px', color: FINCEPT.MUTED, fontStyle: 'italic' }}>+ ℹ️ Parameters are automatically selected based on endpoint. Not all parameters are used for every query.+ </div>+ </div>+ )}+{/* Data Content */}<div className="akshare-scrollbar" style={{ flex: 1, overflowX: 'auto', overflowY: 'auto', padding: '16px' }}>{loading || translating ? (@@ -1513,7 +1766,7 @@ const AkShareDataTab: React.FC = () => {AKSHARE DATA EXPLORER</div><div style={{ fontSize: '10px', marginBottom: '24px', color: FINCEPT.MUTED }}>- Access 400+ financial data endpoints covering bonds, derivatives, economics, funds, and alternative data from Chinese and global markets.+ Access 1000+ financial data endpoints across 26 data sources covering bonds, derivatives, economics, stocks, funds, and alternative data from Chinese and global markets.</div><div style={{display: 'grid',diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/PortfolioTab.tsx b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/PortfolioTab.tsxindex df3c6634d..4c3c17ad5 100644--- a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/PortfolioTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/PortfolioTab.tsx@@ -7,7 +7,8 @@ import React, { useState, useEffect } from 'react';import {Briefcase, TrendingUp, TrendingDown, DollarSign, BarChart3,RefreshCw, Plus, Download, Trash2, PieChart, Activity,- Clock, AlertCircle, Target, RotateCcw, ArrowUpRight, ArrowDownRight, Info+ Clock, AlertCircle, Target, RotateCcw, ArrowUpRight, ArrowDownRight, Info,+ Layers} from 'lucide-react';import { createPortfolioTabTour } from '../tours/portfolioTabTour';import PositionsView from './portfolio/PositionsView';@@ -20,6 +21,7 @@ import ReportsView from './portfolio/ReportsView';import AlertsView from './portfolio/AlertsView';import ActiveManagementView from './portfolio/ActiveManagementView';import PortfolioOptimizationView from './portfolio/PortfolioOptimizationView';+import { CustomIndexView, CreateIndexModal } from './custom-index';import CreatePortfolioModal from './modals/CreatePortfolioModal';import AddAssetModal from './modals/AddAssetModal';import SellAssetModal from './modals/SellAssetModal';@@ -29,7 +31,7 @@ import { formatCurrency, formatPercent } from './portfolio/utils';import { TabFooter } from '@/components/common/TabFooter';import { FINCEPT, TYPOGRAPHY, SPACING, BORDERS, EFFECTS, COMMON_STYLES, LAYOUT } from './finceptStyles';-type SubTab = 'positions' | 'history' | 'analytics' | 'sectors' | 'performance' | 'risk' | 'reports' | 'alerts' | 'active-mgmt' | 'optimization';+type SubTab = 'positions' | 'history' | 'analytics' | 'sectors' | 'performance' | 'risk' | 'reports' | 'alerts' | 'active-mgmt' | 'optimization' | 'indices';const PortfolioTab: React.FC = () => {const [currentTime, setCurrentTime] = useState(new Date());@@ -41,6 +43,8 @@ const PortfolioTab: React.FC = () => {const [showSellAsset, setShowSellAsset] = useState(false);const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);const [portfolioToDelete, setPortfolioToDelete] = useState<string | null>(null);+ const [showCreateIndex, setShowCreateIndex] = useState(false);+ const [indexRefreshKey, setIndexRefreshKey] = useState(0);// Form statesconst [newPortfolioName, setNewPortfolioName] = useState('');@@ -149,6 +153,7 @@ const PortfolioTab: React.FC = () => {const subTabs = [{ id: 'positions' as SubTab, label: 'POSITIONS', icon: Briefcase },{ id: 'history' as SubTab, label: 'HISTORY', icon: Clock },+ { id: 'indices' as SubTab, label: 'INDICES', icon: Layers },{ id: 'analytics' as SubTab, label: 'ANALYTICS', icon: BarChart3 },{ id: 'sectors' as SubTab, label: 'SECTORS', icon: PieChart },{ id: 'performance' as SubTab, label: 'PERFORMANCE', icon: TrendingUp },@@ -547,6 +552,15 @@ const PortfolioTab: React.FC = () => {/></div>)}+ {activeSubTab === 'indices' && (+ <div id="indices-view" style={{ height: '100%', padding: SPACING.DEFAULT }}>+ <CustomIndexView+ key={indexRefreshKey}+ portfolioId={selectedPortfolio?.id}+ onCreateIndex={() => setShowCreateIndex(true)}+ />+ </div>+ )}</div>)}</div>@@ -834,6 +848,16 @@ const PortfolioTab: React.FC = () => {}}onConfirm={confirmDeletePortfolio}/>++ <CreateIndexModal+ isOpen={showCreateIndex}+ onClose={() => setShowCreateIndex(false)}+ onCreated={() => {+ setShowCreateIndex(false);+ setIndexRefreshKey(prev => prev + 1);+ }}+ portfolioSummary={portfolioSummary}+ /></div>);};diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CreateIndexModal.tsx b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CreateIndexModal.tsxnew file mode 100644index 000000000..7b821b2a8--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CreateIndexModal.tsx@@ -0,0 +1,750 @@+/**+ * CreateIndexModal - Create/Edit Custom Index Modal+ * Allows users to create a new index or edit existing one+ */++import React, { useState, useEffect } from 'react';+import {+ X,+ Plus,+ Trash2,+ Info,+ Search,+ Check,+ AlertCircle,+} from 'lucide-react';+import {+ FINCEPT,+ TYPOGRAPHY,+ SPACING,+ BORDERS,+ COMMON_STYLES,+ EFFECTS,+ createFocusHandlers,+} from '../finceptStyles';+import {+ IndexCalculationMethod,+ IndexConstituentConfig,+ IndexFormState,+ INDEX_METHOD_INFO,+ DEFAULT_INDEX_FORM,+} from './types';+import { customIndexService } from '../../../../services/portfolio/customIndexService';+import { PortfolioSummary, HoldingWithQuote } from '../../../../services/portfolio/portfolioService';++interface CreateIndexModalProps {+ isOpen: boolean;+ onClose: () => void;+ onCreated: () => void;+ portfolioSummary?: PortfolioSummary | null;+ preSelectedSymbols?: string[];+}++const CreateIndexModal: React.FC<CreateIndexModalProps> = ({+ isOpen,+ onClose,+ onCreated,+ portfolioSummary,+ preSelectedSymbols = [],+}) => {+ const [form, setForm] = useState<IndexFormState>({+ ...DEFAULT_INDEX_FORM,+ constituents: [],+ });+ const [symbolInput, setSymbolInput] = useState('');+ const [selectedMethod, setSelectedMethod] = useState<IndexCalculationMethod>('equal_weighted');+ const [showMethodHelp, setShowMethodHelp] = useState(false);+ const [creating, setCreating] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [usePortfolioStocks, setUsePortfolioStocks] = useState(false);+ const [selectedPortfolioStocks, setSelectedPortfolioStocks] = useState<Set<string>>(new Set());++ // Initialize with pre-selected symbols+ useEffect(() => {+ if (isOpen && preSelectedSymbols.length > 0) {+ const constituents = preSelectedSymbols.map(symbol => ({+ symbol: symbol.toUpperCase(),+ shares: 1,+ weight: undefined,+ }));+ setForm(prev => ({ ...prev, constituents }));+ }+ }, [isOpen, preSelectedSymbols]);++ // Initialize portfolio stock selection+ useEffect(() => {+ if (portfolioSummary?.holdings) {+ const stockSet = new Set(+ preSelectedSymbols.length > 0+ ? preSelectedSymbols.map(s => s.toUpperCase())+ : portfolioSummary.holdings.map(h => h.symbol)+ );+ setSelectedPortfolioStocks(stockSet);+ }+ }, [portfolioSummary, preSelectedSymbols]);++ if (!isOpen) return null;++ const focusHandlers = createFocusHandlers();++ const handleMethodChange = (method: IndexCalculationMethod) => {+ setSelectedMethod(method);+ setForm(prev => ({ ...prev, calculation_method: method }));+ };++ const handleAddSymbol = () => {+ const symbol = symbolInput.trim().toUpperCase();+ if (!symbol) return;++ // Check if already exists+ if (form.constituents.some(c => c.symbol === symbol)) {+ setError(`${symbol} is already in the list`);+ return;+ }++ setForm(prev => ({+ ...prev,+ constituents: [+ ...prev.constituents,+ { symbol, shares: 1, weight: undefined },+ ],+ }));+ setSymbolInput('');+ setError(null);+ };++ const handleRemoveSymbol = (symbol: string) => {+ setForm(prev => ({+ ...prev,+ constituents: prev.constituents.filter(c => c.symbol !== symbol),+ }));+ };++ const handleConstituentChange = (+ symbol: string,+ field: 'shares' | 'weight',+ value: number+ ) => {+ setForm(prev => ({+ ...prev,+ constituents: prev.constituents.map(c =>+ c.symbol === symbol ? { ...c, [field]: value } : c+ ),+ }));+ };++ const togglePortfolioStock = (symbol: string) => {+ setSelectedPortfolioStocks(prev => {+ const newSet = new Set(prev);+ if (newSet.has(symbol)) {+ newSet.delete(symbol);+ } else {+ newSet.add(symbol);+ }+ return newSet;+ });+ };++ const handleUsePortfolioStocks = () => {+ if (!portfolioSummary?.holdings) return;++ const selectedHoldings = portfolioSummary.holdings.filter(h =>+ selectedPortfolioStocks.has(h.symbol)+ );++ const constituents = selectedHoldings.map(h => ({+ symbol: h.symbol,+ shares: h.quantity,+ weight: undefined,+ }));++ setForm(prev => ({ ...prev, constituents }));+ setUsePortfolioStocks(false);+ };++ const handleCreate = async () => {+ // Validation+ if (!form.name.trim()) {+ setError('Index name is required');+ return;+ }+ if (form.constituents.length === 0) {+ setError('At least one constituent is required');+ return;+ }++ setCreating(true);+ setError(null);++ try {+ // Create the index+ const index = await customIndexService.createIndex(+ form.name,+ form.description || undefined,+ form.calculation_method,+ form.base_value,+ form.cap_weight > 0 ? form.cap_weight : undefined,+ form.currency,+ portfolioSummary?.portfolio.id+ );++ // Add constituents+ for (const constituent of form.constituents) {+ await customIndexService.addConstituent(index.id, constituent);+ }++ // Calculate initial values+ await customIndexService.calculateIndexSummary(index.id);++ onCreated();+ onClose();+ } catch (err: any) {+ setError(err.message || 'Failed to create index');+ } finally {+ setCreating(false);+ }+ };++ // Render method selector+ const renderMethodSelector = () => {+ const allMethods = customIndexService.getAllMethods();++ return (+ <div style={{ marginBottom: SPACING.LARGE }}>+ <div+ style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.SMALL,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ }}+ >+ <span>CALCULATION METHOD</span>+ <button+ type="button"+ onClick={() => setShowMethodHelp(!showMethodHelp)}+ style={{+ background: 'none',+ border: 'none',+ color: FINCEPT.CYAN,+ cursor: 'pointer',+ padding: 0,+ }}+ >+ <Info size={12} />+ </button>+ </div>++ <div+ style={{+ display: 'grid',+ gridTemplateColumns: 'repeat(2, 1fr)',+ gap: SPACING.SMALL,+ }}+ >+ {allMethods.map(({ method, info }) => (+ <button+ key={method}+ type="button"+ onClick={() => handleMethodChange(method)}+ style={{+ padding: SPACING.SMALL,+ backgroundColor:+ selectedMethod === method ? `${FINCEPT.ORANGE}20` : FINCEPT.DARK_BG,+ border:+ selectedMethod === method+ ? `1px solid ${FINCEPT.ORANGE}`+ : BORDERS.STANDARD,+ borderRadius: '2px',+ cursor: 'pointer',+ textAlign: 'left',+ transition: EFFECTS.TRANSITION_FAST,+ }}+ >+ <div+ style={{+ color: selectedMethod === method ? FINCEPT.ORANGE : FINCEPT.WHITE,+ fontSize: TYPOGRAPHY.TINY,+ fontWeight: TYPOGRAPHY.BOLD,+ marginBottom: '2px',+ }}+ >+ {info.name}+ </div>+ <div+ style={{+ color: FINCEPT.GRAY,+ fontSize: '8px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ >+ <span+ style={{+ padding: '1px 4px',+ backgroundColor:+ info.complexity === 'simple'+ ? `${FINCEPT.GREEN}20`+ : info.complexity === 'moderate'+ ? `${FINCEPT.YELLOW}20`+ : `${FINCEPT.RED}20`,+ color:+ info.complexity === 'simple'+ ? FINCEPT.GREEN+ : info.complexity === 'moderate'+ ? FINCEPT.YELLOW+ : FINCEPT.RED,+ borderRadius: '2px',+ textTransform: 'uppercase',+ }}+ >+ {info.complexity}+ </span>+ </div>+ </button>+ ))}+ </div>++ {/* Method help */}+ {showMethodHelp && selectedMethod && (+ <div+ style={{+ marginTop: SPACING.SMALL,+ padding: SPACING.DEFAULT,+ backgroundColor: FINCEPT.DARK_BG,+ borderRadius: '2px',+ border: `1px solid ${FINCEPT.CYAN}40`,+ }}+ >+ <div style={{ color: FINCEPT.WHITE, fontSize: TYPOGRAPHY.SMALL, marginBottom: SPACING.TINY }}>+ {INDEX_METHOD_INFO[selectedMethod].description}+ </div>+ <div style={{ color: FINCEPT.CYAN, fontSize: TYPOGRAPHY.TINY, fontFamily: TYPOGRAPHY.MONO }}>+ {INDEX_METHOD_INFO[selectedMethod].formula}+ </div>+ </div>+ )}+ </div>+ );+ };++ // Render portfolio stock selector+ const renderPortfolioStockSelector = () => {+ if (!portfolioSummary?.holdings || portfolioSummary.holdings.length === 0) {+ return null;+ }++ return (+ <div style={{ marginBottom: SPACING.LARGE }}>+ <button+ type="button"+ onClick={() => setUsePortfolioStocks(!usePortfolioStocks)}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ width: '100%',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: SPACING.SMALL,+ }}+ >+ <Plus size={12} />+ USE STOCKS FROM PORTFOLIO+ </button>++ {usePortfolioStocks && (+ <div+ style={{+ marginTop: SPACING.SMALL,+ padding: SPACING.DEFAULT,+ backgroundColor: FINCEPT.DARK_BG,+ borderRadius: '2px',+ border: BORDERS.STANDARD,+ maxHeight: '200px',+ overflowY: 'auto',+ }}+ >+ {portfolioSummary.holdings.map(holding => (+ <div+ key={holding.symbol}+ onClick={() => togglePortfolioStock(holding.symbol)}+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: SPACING.SMALL,+ cursor: 'pointer',+ backgroundColor: selectedPortfolioStocks.has(holding.symbol)+ ? `${FINCEPT.GREEN}20`+ : 'transparent',+ borderRadius: '2px',+ marginBottom: '2px',+ }}+ >+ <div>+ <span style={{ color: FINCEPT.WHITE, fontWeight: TYPOGRAPHY.BOLD }}>+ {holding.symbol}+ </span>+ <span style={{ color: FINCEPT.GRAY, marginLeft: SPACING.SMALL, fontSize: TYPOGRAPHY.TINY }}>+ {holding.quantity} shares+ </span>+ </div>+ {selectedPortfolioStocks.has(holding.symbol) && (+ <Check size={14} style={{ color: FINCEPT.GREEN }} />+ )}+ </div>+ ))}++ <button+ type="button"+ onClick={handleUsePortfolioStocks}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ width: '100%',+ marginTop: SPACING.SMALL,+ }}+ >+ ADD SELECTED ({selectedPortfolioStocks.size})+ </button>+ </div>+ )}+ </div>+ );+ };++ return (+ <div style={COMMON_STYLES.modalOverlay} onClick={onClose}>+ <div+ style={{+ ...COMMON_STYLES.modalPanel,+ width: '600px',+ maxHeight: '90vh',+ overflowY: 'auto',+ }}+ onClick={e => e.stopPropagation()}+ >+ {/* Header */}+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ marginBottom: SPACING.LARGE,+ }}+ >+ <h2+ style={{+ color: FINCEPT.ORANGE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ margin: 0,+ }}+ >+ CREATE CUSTOM INDEX+ </h2>+ <button+ onClick={onClose}+ style={{+ background: 'none',+ border: 'none',+ color: FINCEPT.GRAY,+ cursor: 'pointer',+ padding: SPACING.SMALL,+ }}+ >+ <X size={20} />+ </button>+ </div>++ {/* Error message */}+ {error && (+ <div+ style={{+ padding: SPACING.DEFAULT,+ backgroundColor: `${FINCEPT.RED}20`,+ border: `1px solid ${FINCEPT.RED}`,+ borderRadius: '2px',+ marginBottom: SPACING.LARGE,+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ >+ <AlertCircle size={16} style={{ color: FINCEPT.RED }} />+ <span style={{ color: FINCEPT.RED, fontSize: TYPOGRAPHY.SMALL }}>{error}</span>+ </div>+ )}++ {/* Form */}+ <form onSubmit={e => { e.preventDefault(); handleCreate(); }}>+ {/* Basic Info */}+ <div+ style={{+ display: 'grid',+ gridTemplateColumns: '2fr 1fr 1fr',+ gap: SPACING.DEFAULT,+ marginBottom: SPACING.LARGE,+ }}+ >+ <div>+ <label style={COMMON_STYLES.dataLabel}>INDEX NAME *</label>+ <input+ type="text"+ value={form.name}+ onChange={e => setForm(prev => ({ ...prev, name: e.target.value }))}+ placeholder="My Custom Index"+ style={{ ...COMMON_STYLES.inputField, marginTop: SPACING.TINY }}+ {...focusHandlers}+ />+ </div>+ <div>+ <label style={COMMON_STYLES.dataLabel}>BASE VALUE</label>+ <input+ type="number"+ value={form.base_value}+ onChange={e =>+ setForm(prev => ({ ...prev, base_value: parseFloat(e.target.value) || 100 }))+ }+ min={1}+ style={{ ...COMMON_STYLES.inputField, marginTop: SPACING.TINY }}+ {...focusHandlers}+ />+ </div>+ <div>+ <label style={COMMON_STYLES.dataLabel}>CURRENCY</label>+ <select+ value={form.currency}+ onChange={e => setForm(prev => ({ ...prev, currency: e.target.value }))}+ style={{ ...COMMON_STYLES.inputField, marginTop: SPACING.TINY }}+ >+ <option value="USD">USD</option>+ <option value="EUR">EUR</option>+ <option value="GBP">GBP</option>+ <option value="INR">INR</option>+ <option value="JPY">JPY</option>+ </select>+ </div>+ </div>++ <div style={{ marginBottom: SPACING.LARGE }}>+ <label style={COMMON_STYLES.dataLabel}>DESCRIPTION</label>+ <input+ type="text"+ value={form.description}+ onChange={e => setForm(prev => ({ ...prev, description: e.target.value }))}+ placeholder="Optional description for your index"+ style={{ ...COMMON_STYLES.inputField, marginTop: SPACING.TINY }}+ {...focusHandlers}+ />+ </div>++ {/* Method selector */}+ {renderMethodSelector()}++ {/* Cap weight for capped methods */}+ {(selectedMethod === 'capped_weighted' || selectedMethod === 'modified_market_cap') && (+ <div style={{ marginBottom: SPACING.LARGE }}>+ <label style={COMMON_STYLES.dataLabel}>MAX WEIGHT PER CONSTITUENT (%)</label>+ <input+ type="number"+ value={form.cap_weight}+ onChange={e =>+ setForm(prev => ({ ...prev, cap_weight: parseFloat(e.target.value) || 0 }))+ }+ min={0}+ max={100}+ placeholder="e.g., 10 for 10% max"+ style={{ ...COMMON_STYLES.inputField, marginTop: SPACING.TINY, width: '150px' }}+ {...focusHandlers}+ />+ </div>+ )}++ {/* Portfolio stock selector */}+ {renderPortfolioStockSelector()}++ {/* Constituents */}+ <div style={{ marginBottom: SPACING.LARGE }}>+ <div+ style={{+ ...COMMON_STYLES.dataLabel,+ marginBottom: SPACING.SMALL,+ }}+ >+ CONSTITUENTS ({form.constituents.length})+ </div>++ {/* Add symbol input */}+ <div style={{ display: 'flex', gap: SPACING.SMALL, marginBottom: SPACING.SMALL }}>+ <input+ type="text"+ value={symbolInput}+ onChange={e => setSymbolInput(e.target.value.toUpperCase())}+ onKeyPress={e => {+ if (e.key === 'Enter') {+ e.preventDefault();+ handleAddSymbol();+ }+ }}+ placeholder="Enter ticker symbol (e.g., AAPL)"+ style={{ ...COMMON_STYLES.inputField, flex: 1 }}+ {...focusHandlers}+ />+ <button+ type="button"+ onClick={handleAddSymbol}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ >+ <Plus size={12} />+ ADD+ </button>+ </div>++ {/* Constituents list */}+ <div+ style={{+ backgroundColor: FINCEPT.DARK_BG,+ border: BORDERS.STANDARD,+ borderRadius: '2px',+ maxHeight: '200px',+ overflowY: 'auto',+ }}+ >+ {form.constituents.length === 0 ? (+ <div style={{ ...COMMON_STYLES.emptyState, padding: SPACING.LARGE }}>+ Add symbols to your index+ </div>+ ) : (+ form.constituents.map(constituent => (+ <div+ key={constituent.symbol}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.DEFAULT,+ padding: SPACING.SMALL,+ borderBottom: BORDERS.STANDARD,+ }}+ >+ <span+ style={{+ color: FINCEPT.WHITE,+ fontWeight: TYPOGRAPHY.BOLD,+ width: '80px',+ }}+ >+ {constituent.symbol}+ </span>++ {selectedMethod === 'price_weighted' && (+ <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>+ <label+ style={{ color: FINCEPT.GRAY, fontSize: TYPOGRAPHY.TINY }}+ >+ Shares:+ </label>+ <input+ type="number"+ value={constituent.shares || 1}+ onChange={e =>+ handleConstituentChange(+ constituent.symbol,+ 'shares',+ parseFloat(e.target.value) || 1+ )+ }+ min={1}+ style={{+ ...COMMON_STYLES.inputField,+ width: '60px',+ padding: '4px 6px',+ }}+ />+ </div>+ )}++ {(selectedMethod === 'fundamental_weighted' ||+ selectedMethod === 'factor_weighted') && (+ <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>+ <label+ style={{ color: FINCEPT.GRAY, fontSize: TYPOGRAPHY.TINY }}+ >+ Weight:+ </label>+ <input+ type="number"+ value={constituent.weight || 0}+ onChange={e =>+ handleConstituentChange(+ constituent.symbol,+ 'weight',+ parseFloat(e.target.value) || 0+ )+ }+ min={0}+ max={100}+ style={{+ ...COMMON_STYLES.inputField,+ width: '60px',+ padding: '4px 6px',+ }}+ />+ <span style={{ color: FINCEPT.GRAY, fontSize: TYPOGRAPHY.TINY }}>%</span>+ </div>+ )}++ <div style={{ flex: 1 }} />++ <button+ type="button"+ onClick={() => handleRemoveSymbol(constituent.symbol)}+ style={{+ background: 'none',+ border: 'none',+ color: FINCEPT.RED,+ cursor: 'pointer',+ padding: '4px',+ }}+ >+ <Trash2 size={14} />+ </button>+ </div>+ ))+ )}+ </div>+ </div>++ {/* Actions */}+ <div style={{ display: 'flex', gap: SPACING.DEFAULT, justifyContent: 'flex-end' }}>+ <button+ type="button"+ onClick={onClose}+ style={COMMON_STYLES.buttonSecondary}+ >+ CANCEL+ </button>+ <button+ type="submit"+ disabled={creating}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ opacity: creating ? 0.7 : 1,+ }}+ >+ {creating ? 'CREATING...' : 'CREATE INDEX'}+ </button>+ </div>+ </form>+ </div>+ </div>+ );+};++export default CreateIndexModal;diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CustomIndexView.tsx b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CustomIndexView.tsxnew file mode 100644index 000000000..50e1f621e--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/CustomIndexView.tsx@@ -0,0 +1,919 @@+/**+ * CustomIndexView - Aggregate Index Management Component+ * Allows users to create, monitor, and manage custom indices+ */++import React, { useState, useEffect, useCallback } from 'react';+import {+ TrendingUp,+ TrendingDown,+ Plus,+ Trash2,+ RefreshCw,+ BarChart2,+ Info,+ Settings,+ Download,+ ChevronRight,+ Clock,+ Layers,+ Edit3,+ X,+ Save,+} from 'lucide-react';+import {+ FINCEPT,+ TYPOGRAPHY,+ SPACING,+ BORDERS,+ COMMON_STYLES,+ EFFECTS,+ getValueColor,+ formatPercentage,+ formatCurrency,+} from '../finceptStyles';+import {+ CustomIndex,+ IndexSummary,+ IndexConstituent,+ IndexCalculationMethod,+ INDEX_METHOD_INFO,+} from './types';+import { customIndexService } from '../../../../services/portfolio/customIndexService';++interface CustomIndexViewProps {+ portfolioId?: string;+ onCreateIndex: () => void;+}++const CustomIndexView: React.FC<CustomIndexViewProps> = ({+ portfolioId,+ onCreateIndex,+}) => {+ const [indices, setIndices] = useState<CustomIndex[]>([]);+ const [selectedIndex, setSelectedIndex] = useState<CustomIndex | null>(null);+ const [indexSummary, setIndexSummary] = useState<IndexSummary | null>(null);+ const [loading, setLoading] = useState(false);+ const [refreshing, setRefreshing] = useState(false);+ const [showMethodInfo, setShowMethodInfo] = useState<IndexCalculationMethod | null>(null);+ const [editingConstituent, setEditingConstituent] = useState<IndexConstituent | null>(null);+ const [editForm, setEditForm] = useState({ shares: '', weight: '', marketCap: '', fundamentalScore: '', customPrice: '', priceDate: '' });+ const [fetchingPrice, setFetchingPrice] = useState(false);++ // Load indices on mount+ useEffect(() => {+ loadIndices();+ }, []);++ // Load index summary when selected index changes+ useEffect(() => {+ if (selectedIndex) {+ loadIndexSummary(selectedIndex.id);+ } else {+ setIndexSummary(null);+ }+ }, [selectedIndex?.id]);++ const loadIndices = async () => {+ setLoading(true);+ try {+ const allIndices = await customIndexService.getAllIndices();+ // Filter by portfolio if provided+ const filtered = portfolioId+ ? allIndices.filter(i => i.portfolio_id === portfolioId || !i.portfolio_id)+ : allIndices;+ setIndices(filtered);++ // Select first index if none selected+ if (!selectedIndex && filtered.length > 0) {+ setSelectedIndex(filtered[0]);+ }+ } catch (error) {+ console.error('Failed to load indices:', error);+ } finally {+ setLoading(false);+ }+ };++ const loadIndexSummary = async (indexId: string) => {+ setRefreshing(true);+ try {+ const summary = await customIndexService.calculateIndexSummary(indexId);+ setIndexSummary(summary);+ } catch (error) {+ console.error('Failed to load index summary:', error);+ } finally {+ setRefreshing(false);+ }+ };++ const handleRefresh = useCallback(() => {+ if (selectedIndex) {+ loadIndexSummary(selectedIndex.id);+ }+ }, [selectedIndex]);++ const handleDeleteIndex = async (indexId: string) => {+ if (!confirm('Are you sure you want to delete this index?')) return;++ try {+ await customIndexService.deleteIndex(indexId);+ await loadIndices();+ if (selectedIndex?.id === indexId) {+ setSelectedIndex(null);+ }+ } catch (error) {+ console.error('Failed to delete index:', error);+ }+ };++ const handleSaveSnapshot = async () => {+ if (!selectedIndex) return;++ try {+ await customIndexService.saveDailySnapshot(selectedIndex.id);+ alert('Snapshot saved successfully!');+ } catch (error) {+ console.error('Failed to save snapshot:', error);+ alert('Failed to save snapshot');+ }+ };++ const handleEditConstituent = (constituent: IndexConstituent) => {+ setEditingConstituent(constituent);+ setEditForm({+ shares: constituent.shares?.toString() || '',+ weight: constituent.weight?.toString() || '',+ marketCap: constituent.marketCap?.toString() || '',+ fundamentalScore: constituent.fundamentalScore?.toString() || '',+ customPrice: constituent.customPrice?.toString() || '',+ priceDate: constituent.priceDate || '',+ });+ };++ const handleDateChange = async (date: string) => {+ if (!editingConstituent || !date) return;++ setEditForm(prev => ({ ...prev, priceDate: date }));++ // Only fetch if no custom price is set+ if (!editForm.customPrice) {+ setFetchingPrice(true);+ try {+ const price = await customIndexService.getHistoricalPrice(editingConstituent.symbol, date);+ if (price) {+ setEditForm(prev => ({ ...prev, customPrice: price.toString() }));+ }+ } catch (error) {+ console.error('Failed to fetch historical price:', error);+ } finally {+ setFetchingPrice(false);+ }+ }+ };++ const handleSaveConstituent = async () => {+ if (!editingConstituent) return;++ try {+ await customIndexService.updateConstituent(+ editingConstituent.id,+ editForm.shares ? parseFloat(editForm.shares) : undefined,+ editForm.weight ? parseFloat(editForm.weight) : undefined,+ editForm.marketCap ? parseFloat(editForm.marketCap) : undefined,+ editForm.fundamentalScore ? parseFloat(editForm.fundamentalScore) : undefined,+ editForm.customPrice ? parseFloat(editForm.customPrice) : undefined,+ editForm.priceDate || undefined+ );+ setEditingConstituent(null);+ handleRefresh();+ } catch (error) {+ console.error('Failed to update constituent:', error);+ }+ };++ const handleRemoveConstituent = async (symbol: string) => {+ if (!selectedIndex || !confirm(`Remove ${symbol} from index?`)) return;++ try {+ await customIndexService.removeConstituent(selectedIndex.id, symbol);+ handleRefresh();+ } catch (error) {+ console.error('Failed to remove constituent:', error);+ }+ };++ // Render method info modal+ const renderMethodInfoModal = () => {+ if (!showMethodInfo) return null;++ const info = INDEX_METHOD_INFO[showMethodInfo];++ return (+ <div style={COMMON_STYLES.modalOverlay} onClick={() => setShowMethodInfo(null)}>+ <div+ style={{+ ...COMMON_STYLES.modalPanel,+ maxWidth: '500px',+ }}+ onClick={e => e.stopPropagation()}+ >+ <h3+ style={{+ color: FINCEPT.ORANGE,+ fontSize: TYPOGRAPHY.HEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ marginBottom: SPACING.MEDIUM,+ }}+ >+ {info.name}+ </h3>++ <p style={{ color: FINCEPT.WHITE, marginBottom: SPACING.DEFAULT, lineHeight: '1.5' }}>+ {info.description}+ </p>++ <div+ style={{+ backgroundColor: FINCEPT.DARK_BG,+ padding: SPACING.DEFAULT,+ borderRadius: '2px',+ marginBottom: SPACING.DEFAULT,+ }}+ >+ <div style={COMMON_STYLES.dataLabel}>FORMULA</div>+ <div+ style={{+ color: FINCEPT.CYAN,+ fontFamily: TYPOGRAPHY.MONO,+ fontSize: TYPOGRAPHY.BODY,+ marginTop: SPACING.SMALL,+ }}+ >+ {info.formula}+ </div>+ </div>++ <div style={{ marginBottom: SPACING.DEFAULT }}>+ <div style={COMMON_STYLES.dataLabel}>EXAMPLES</div>+ <ul style={{ paddingLeft: '20px', marginTop: SPACING.SMALL }}>+ {info.examples.map((ex, i) => (+ <li key={i} style={{ color: FINCEPT.WHITE, fontSize: TYPOGRAPHY.BODY, marginBottom: '4px' }}>+ {ex}+ </li>+ ))}+ </ul>+ </div>++ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ >+ <span style={COMMON_STYLES.dataLabel}>COMPLEXITY:</span>+ <span+ style={{+ padding: '2px 8px',+ backgroundColor:+ info.complexity === 'simple'+ ? `${FINCEPT.GREEN}20`+ : info.complexity === 'moderate'+ ? `${FINCEPT.YELLOW}20`+ : `${FINCEPT.RED}20`,+ color:+ info.complexity === 'simple'+ ? FINCEPT.GREEN+ : info.complexity === 'moderate'+ ? FINCEPT.YELLOW+ : FINCEPT.RED,+ borderRadius: '2px',+ fontSize: '9px',+ fontWeight: TYPOGRAPHY.BOLD,+ textTransform: 'uppercase',+ }}+ >+ {info.complexity}+ </span>+ </div>++ <button+ onClick={() => setShowMethodInfo(null)}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ marginTop: SPACING.LARGE,+ width: '100%',+ }}+ >+ CLOSE+ </button>+ </div>+ </div>+ );+ };++ // Render index list+ const renderIndexList = () => (+ <div+ style={{+ backgroundColor: FINCEPT.PANEL_BG,+ border: BORDERS.STANDARD,+ borderRadius: '2px',+ height: '100%',+ display: 'flex',+ flexDirection: 'column',+ }}+ >+ <div+ style={{+ ...COMMON_STYLES.sectionHeader,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ marginBottom: 0,+ }}+ >+ <span>INDICES</span>+ <button+ onClick={onCreateIndex}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ padding: '4px 8px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ >+ <Plus size={12} />+ NEW+ </button>+ </div>++ <div style={{ flex: 1, overflowY: 'auto', padding: SPACING.SMALL }}>+ {loading ? (+ <div style={COMMON_STYLES.emptyState}>Loading...</div>+ ) : indices.length === 0 ? (+ <div style={COMMON_STYLES.emptyState}>+ <Layers size={32} style={{ marginBottom: SPACING.SMALL, opacity: 0.5 }} />+ <div>No indices created</div>+ <button+ onClick={onCreateIndex}+ style={{ ...COMMON_STYLES.buttonPrimary, marginTop: SPACING.MEDIUM }}+ >+ CREATE YOUR FIRST INDEX+ </button>+ </div>+ ) : (+ indices.map(index => (+ <div+ key={index.id}+ onClick={() => setSelectedIndex(index)}+ style={{+ padding: SPACING.DEFAULT,+ backgroundColor:+ selectedIndex?.id === index.id ? `${FINCEPT.ORANGE}20` : 'transparent',+ borderLeft:+ selectedIndex?.id === index.id+ ? `2px solid ${FINCEPT.ORANGE}`+ : '2px solid transparent',+ cursor: 'pointer',+ marginBottom: SPACING.TINY,+ transition: EFFECTS.TRANSITION_FAST,+ }}+ >+ <div+ style={{+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ marginBottom: SPACING.TINY,+ }}+ >+ <span+ style={{+ color: FINCEPT.WHITE,+ fontWeight: TYPOGRAPHY.BOLD,+ fontSize: TYPOGRAPHY.BODY,+ }}+ >+ {index.name}+ </span>+ <ChevronRight size={14} style={{ color: FINCEPT.GRAY }} />+ </div>+ <div+ style={{+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ }}+ >+ <span+ style={{+ color: FINCEPT.CYAN,+ fontSize: TYPOGRAPHY.SMALL,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(index.current_value, '', 2)}+ </span>+ <span+ style={{+ color: getValueColor(index.current_value - index.previous_close),+ fontSize: TYPOGRAPHY.TINY,+ }}+ >+ {formatPercentage(+ index.previous_close > 0+ ? ((index.current_value - index.previous_close) / index.previous_close) * 100+ : 0+ )}+ </span>+ </div>+ <div+ style={{+ color: FINCEPT.GRAY,+ fontSize: TYPOGRAPHY.TINY,+ marginTop: SPACING.TINY,+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ >+ <Info+ size={10}+ style={{ cursor: 'pointer' }}+ onClick={e => {+ e.stopPropagation();+ setShowMethodInfo(index.calculation_method as IndexCalculationMethod);+ }}+ />+ {INDEX_METHOD_INFO[index.calculation_method as IndexCalculationMethod]?.name || index.calculation_method}+ </div>+ </div>+ ))+ )}+ </div>+ </div>+ );++ // Render index details+ const renderIndexDetails = () => {+ if (!selectedIndex) {+ return (+ <div style={{ ...COMMON_STYLES.emptyState, height: '100%' }}>+ <BarChart2 size={48} style={{ marginBottom: SPACING.DEFAULT, opacity: 0.5 }} />+ <div>Select an index to view details</div>+ <div style={{ fontSize: TYPOGRAPHY.TINY, marginTop: SPACING.SMALL }}>+ Or create a new index to get started+ </div>+ </div>+ );+ }++ return (+ <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>+ {/* Header */}+ <div+ style={{+ ...COMMON_STYLES.sectionHeader,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ marginBottom: 0,+ }}+ >+ <div>+ <span>{selectedIndex.name}</span>+ {selectedIndex.description && (+ <span style={{ color: FINCEPT.GRAY, marginLeft: SPACING.SMALL, fontSize: TYPOGRAPHY.TINY }}>+ {selectedIndex.description}+ </span>+ )}+ </div>+ <div style={{ display: 'flex', gap: SPACING.SMALL }}>+ <button+ onClick={handleRefresh}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ disabled={refreshing}+ >+ <RefreshCw size={12} className={refreshing ? 'animate-spin' : ''} />+ </button>+ <button+ onClick={handleSaveSnapshot}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ title="Save daily snapshot"+ >+ <Download size={12} />+ </button>+ <button+ onClick={() => handleDeleteIndex(selectedIndex.id)}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ color: FINCEPT.RED,+ }}+ >+ <Trash2 size={12} />+ </button>+ </div>+ </div>++ {/* Index Value Card */}+ <div+ style={{+ padding: SPACING.LARGE,+ borderBottom: BORDERS.STANDARD,+ backgroundColor: FINCEPT.DARK_BG,+ }}+ >+ <div+ style={{+ display: 'flex',+ alignItems: 'flex-end',+ gap: SPACING.DEFAULT,+ }}+ >+ <span+ style={{+ fontSize: '28px',+ fontWeight: TYPOGRAPHY.BOLD,+ color: FINCEPT.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(indexSummary?.index_value || selectedIndex.current_value, '', 2)}+ </span>+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ marginBottom: '4px',+ }}+ >+ {(indexSummary?.day_change || 0) >= 0 ? (+ <TrendingUp size={16} style={{ color: FINCEPT.GREEN }} />+ ) : (+ <TrendingDown size={16} style={{ color: FINCEPT.RED }} />+ )}+ <span+ style={{+ color: getValueColor(indexSummary?.day_change || 0),+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ }}+ >+ {formatPercentage(indexSummary?.day_change_percent || 0)}+ </span>+ <span style={{ color: FINCEPT.GRAY, fontSize: TYPOGRAPHY.SMALL }}>+ ({formatCurrency(indexSummary?.day_change || 0, '', 2)})+ </span>+ </div>+ </div>++ {/* Index Stats */}+ <div+ style={{+ display: 'grid',+ gridTemplateColumns: 'repeat(4, 1fr)',+ gap: SPACING.DEFAULT,+ marginTop: SPACING.LARGE,+ }}+ >+ <div>+ <div style={COMMON_STYLES.dataLabel}>BASE VALUE</div>+ <div style={COMMON_STYLES.dataValue}>{formatCurrency(selectedIndex.base_value, '', 0)}</div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>MARKET VALUE</div>+ <div style={COMMON_STYLES.dataValue}>+ {formatCurrency(indexSummary?.total_market_value || 0, '$', 0)}+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>DIVISOR</div>+ <div style={COMMON_STYLES.dataValue}>{(indexSummary?.index.divisor || 1).toFixed(4)}</div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>CONSTITUENTS</div>+ <div style={COMMON_STYLES.dataValue}>{indexSummary?.constituents.length || 0}</div>+ </div>+ </div>+ </div>++ {/* Constituents Table */}+ <div style={{ flex: 1, overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>+ <div+ style={{+ ...COMMON_STYLES.tableHeader,+ display: 'grid',+ gridTemplateColumns: '1fr 70px 70px 70px 70px 60px 60px',+ }}+ >+ <span>SYMBOL</span>+ <span style={{ textAlign: 'right' }}>PRICE</span>+ <span style={{ textAlign: 'right' }}>CHANGE</span>+ <span style={{ textAlign: 'right' }}>WEIGHT</span>+ <span style={{ textAlign: 'right' }}>CONTRIB</span>+ <span style={{ textAlign: 'right' }}>MKT VAL</span>+ <span style={{ textAlign: 'center' }}>ACTIONS</span>+ </div>++ <div style={{ flex: 1, overflowY: 'auto' }}>+ {refreshing ? (+ <div style={{ ...COMMON_STYLES.emptyState, padding: SPACING.LARGE }}>+ <RefreshCw size={24} className="animate-spin" />+ <span style={{ marginTop: SPACING.SMALL }}>Calculating...</span>+ </div>+ ) : indexSummary?.constituents.length === 0 ? (+ <div style={{ ...COMMON_STYLES.emptyState, padding: SPACING.LARGE }}>+ No constituents in this index+ </div>+ ) : (+ indexSummary?.constituents.map((c, i) => (+ <div+ key={c.id}+ style={{+ display: 'grid',+ gridTemplateColumns: '1fr 70px 70px 70px 70px 60px 60px',+ padding: `${SPACING.SMALL} ${SPACING.DEFAULT}`,+ borderBottom: BORDERS.STANDARD,+ backgroundColor: i % 2 === 1 ? 'rgba(255,255,255,0.02)' : 'transparent',+ fontSize: TYPOGRAPHY.BODY,+ alignItems: 'center',+ }}+ >+ <span style={{ color: FINCEPT.WHITE, fontWeight: TYPOGRAPHY.BOLD }}>+ {c.symbol}+ </span>+ <span style={{ textAlign: 'right', color: FINCEPT.CYAN, fontFamily: TYPOGRAPHY.MONO }}>+ {formatCurrency(c.current_price, '$', 2)}+ </span>+ <span+ style={{+ textAlign: 'right',+ color: getValueColor(c.day_change_percent),+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(c.day_change_percent)}+ </span>+ <span style={{ textAlign: 'right', color: FINCEPT.WHITE, fontFamily: TYPOGRAPHY.MONO }}>+ {c.effective_weight.toFixed(2)}%+ </span>+ <span+ style={{+ textAlign: 'right',+ color: getValueColor(c.contribution),+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {(c.contribution * 100).toFixed(3)}%+ </span>+ <span style={{ textAlign: 'right', color: FINCEPT.GRAY, fontFamily: TYPOGRAPHY.MONO }}>+ {formatCurrency(c.market_value / 1000, '', 0)}K+ </span>+ <div style={{ display: 'flex', justifyContent: 'center', gap: '4px' }}>+ <button+ onClick={() => handleEditConstituent(c)}+ style={{+ background: 'none',+ border: 'none',+ cursor: 'pointer',+ padding: '2px',+ color: FINCEPT.CYAN,+ }}+ title="Edit"+ >+ <Edit3 size={12} />+ </button>+ <button+ onClick={() => handleRemoveConstituent(c.symbol)}+ style={{+ background: 'none',+ border: 'none',+ cursor: 'pointer',+ padding: '2px',+ color: FINCEPT.RED,+ }}+ title="Remove"+ >+ <Trash2 size={12} />+ </button>+ </div>+ </div>+ ))+ )}+ </div>+ </div>++ {/* Footer with method info */}+ <div+ style={{+ padding: SPACING.DEFAULT,+ borderTop: BORDERS.STANDARD,+ backgroundColor: FINCEPT.DARK_BG,+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ }}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ <Clock size={12} style={{ color: FINCEPT.GRAY }} />+ <span style={{ color: FINCEPT.GRAY, fontSize: TYPOGRAPHY.TINY }}>+ Last updated: {indexSummary?.last_updated ? new Date(indexSummary.last_updated).toLocaleString() : 'N/A'}+ </span>+ </div>+ <button+ onClick={() =>+ setShowMethodInfo(selectedIndex.calculation_method as IndexCalculationMethod)+ }+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ }}+ >+ <Info size={12} />+ {INDEX_METHOD_INFO[selectedIndex.calculation_method as IndexCalculationMethod]?.name}+ </button>+ </div>+ </div>+ );+ };++ return (+ <div+ style={{+ height: '100%',+ display: 'grid',+ gridTemplateColumns: '280px 1fr',+ gap: SPACING.DEFAULT,+ }}+ >+ {/* Left sidebar: Index list */}+ {renderIndexList()}++ {/* Main content: Index details */}+ <div+ style={{+ backgroundColor: FINCEPT.PANEL_BG,+ border: BORDERS.STANDARD,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {renderIndexDetails()}+ </div>++ {/* Method info modal */}+ {renderMethodInfoModal()}++ {/* Edit Constituent Modal */}+ {editingConstituent && (+ <div style={COMMON_STYLES.modalOverlay} onClick={() => setEditingConstituent(null)}>+ <div+ style={{+ ...COMMON_STYLES.modalPanel,+ width: '360px',+ minWidth: '360px',+ }}+ onClick={e => e.stopPropagation()}+ >+ <div+ style={{+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ marginBottom: SPACING.DEFAULT,+ }}+ >+ <span style={{ color: FINCEPT.WHITE, fontWeight: TYPOGRAPHY.BOLD }}>+ EDIT {editingConstituent.symbol}+ </span>+ <button+ onClick={() => setEditingConstituent(null)}+ style={{ background: 'none', border: 'none', color: FINCEPT.GRAY, cursor: 'pointer' }}+ >+ <X size={16} />+ </button>+ </div>++ <div style={{ display: 'flex', flexDirection: 'column', gap: SPACING.SMALL }}>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: SPACING.SMALL }}>+ <div>+ <label style={COMMON_STYLES.dataLabel}>PRICE DATE</label>+ <input+ type="date"+ value={editForm.priceDate}+ onChange={e => handleDateChange(e.target.value)}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ />+ </div>+ <div>+ <label style={COMMON_STYLES.dataLabel}>+ PRICE {fetchingPrice && <RefreshCw size={10} className="animate-spin" style={{ marginLeft: 4 }} />}+ </label>+ <input+ type="number"+ value={editForm.customPrice}+ onChange={e => setEditForm({ ...editForm, customPrice: e.target.value })}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ placeholder="Auto-fetch or manual"+ />+ </div>+ </div>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: SPACING.SMALL }}>+ <div>+ <label style={COMMON_STYLES.dataLabel}>SHARES</label>+ <input+ type="number"+ value={editForm.shares}+ onChange={e => setEditForm({ ...editForm, shares: e.target.value })}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ placeholder="Shares"+ />+ </div>+ <div>+ <label style={COMMON_STYLES.dataLabel}>WEIGHT (%)</label>+ <input+ type="number"+ value={editForm.weight}+ onChange={e => setEditForm({ ...editForm, weight: e.target.value })}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ placeholder="0-100"+ />+ </div>+ </div>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: SPACING.SMALL }}>+ <div>+ <label style={COMMON_STYLES.dataLabel}>MARKET CAP</label>+ <input+ type="number"+ value={editForm.marketCap}+ onChange={e => setEditForm({ ...editForm, marketCap: e.target.value })}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ placeholder="Market cap"+ />+ </div>+ <div>+ <label style={COMMON_STYLES.dataLabel}>FUND. SCORE</label>+ <input+ type="number"+ value={editForm.fundamentalScore}+ onChange={e => setEditForm({ ...editForm, fundamentalScore: e.target.value })}+ style={{ ...COMMON_STYLES.inputField, width: '100%' }}+ placeholder="1-100"+ />+ </div>+ </div>+ <div style={{ fontSize: TYPOGRAPHY.TINY, color: FINCEPT.GRAY, marginTop: SPACING.TINY }}>+ Set date to auto-fetch closing price, or enter price manually+ </div>+ </div>++ <div style={{ display: 'flex', gap: SPACING.SMALL, marginTop: SPACING.LARGE }}>+ <button+ onClick={() => setEditingConstituent(null)}+ style={{ ...COMMON_STYLES.buttonSecondary, flex: 1 }}+ >+ CANCEL+ </button>+ <button+ onClick={handleSaveConstituent}+ style={{+ ...COMMON_STYLES.buttonPrimary,+ flex: 1,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: '4px',+ }}+ >+ <Save size={12} />+ SAVE+ </button>+ </div>+ </div>+ </div>+ )}+ </div>+ );+};++export default CustomIndexView;diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/IndexHistoryView.tsx b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/IndexHistoryView.tsxnew file mode 100644index 000000000..751f71cfd--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/IndexHistoryView.tsx@@ -0,0 +1,446 @@+/**+ * IndexHistoryView - Historical Index Performance Component+ * Displays historical snapshots and performance charts for custom indices+ */++import React, { useState, useEffect } from 'react';+import {+ TrendingUp,+ TrendingDown,+ Calendar,+ RefreshCw,+ Download,+ Trash2,+} from 'lucide-react';+import {+ FINCEPT,+ TYPOGRAPHY,+ SPACING,+ BORDERS,+ COMMON_STYLES,+ EFFECTS,+ getValueColor,+ formatPercentage,+ formatCurrency,+} from '../finceptStyles';+import { IndexSnapshot, CustomIndex } from './types';+import { customIndexService } from '../../../../services/portfolio/customIndexService';++interface IndexHistoryViewProps {+ index: CustomIndex;+}++const IndexHistoryView: React.FC<IndexHistoryViewProps> = ({ index }) => {+ const [snapshots, setSnapshots] = useState<IndexSnapshot[]>([]);+ const [loading, setLoading] = useState(false);+ const [selectedDays, setSelectedDays] = useState<number>(30);++ useEffect(() => {+ loadSnapshots();+ }, [index.id, selectedDays]);++ const loadSnapshots = async () => {+ setLoading(true);+ try {+ const data = await customIndexService.getSnapshots(index.id, selectedDays);+ setSnapshots(data);+ } catch (error) {+ console.error('Failed to load snapshots:', error);+ } finally {+ setLoading(false);+ }+ };++ const handleCleanup = async () => {+ const days = prompt('Delete snapshots older than how many days?', '365');+ if (!days) return;++ const daysNum = parseInt(days);+ if (isNaN(daysNum) || daysNum < 1) {+ alert('Invalid number of days');+ return;+ }++ try {+ const deleted = await customIndexService.cleanupSnapshots(index.id, daysNum);+ alert(`Deleted ${deleted} old snapshots`);+ loadSnapshots();+ } catch (error) {+ console.error('Failed to cleanup snapshots:', error);+ alert('Failed to cleanup snapshots');+ }+ };++ const exportHistory = () => {+ if (snapshots.length === 0) return;++ let csv = 'Date,Index Value,Day Change,Day Change %,Total Market Value,Divisor\n';+ snapshots.forEach(s => {+ csv += `${s.snapshot_date},${s.index_value.toFixed(2)},${s.day_change.toFixed(2)},${s.day_change_percent.toFixed(4)},${s.total_market_value.toFixed(2)},${s.divisor.toFixed(6)}\n`;+ });++ const blob = new Blob([csv], { type: 'text/csv' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `${index.name.replace(/\s+/g, '_')}_history.csv`;+ a.click();+ URL.revokeObjectURL(url);+ };++ // Calculate performance metrics+ const calculatePerformance = () => {+ if (snapshots.length < 2) return null;++ const latest = snapshots[0];+ const oldest = snapshots[snapshots.length - 1];+ const totalReturn = ((latest.index_value - oldest.index_value) / oldest.index_value) * 100;++ // Find best and worst days+ let bestDay = snapshots[0];+ let worstDay = snapshots[0];++ snapshots.forEach(s => {+ if (s.day_change_percent > bestDay.day_change_percent) bestDay = s;+ if (s.day_change_percent < worstDay.day_change_percent) worstDay = s;+ });++ // Calculate volatility (simplified - standard deviation of daily returns)+ const returns = snapshots.map(s => s.day_change_percent);+ const avgReturn = returns.reduce((sum, r) => sum + r, 0) / returns.length;+ const variance = returns.reduce((sum, r) => sum + Math.pow(r - avgReturn, 2), 0) / returns.length;+ const volatility = Math.sqrt(variance);+ const annualizedVolatility = volatility * Math.sqrt(252);++ return {+ totalReturn,+ avgDailyReturn: avgReturn,+ volatility: annualizedVolatility,+ bestDay,+ worstDay,+ high: Math.max(...snapshots.map(s => s.index_value)),+ low: Math.min(...snapshots.map(s => s.index_value)),+ };+ };++ const performance = calculatePerformance();++ return (+ <div style={{ height: '100%', display: 'flex', flexDirection: 'column' }}>+ {/* Header */}+ <div+ style={{+ ...COMMON_STYLES.sectionHeader,+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ marginBottom: 0,+ }}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: SPACING.SMALL }}>+ <Calendar size={14} />+ <span>HISTORICAL DATA - {index.name}</span>+ </div>+ <div style={{ display: 'flex', gap: SPACING.SMALL }}>+ <select+ value={selectedDays}+ onChange={e => setSelectedDays(parseInt(e.target.value))}+ style={{+ ...COMMON_STYLES.inputField,+ width: 'auto',+ padding: '4px 8px',+ fontSize: TYPOGRAPHY.TINY,+ }}+ >+ <option value={7}>7 Days</option>+ <option value={30}>30 Days</option>+ <option value={90}>90 Days</option>+ <option value={180}>180 Days</option>+ <option value={365}>1 Year</option>+ </select>+ <button+ onClick={loadSnapshots}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ }}+ disabled={loading}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ <button+ onClick={exportHistory}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ }}+ disabled={snapshots.length === 0}+ >+ <Download size={12} />+ </button>+ <button+ onClick={handleCleanup}+ style={{+ ...COMMON_STYLES.buttonSecondary,+ padding: '4px 8px',+ color: FINCEPT.RED,+ }}+ >+ <Trash2 size={12} />+ </button>+ </div>+ </div>++ {/* Performance Summary */}+ {performance && (+ <div+ style={{+ padding: SPACING.DEFAULT,+ borderBottom: BORDERS.STANDARD,+ display: 'grid',+ gridTemplateColumns: 'repeat(6, 1fr)',+ gap: SPACING.DEFAULT,+ }}+ >+ <div>+ <div style={COMMON_STYLES.dataLabel}>PERIOD RETURN</div>+ <div+ style={{+ color: getValueColor(performance.totalReturn),+ fontSize: TYPOGRAPHY.SUBHEADING,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(performance.totalReturn)}+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>AVG DAILY</div>+ <div+ style={{+ color: getValueColor(performance.avgDailyReturn),+ fontSize: TYPOGRAPHY.BODY,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(performance.avgDailyReturn, 4)}+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>VOLATILITY (Ann.)</div>+ <div+ style={{+ color: FINCEPT.YELLOW,+ fontSize: TYPOGRAPHY.BODY,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {performance.volatility.toFixed(2)}%+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>HIGH</div>+ <div+ style={{+ color: FINCEPT.GREEN,+ fontSize: TYPOGRAPHY.BODY,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(performance.high, '', 2)}+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>LOW</div>+ <div+ style={{+ color: FINCEPT.RED,+ fontSize: TYPOGRAPHY.BODY,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(performance.low, '', 2)}+ </div>+ </div>+ <div>+ <div style={COMMON_STYLES.dataLabel}>DATA POINTS</div>+ <div+ style={{+ color: FINCEPT.CYAN,+ fontSize: TYPOGRAPHY.BODY,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {snapshots.length}+ </div>+ </div>+ </div>+ )}++ {/* Best/Worst Days */}+ {performance && (+ <div+ style={{+ padding: SPACING.DEFAULT,+ borderBottom: BORDERS.STANDARD,+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: SPACING.LARGE,+ }}+ >+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ >+ <TrendingUp size={16} style={{ color: FINCEPT.GREEN }} />+ <div>+ <div style={{ ...COMMON_STYLES.dataLabel, marginBottom: '2px' }}>BEST DAY</div>+ <div style={{ color: FINCEPT.WHITE, fontSize: TYPOGRAPHY.SMALL }}>+ {performance.bestDay.snapshot_date}+ </div>+ <div+ style={{+ color: FINCEPT.GREEN,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(performance.bestDay.day_change_percent)}+ </div>+ </div>+ </div>+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: SPACING.SMALL,+ }}+ >+ <TrendingDown size={16} style={{ color: FINCEPT.RED }} />+ <div>+ <div style={{ ...COMMON_STYLES.dataLabel, marginBottom: '2px' }}>WORST DAY</div>+ <div style={{ color: FINCEPT.WHITE, fontSize: TYPOGRAPHY.SMALL }}>+ {performance.worstDay.snapshot_date}+ </div>+ <div+ style={{+ color: FINCEPT.RED,+ fontSize: TYPOGRAPHY.BODY,+ fontWeight: TYPOGRAPHY.BOLD,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(performance.worstDay.day_change_percent)}+ </div>+ </div>+ </div>+ </div>+ )}++ {/* Snapshot Table */}+ <div style={{ flex: 1, overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>+ <div+ style={{+ ...COMMON_STYLES.tableHeader,+ display: 'grid',+ gridTemplateColumns: '120px 100px 80px 80px 100px 80px',+ }}+ >+ <span>DATE</span>+ <span style={{ textAlign: 'right' }}>VALUE</span>+ <span style={{ textAlign: 'right' }}>CHANGE</span>+ <span style={{ textAlign: 'right' }}>%</span>+ <span style={{ textAlign: 'right' }}>MKT VALUE</span>+ <span style={{ textAlign: 'right' }}>DIVISOR</span>+ </div>++ <div style={{ flex: 1, overflowY: 'auto' }}>+ {loading ? (+ <div style={{ ...COMMON_STYLES.emptyState, padding: SPACING.LARGE }}>+ <RefreshCw size={24} className="animate-spin" />+ <span style={{ marginTop: SPACING.SMALL }}>Loading history...</span>+ </div>+ ) : snapshots.length === 0 ? (+ <div style={{ ...COMMON_STYLES.emptyState, padding: SPACING.LARGE }}>+ <Calendar size={32} style={{ opacity: 0.5 }} />+ <span style={{ marginTop: SPACING.SMALL }}>No historical data available</span>+ <span style={{ fontSize: TYPOGRAPHY.TINY, color: FINCEPT.GRAY, marginTop: SPACING.TINY }}>+ Snapshots are saved when you click the save button+ </span>+ </div>+ ) : (+ snapshots.map((snapshot, i) => (+ <div+ key={snapshot.id}+ style={{+ display: 'grid',+ gridTemplateColumns: '120px 100px 80px 80px 100px 80px',+ padding: `${SPACING.SMALL} ${SPACING.DEFAULT}`,+ borderBottom: BORDERS.STANDARD,+ backgroundColor: i % 2 === 1 ? 'rgba(255,255,255,0.02)' : 'transparent',+ fontSize: TYPOGRAPHY.BODY,+ }}+ >+ <span style={{ color: FINCEPT.WHITE }}>{snapshot.snapshot_date}</span>+ <span+ style={{+ textAlign: 'right',+ color: FINCEPT.CYAN,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(snapshot.index_value, '', 2)}+ </span>+ <span+ style={{+ textAlign: 'right',+ color: getValueColor(snapshot.day_change),+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {snapshot.day_change >= 0 ? '+' : ''}+ {snapshot.day_change.toFixed(2)}+ </span>+ <span+ style={{+ textAlign: 'right',+ color: getValueColor(snapshot.day_change_percent),+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatPercentage(snapshot.day_change_percent)}+ </span>+ <span+ style={{+ textAlign: 'right',+ color: FINCEPT.WHITE,+ fontFamily: TYPOGRAPHY.MONO,+ }}+ >+ {formatCurrency(snapshot.total_market_value / 1000, '$', 0)}K+ </span>+ <span+ style={{+ textAlign: 'right',+ color: FINCEPT.GRAY,+ fontFamily: TYPOGRAPHY.MONO,+ fontSize: TYPOGRAPHY.TINY,+ }}+ >+ {snapshot.divisor.toFixed(4)}+ </span>+ </div>+ ))+ )}+ </div>+ </div>+ </div>+ );+};++export default IndexHistoryView;diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/index.ts b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/index.tsnew file mode 100644index 000000000..c06a1629c--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/index.ts@@ -0,0 +1,10 @@+/**+ * Custom Index Feature - Module Exports+ */++export * from './types';+import CustomIndexView from './CustomIndexView';+import CreateIndexModal from './CreateIndexModal';+import IndexHistoryView from './IndexHistoryView';++export { CustomIndexView, CreateIndexModal, IndexHistoryView };diff --git a/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/types.ts b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/types.tsnew file mode 100644index 000000000..240a6e4c2--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/portfolio-tab/custom-index/types.ts@@ -0,0 +1,192 @@+/**+ * Custom Index Types - Fincept Terminal+ * Types and interfaces for the aggregate index feature+ */++// Index calculation methods from most common to least used+export type IndexCalculationMethod =+ | 'price_weighted' // Dow Jones style - sum of prices / divisor+ | 'market_cap_weighted' // S&P 500 style - weighted by market cap+ | 'equal_weighted' // Each constituent has equal weight+ | 'float_adjusted' // Weighted by free-float market cap+ | 'fundamental_weighted' // Weighted by fundamental factors (earnings, revenue)+ | 'modified_market_cap' // Capped market cap weighting+ | 'factor_weighted' // Factor-based (momentum, value, quality)+ | 'risk_parity' // Inverse volatility weighting+ | 'geometric_mean' // Geometric average of returns+ | 'capped_weighted'; // Market cap with maximum weight cap++export interface IndexConstituentConfig {+ symbol: string;+ shares?: number; // For price-weighted: shares outstanding+ weight?: number; // For custom weighting (0-100)+ marketCap?: number; // For market cap weighted+ fundamentalScore?: number; // For fundamental weighted+ customPrice?: number; // Manual price override+ priceDate?: string; // Date for historical price lookup (YYYY-MM-DD)+}++export interface IndexConstituent extends IndexConstituentConfig {+ id: string;+ index_id: string;+ current_price: number;+ previous_close: number;+ market_value: number;+ effective_weight: number; // Calculated weight after method applied+ day_change: number;+ day_change_percent: number;+ contribution: number; // Contribution to index change+ added_at: string;+}++export interface CustomIndex {+ id: string;+ name: string;+ description?: string;+ calculation_method: IndexCalculationMethod;+ base_value: number; // Starting index value (e.g., 100, 1000)+ base_date: string; // Date when index started+ divisor: number; // Used for price-weighted calculations+ current_value: number; // Current calculated index value+ previous_close: number; // Previous day close value+ cap_weight?: number; // Max weight per constituent (for capped methods)+ currency: string;+ portfolio_id?: string; // Optional: linked portfolio+ is_active: boolean;+ created_at: string;+ updated_at: string;+}++export interface IndexSnapshot {+ id: string;+ index_id: string;+ index_value: number;+ day_change: number;+ day_change_percent: number;+ total_market_value: number;+ divisor: number;+ constituents_data: string; // JSON snapshot of all constituents+ snapshot_date: string;+ created_at: string;+}++export interface IndexSummary {+ index: CustomIndex;+ constituents: IndexConstituent[];+ total_market_value: number;+ index_value: number;+ day_change: number;+ day_change_percent: number;+ ytd_change?: number;+ ytd_change_percent?: number;+ last_updated: string;+}++export interface IndexPerformanceData {+ date: string;+ value: number;+ change: number;+ change_percent: number;+}++// Index calculation method descriptions+export const INDEX_METHOD_INFO: Record<IndexCalculationMethod, {+ name: string;+ description: string;+ formula: string;+ examples: string[];+ complexity: 'simple' | 'moderate' | 'complex';+}> = {+ price_weighted: {+ name: 'Price-Weighted',+ description: 'Sum of constituent prices divided by a divisor. Higher-priced stocks have more influence.',+ formula: 'Index = Σ(Prices) / Divisor',+ examples: ['Dow Jones Industrial Average (DJIA)', 'Nikkei 225'],+ complexity: 'simple',+ },+ market_cap_weighted: {+ name: 'Market Cap Weighted',+ description: 'Weighted by market capitalization. Larger companies have more influence.',+ formula: 'Index = Σ(Price × Shares) / Base Market Cap × Base Value',+ examples: ['S&P 500', 'NASDAQ Composite', 'FTSE 100'],+ complexity: 'moderate',+ },+ equal_weighted: {+ name: 'Equal-Weighted',+ description: 'Each constituent has the same weight regardless of size or price.',+ formula: 'Index = (1/n) × Σ(Price Changes) × Base Value',+ examples: ['S&P 500 Equal Weight Index', 'Value Line Geometric'],+ complexity: 'simple',+ },+ float_adjusted: {+ name: 'Float-Adjusted',+ description: 'Weighted by free-float market cap (excludes closely-held shares).',+ formula: 'Index = Σ(Price × Float Shares) / Float Market Cap × Base Value',+ examples: ['S&P 500 (modern)', 'MSCI Indices', 'Russell Indices'],+ complexity: 'moderate',+ },+ fundamental_weighted: {+ name: 'Fundamental-Weighted',+ description: 'Weighted by fundamental factors like earnings, revenue, book value.',+ formula: 'Weight = Fundamental Score / Total Fundamental Scores',+ examples: ['FTSE RAFI Index', 'WisdomTree Indices'],+ complexity: 'complex',+ },+ modified_market_cap: {+ name: 'Modified Market Cap',+ description: 'Market cap weighted with adjustments for sector balance or liquidity.',+ formula: 'Index = Adjusted Market Cap Weighted with Constraints',+ examples: ['Many sector-specific indices'],+ complexity: 'moderate',+ },+ factor_weighted: {+ name: 'Factor-Weighted',+ description: 'Weighted by factor exposures (momentum, value, quality, volatility).',+ formula: 'Weight = Factor Score / Total Factor Scores',+ examples: ['MSCI Factor Indices', 'Smart Beta ETFs'],+ complexity: 'complex',+ },+ risk_parity: {+ name: 'Risk Parity',+ description: 'Weights based on inverse volatility - lower volatility stocks get higher weight.',+ formula: 'Weight = (1/σ) / Σ(1/σ)',+ examples: ['Risk Parity Funds', 'Low Volatility Indices'],+ complexity: 'complex',+ },+ geometric_mean: {+ name: 'Geometric Mean',+ description: 'Uses geometric average of price relatives, better for long-term comparison.',+ formula: 'Index = Base × (Π(P₁/P₀))^(1/n)',+ examples: ['Value Line Arithmetic Index', 'Financial Times Ordinary Index'],+ complexity: 'moderate',+ },+ capped_weighted: {+ name: 'Capped-Weighted',+ description: 'Market cap weighted with maximum weight limits per constituent.',+ formula: 'Index = Market Cap Weighted with max(weight) = Cap%',+ examples: ['CAC 40 Capped', 'Many ETF benchmarks'],+ complexity: 'moderate',+ },+};++// Form state for creating/editing an index+export interface IndexFormState {+ name: string;+ description: string;+ calculation_method: IndexCalculationMethod;+ base_value: number;+ cap_weight: number;+ currency: string;+ constituents: IndexConstituentConfig[];+}++// Default form state+export const DEFAULT_INDEX_FORM: IndexFormState = {+ name: '',+ description: '',+ calculation_method: 'equal_weighted',+ base_value: 100,+ cap_weight: 0, // 0 means no cap+ currency: 'USD',+ constituents: [],+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/SurfaceAnalyticsTab.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/SurfaceAnalyticsTab.tsxnew file mode 100644index 000000000..bb3899bf6--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/SurfaceAnalyticsTab.tsx@@ -0,0 +1,762 @@+/**+ * Surface Analytics Tab+ * ======================+ * Professional-grade 3D financial analytics terminal.+ * Bloomberg-style visualization for options volatility surfaces,+ * multi-asset correlations, yield curve evolution, and PCA analysis.+ *+ * Data Source: Databento (institutional-grade market data)+ * Charts: Plotly.js 3D surfaces+ *+ * NOTE: This tab requires a Databento API key for real data.+ * No demo/dummy data - everything comes from live market data.+ */++import React, { useState, useEffect, useCallback, useMemo } from 'react';+import { useTerminalTheme } from '@/contexts/ThemeContext';+import { useTranslation } from 'react-i18next';+import { TabFooter } from '@/components/common/TabFooter';+import { Key, ExternalLink, AlertTriangle, Database, Settings, RefreshCw, TrendingUp, Activity, BarChart3, Network } from 'lucide-react';++// Components+import { ControlBar, MetricsPanel, SettingsModal, SurfaceChart } from './components';++// Hooks+import { useDatabentoApi, useSurfaceComputation, useDemoData } from './hooks';++// Types & Constants+import type {+ ChartType,+ ChartMetric,+ SurfaceAnalyticsConfig,+ VolatilitySurfaceData,+ CorrelationMatrixData,+ YieldCurveData,+ PCAData,+} from './types';+import { CORRELATION_ASSETS, FINCEPT_COLORS, TREASURY_MATURITIES, TYPOGRAPHY } from './constants';++// Default configuration+const DEFAULT_CONFIG: SurfaceAnalyticsConfig = {+ selectedSymbol: 'SPY',+ correlationAssets: [...CORRELATION_ASSETS].slice(0, 8),+ dateRange: {+ start: new Date(Date.now() - 60 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],+ end: new Date().toISOString().split('T')[0],+ },+ refreshInterval: 0, // Manual refresh by default (cost-conscious)+ timeframe: 'ohlcv-1d', // Daily OHLCV (lowest cost)+ dataset: 'DBEQ.BASIC', // Free sample dataset+};++/**+ * API Key Setup Screen - shown when no Databento API key is configured+ * Now includes "Use Demo Data" option for users without API access+ */+const ApiKeySetupScreen: React.FC<{+ onOpenSettings: () => void;+ onUseDemoData: () => void;+ accentColor: string;+ textColor: string;+}> = ({ onOpenSettings, onUseDemoData, accentColor, textColor }) => (+ <div+ style={{+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ padding: '48px',+ backgroundColor: FINCEPT_COLORS.BLACK,+ }}+ >+ {/* Main Container */}+ <div+ style={{+ maxWidth: '560px',+ padding: '32px',+ backgroundColor: FINCEPT_COLORS.PANEL_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ textAlign: 'center',+ }}+ >+ {/* Icon */}+ <div+ style={{+ width: '64px',+ height: '64px',+ margin: '0 auto 24px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ backgroundColor: accentColor + '15',+ borderRadius: '50%',+ }}+ >+ <Database size={32} style={{ color: accentColor }} />+ </div>++ {/* Title */}+ <h2+ style={{+ fontSize: '16px',+ fontWeight: 700,+ color: textColor,+ marginBottom: '12px',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}+ >+ DATABENTO API KEY REQUIRED+ </h2>++ {/* Description */}+ <p+ style={{+ fontSize: '11px',+ color: FINCEPT_COLORS.GRAY,+ marginBottom: '24px',+ lineHeight: '1.6',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}+ >+ Surface Analytics requires a Databento API key to fetch real-time options data,+ historical prices, and market information. Databento provides institutional-grade+ market data for professional financial analysis.+ </p>++ {/* Features List */}+ <div+ style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr',+ gap: '12px',+ marginBottom: '24px',+ textAlign: 'left',+ }}+ >+ {[+ { icon: TrendingUp, label: 'Volatility Surfaces', desc: 'Options IV analysis' },+ { icon: Network, label: 'Correlation Matrix', desc: 'Multi-asset correlations' },+ { icon: Activity, label: 'Yield Curves', desc: 'Treasury rate evolution' },+ { icon: BarChart3, label: 'PCA Factors', desc: 'Factor decomposition' },+ ].map(({ icon: Icon, label, desc }) => (+ <div+ key={label}+ style={{+ display: 'flex',+ alignItems: 'flex-start',+ gap: '8px',+ padding: '8px',+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Icon size={14} style={{ color: accentColor, marginTop: '2px' }} />+ <div>+ <div style={{ fontSize: '9px', fontWeight: 700, color: textColor, letterSpacing: '0.5px' }}>+ {label}+ </div>+ <div style={{ fontSize: '9px', color: FINCEPT_COLORS.MUTED }}>+ {desc}+ </div>+ </div>+ </div>+ ))}+ </div>++ {/* Action Buttons */}+ <div style={{ display: 'flex', flexDirection: 'column', gap: '12px', alignItems: 'center' }}>+ {/* Primary action row */}+ <div style={{ display: 'flex', gap: '12px', justifyContent: 'center' }}>+ <button+ onClick={onOpenSettings}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ padding: '10px 20px',+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ fontSize: '10px',+ fontWeight: 700,+ cursor: 'pointer',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}+ >+ <Key size={14} />+ CONFIGURE API KEY+ </button>++ <a+ href="https://databento.com"+ target="_blank"+ rel="noopener noreferrer"+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '8px',+ padding: '10px 20px',+ backgroundColor: 'transparent',+ color: FINCEPT_COLORS.CYAN,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ fontSize: '10px',+ fontWeight: 700,+ cursor: 'pointer',+ textDecoration: 'none',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}+ >+ <ExternalLink size={14} />+ GET API KEY+ </a>+ </div>++ {/* Demo mode option */}+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <span style={{ fontSize: '9px', color: FINCEPT_COLORS.MUTED }}>or</span>+ <button+ onClick={onUseDemoData}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ padding: '8px 16px',+ backgroundColor: 'transparent',+ color: FINCEPT_COLORS.GREEN,+ border: `1px solid ${FINCEPT_COLORS.GREEN}50`,+ borderRadius: '2px',+ fontSize: '9px',+ fontWeight: 700,+ cursor: 'pointer',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}+ >+ <BarChart3 size={12} />+ USE DEMO DATA+ </button>+ <span style={{ fontSize: '9px', color: FINCEPT_COLORS.MUTED }}>(synthetic data for visualization)</span>+ </div>+ </div>++ {/* Cost Notice */}+ <div+ style={{+ marginTop: '20px',+ padding: '10px',+ backgroundColor: FINCEPT_COLORS.YELLOW + '10',+ border: `1px solid ${FINCEPT_COLORS.YELLOW}30`,+ borderRadius: '2px',+ display: 'flex',+ alignItems: 'flex-start',+ gap: '8px',+ }}+ >+ <AlertTriangle size={14} style={{ color: FINCEPT_COLORS.YELLOW, flexShrink: 0, marginTop: '2px' }} />+ <span style={{ fontSize: '9px', color: FINCEPT_COLORS.GRAY, textAlign: 'left' }}>+ <strong style={{ color: FINCEPT_COLORS.YELLOW }}>Note:</strong> Databento is a paid service.+ API calls consume data credits. Review their pricing at databento.com/pricing before proceeding.+ </span>+ </div>+ </div>+ </div>+);++const SurfaceAnalyticsTab: React.FC = () => {+ const { t } = useTranslation();+ const { colors, fontSize, fontFamily } = useTerminalTheme();++ // State+ const [activeChart, setActiveChart] = useState<ChartType>('volatility');+ const [lastUpdate, setLastUpdate] = useState<Date | null>(null);+ const [showSettings, setShowSettings] = useState(false);+ const [config, setConfig] = useState<SurfaceAnalyticsConfig>(DEFAULT_CONFIG);+ const [initialLoad, setInitialLoad] = useState(true);++ // Data states+ const [volatilityData, setVolatilityData] = useState<VolatilitySurfaceData | null>(null);+ const [correlationData, setCorrelationData] = useState<CorrelationMatrixData | null>(null);+ const [yieldCurveData, setYieldCurveData] = useState<YieldCurveData | null>(null);+ const [pcaData, setPcaData] = useState<PCAData | null>(null);+ const [dataError, setDataError] = useState<string | null>(null);++ // Hooks+ const { fetchOptionsChain, fetchHistoricalBars, loadApiKey, hasApiKey, loading, error: apiError } = useDatabentoApi();+ const { computeVolatilitySurface, computeCorrelationMatrix, computePCA } = useSurfaceComputation();+ const { generateVolatilitySurface, generateCorrelationMatrix, generateYieldCurve, generatePCA } = useDemoData();++ // Demo mode state - allows using synthetic data without API key+ const [isDemoMode, setIsDemoMode] = useState(false);+ const [useDemoModeExplicitly, setUseDemoModeExplicitly] = useState(false);++ // Load API key on mount+ useEffect(() => {+ const init = async () => {+ await loadApiKey();+ setInitialLoad(false);+ };+ init();+ }, [loadApiKey]);++ // Load demo data as fallback or primary mode+ const loadDemoData = useCallback((chartType?: ChartType) => {+ const targetChart = chartType || activeChart;+ setIsDemoMode(true);+ setDataError(null);++ if (targetChart === 'volatility') {+ const spotPrice = config.selectedSymbol === 'SPY' ? 450 :+ config.selectedSymbol === 'QQQ' ? 380 :+ config.selectedSymbol === 'IWM' ? 200 : 100;+ const surface = generateVolatilitySurface(config.selectedSymbol, spotPrice);+ setVolatilityData(surface);+ setLastUpdate(new Date());+ }++ if (targetChart === 'correlation') {+ const matrix = generateCorrelationMatrix(config.correlationAssets);+ setCorrelationData(matrix);+ setLastUpdate(new Date());+ }++ if (targetChart === 'yield-curve') {+ const curve = generateYieldCurve();+ setYieldCurveData(curve);+ setLastUpdate(new Date());+ }++ if (targetChart === 'pca') {+ const pca = generatePCA(config.correlationAssets);+ setPcaData(pca);+ setLastUpdate(new Date());+ }+ }, [activeChart, config.selectedSymbol, config.correlationAssets, generateVolatilitySurface, generateCorrelationMatrix, generateYieldCurve, generatePCA]);++ // Handle explicit demo mode activation from setup screen+ const handleUseDemoData = useCallback(() => {+ setUseDemoModeExplicitly(true);+ // Load all chart types for demo mode+ loadDemoData('volatility');+ // Set other data types for quick switching+ setCorrelationData(generateCorrelationMatrix(config.correlationAssets));+ setYieldCurveData(generateYieldCurve());+ setPcaData(generatePCA(config.correlationAssets));+ }, [loadDemoData, generateCorrelationMatrix, generateYieldCurve, generatePCA, config.correlationAssets]);++ // Fetch real data from Databento (with demo fallback)+ const fetchRealData = useCallback(async () => {+ if (!hasApiKey) {+ // No API key - use demo data+ loadDemoData();+ return;+ }++ setDataError(null);+ setIsDemoMode(false);++ try {+ // Fetch options chain for volatility surface+ if (activeChart === 'volatility') {+ const optionsResult = await fetchOptionsChain(config.selectedSymbol);+ if (optionsResult.error) {+ console.warn('API error, falling back to demo data:', optionsResult.message);+ loadDemoData();+ setDataError(`API Error (using demo data): ${optionsResult.message}`);+ } else if (optionsResult.data && optionsResult.data.length > 0) {+ // Get spot price from underlying data if available+ const spotPrice = optionsResult.data[0]?.spot_price || 100;+ const surface = computeVolatilitySurface(optionsResult.data, spotPrice);+ if (surface) {+ setVolatilityData(surface);+ setLastUpdate(new Date());+ } else {+ loadDemoData();+ setDataError('Failed to compute volatility surface, using demo data');+ }+ } else {+ loadDemoData();+ setDataError('No options data available, using demo data');+ }+ }++ // Fetch historical bars for correlation/PCA+ if (activeChart === 'correlation' || activeChart === 'pca') {+ const barsResult = await fetchHistoricalBars(config.correlationAssets, 60, config.timeframe || 'ohlcv-1d');+ if (barsResult.error) {+ console.warn('API error, falling back to demo data:', barsResult.message);+ loadDemoData();+ setDataError(`API Error (using demo data): ${barsResult.message}`);+ } else if (barsResult.data) {+ if (activeChart === 'correlation') {+ const matrix = computeCorrelationMatrix(barsResult.data, 30);+ if (matrix) {+ setCorrelationData(matrix);+ setLastUpdate(new Date());+ } else {+ loadDemoData();+ setDataError('Failed to compute correlation matrix, using demo data');+ }+ }+ if (activeChart === 'pca') {+ const pca = computePCA(barsResult.data);+ if (pca) {+ setPcaData(pca);+ setLastUpdate(new Date());+ } else {+ loadDemoData();+ setDataError('Failed to compute PCA factors, using demo data');+ }+ }+ } else {+ loadDemoData();+ }+ }++ // Yield curve - use demo data (FRED API not yet implemented)+ if (activeChart === 'yield-curve') {+ loadDemoData();+ setDataError('Yield curve: Using demo data (FRED API integration coming soon)');+ }++ } catch (error) {+ console.error('Failed to fetch data, falling back to demo:', error);+ loadDemoData();+ setDataError(`Error (using demo data): ${error}`);+ }+ }, [+ hasApiKey,+ activeChart,+ config.selectedSymbol,+ config.correlationAssets,+ fetchOptionsChain,+ fetchHistoricalBars,+ computeVolatilitySurface,+ computeCorrelationMatrix,+ computePCA,+ loadDemoData,+ ]);++ // Auto-refresh when API key is available and refresh interval is set+ useEffect(() => {+ if (hasApiKey && config.refreshInterval > 0) {+ const interval = setInterval(fetchRealData, config.refreshInterval);+ return () => clearInterval(interval);+ }+ }, [hasApiKey, config.refreshInterval, fetchRealData]);++ // Compute real metrics from actual data+ const currentMetrics: ChartMetric[] = useMemo(() => {+ switch (activeChart) {+ case 'volatility':+ if (!volatilityData) {+ return [+ { label: 'ATM VOL', value: '--', change: '--', positive: null },+ { label: 'SKEW', value: '--', change: '--', positive: null },+ { label: 'TERM', value: '--', change: '--', positive: null },+ { label: 'IV RANK', value: '--', change: '--', positive: null },+ ];+ }+ // Compute ATM vol (middle strike, middle expiration)+ const midExpIdx = Math.floor(volatilityData.z.length / 2);+ const midStrikeIdx = Math.floor(volatilityData.strikes.length / 2);+ const atmVol = volatilityData.z[midExpIdx]?.[midStrikeIdx] || 0;++ // Compute skew (OTM put vol - OTM call vol)+ const otmPutIdx = Math.floor(volatilityData.strikes.length * 0.2);+ const otmCallIdx = Math.floor(volatilityData.strikes.length * 0.8);+ const putVol = volatilityData.z[midExpIdx]?.[otmPutIdx] || 0;+ const callVol = volatilityData.z[midExpIdx]?.[otmCallIdx] || 0;+ const skew = putVol - callVol;++ return [+ { label: 'ATM VOL', value: `${atmVol.toFixed(1)}%`, change: '--', positive: null },+ { label: 'SKEW', value: `${skew.toFixed(1)}%`, change: skew > 0 ? 'PUT PREM' : 'CALL PREM', positive: skew < 0 },+ { label: 'SPOT', value: `$${volatilityData.spotPrice.toFixed(2)}`, change: volatilityData.underlying, positive: null },+ { label: 'OPTIONS', value: `${volatilityData.strikes.length * volatilityData.expirations.length}`, change: 'CONTRACTS', positive: null },+ ];++ case 'correlation':+ if (!correlationData) {+ return [+ { label: 'AVG CORR', value: '--', change: '--', positive: null },+ { label: 'MAX CORR', value: '--', change: '--', positive: null },+ { label: 'MIN CORR', value: '--', change: '--', positive: null },+ { label: 'ASSETS', value: '--', change: '--', positive: null },+ ];+ }+ // Compute correlation statistics from latest time point+ const latestCorr = correlationData.z[correlationData.z.length - 1] || [];+ const nonDiagonalCorrs = latestCorr.filter((_, i) => {+ const assetCount = correlationData.assets.length;+ return i % (assetCount + 1) !== 0; // Skip diagonal (self-correlation = 1)+ });+ const avgCorr = nonDiagonalCorrs.reduce((a, b) => a + b, 0) / nonDiagonalCorrs.length;+ const maxCorr = Math.max(...nonDiagonalCorrs);+ const minCorr = Math.min(...nonDiagonalCorrs);++ return [+ { label: 'AVG CORR', value: avgCorr.toFixed(3), change: avgCorr > 0.5 ? 'HIGH' : 'MODERATE', positive: avgCorr < 0.5 },+ { label: 'MAX CORR', value: maxCorr.toFixed(3), change: maxCorr > 0.8 ? 'STRONG' : 'WEAK', positive: maxCorr < 0.8 },+ { label: 'MIN CORR', value: minCorr.toFixed(3), change: minCorr < 0 ? 'NEGATIVE' : 'POSITIVE', positive: minCorr > 0 },+ { label: 'ASSETS', value: `${correlationData.assets.length}`, change: `${correlationData.window}D WINDOW`, positive: null },+ ];++ case 'yield-curve':+ if (!yieldCurveData) {+ return [+ { label: '2Y YIELD', value: '--', change: '--', positive: null },+ { label: '10Y YIELD', value: '--', change: '--', positive: null },+ { label: '2-10 SPREAD', value: '--', change: '--', positive: null },+ { label: 'CURVE', value: '--', change: '--', positive: null },+ ];+ }+ // Get latest yield curve data (last time point)+ const latestYields = yieldCurveData.z[yieldCurveData.z.length - 1] || [];+ // Find 2Y (24 months) and 10Y (120 months) indices+ const idx2Y = yieldCurveData.maturities.indexOf(24);+ const idx10Y = yieldCurveData.maturities.indexOf(120);+ const yield2Y = idx2Y >= 0 ? latestYields[idx2Y] : 0;+ const yield10Y = idx10Y >= 0 ? latestYields[idx10Y] : 0;+ const spread2_10 = yield10Y - yield2Y;++ return [+ { label: '2Y YIELD', value: `${yield2Y.toFixed(2)}%`, change: yield2Y > 4 ? 'HIGH' : 'NORMAL', positive: null },+ { label: '10Y YIELD', value: `${yield10Y.toFixed(2)}%`, change: yield10Y > 4 ? 'HIGH' : 'NORMAL', positive: null },+ { label: '2-10 SPREAD', value: `${spread2_10.toFixed(2)}%`, change: spread2_10 < 0 ? 'INVERTED' : 'NORMAL', positive: spread2_10 >= 0 },+ { label: 'CURVE', value: spread2_10 < 0 ? 'INVERTED' : 'NORMAL', change: `${yieldCurveData.maturities.length} TENORS`, positive: spread2_10 >= 0 },+ ];++ case 'pca':+ if (!pcaData) {+ return [+ { label: 'PC1 VAR', value: '--', change: '--', positive: null },+ { label: 'PC2 VAR', value: '--', change: '--', positive: null },+ { label: 'PC3 VAR', value: '--', change: '--', positive: null },+ { label: 'TOTAL', value: '--', change: '--', positive: null },+ ];+ }+ const totalVar = pcaData.varianceExplained.slice(0, 3).reduce((a, b) => a + b, 0);++ return [+ { label: 'PC1 VAR', value: `${(pcaData.varianceExplained[0] * 100).toFixed(1)}%`, change: 'DOMINANT', positive: true },+ { label: 'PC2 VAR', value: `${(pcaData.varianceExplained[1] * 100).toFixed(1)}%`, change: 'SECONDARY', positive: null },+ { label: 'PC3 VAR', value: `${(pcaData.varianceExplained[2] * 100).toFixed(1)}%`, change: 'TERTIARY', positive: null },+ { label: 'TOP 3', value: `${(totalVar * 100).toFixed(1)}%`, change: totalVar > 0.9 ? 'EXCELLENT' : 'GOOD', positive: totalVar > 0.9 },+ ];++ default:+ return [];+ }+ }, [activeChart, volatilityData, correlationData, yieldCurveData, pcaData]);++ const handleRefresh = useCallback(() => {+ if (useDemoModeExplicitly || !hasApiKey) {+ // In demo mode, regenerate synthetic data+ loadDemoData();+ } else {+ fetchRealData();+ }+ }, [useDemoModeExplicitly, hasApiKey, loadDemoData, fetchRealData]);++ const handleConfigSave = useCallback((newConfig: SurfaceAnalyticsConfig) => {+ setConfig(newConfig);+ }, []);++ const handleApiKeyChange = useCallback(() => {+ loadApiKey();+ // Clear any previous errors when API key changes+ setDataError(null);+ }, [loadApiKey]);++ // Show loading state during initial load+ if (initialLoad) {+ return (+ <div+ style={{+ height: '100%',+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ backgroundColor: FINCEPT_COLORS.BLACK,+ color: colors.text,+ fontFamily,+ }}+ >+ <RefreshCw size={32} className="animate-spin" style={{ color: colors.accent }} />+ <span style={{ marginTop: '16px', fontSize: '11px', color: FINCEPT_COLORS.MUTED }}>+ INITIALIZING SURFACE ANALYTICS...+ </span>+ </div>+ );+ }++ // Show API key setup screen when no key is configured AND user hasn't chosen demo mode+ if (!hasApiKey && !useDemoModeExplicitly) {+ return (+ <div+ style={{+ height: '100%',+ display: 'flex',+ flexDirection: 'column',+ backgroundColor: FINCEPT_COLORS.BLACK,+ color: colors.text,+ fontFamily,+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: '8px 16px',+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `2px solid ${colors.accent}`,+ boxShadow: `0 2px 8px ${colors.accent}20`,+ }}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <Database size={14} style={{ color: colors.accent }} />+ <span style={{ fontSize: '11px', fontWeight: 700, color: colors.accent, letterSpacing: '0.5px' }}>+ SURFACE ANALYTICS+ </span>+ </div>+ <button+ onClick={() => setShowSettings(true)}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ padding: '6px 12px',+ backgroundColor: colors.accent,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ fontSize: '9px',+ fontWeight: 700,+ cursor: 'pointer',+ }}+ >+ <Settings size={12} />+ SETTINGS+ </button>+ </div>++ {/* Setup Screen */}+ <ApiKeySetupScreen+ onOpenSettings={() => setShowSettings(true)}+ onUseDemoData={handleUseDemoData}+ accentColor={colors.accent}+ textColor={colors.text}+ />++ {/* Footer */}+ <div style={{ flexShrink: 0 }}>+ <TabFooter+ tabName="SURFACE ANALYTICS"+ statusInfo="API KEY REQUIRED | Configure Databento credentials or use demo data"+ />+ </div>++ {/* Settings Modal */}+ <SettingsModal+ isOpen={showSettings}+ onClose={() => setShowSettings(false)}+ config={config}+ onSave={handleConfigSave}+ onApiKeyChange={handleApiKeyChange}+ accentColor={colors.accent}+ textColor={colors.text}+ />+ </div>+ );+ }++ return (+ <div+ style={{+ height: '100%',+ display: 'flex',+ flexDirection: 'column',+ backgroundColor: FINCEPT_COLORS.BLACK,+ color: colors.text,+ fontFamily,+ overflow: 'hidden',+ }}+ >+ {/* Top Control Bar */}+ <ControlBar+ activeChart={activeChart}+ onChartChange={setActiveChart}+ onRefresh={handleRefresh}+ onSettings={() => setShowSettings(true)}+ lastUpdate={lastUpdate || new Date()}+ loading={loading}+ hasApiKey={hasApiKey}+ accentColor={colors.accent}+ textColor={colors.text}+ />++ {/* Main Content Area */}+ <div style={{ flex: 1, display: 'flex', overflow: 'hidden', minHeight: 0 }}>+ {/* Left Metrics Panel */}+ <MetricsPanel+ chartType={activeChart}+ metrics={currentMetrics}+ dataSource={isDemoMode ? 'DEMO DATA' : 'DATABENTO'}+ frequency={isDemoMode ? 'SYNTHETIC' : (config.refreshInterval > 0 ? `${config.refreshInterval / 60000}M AUTO` : 'MANUAL')}+ quality={dataError ? 'ERROR' : (isDemoMode ? 'SYNTHETIC' : (lastUpdate ? '99.8%' : 'READY'))}+ symbol={activeChart === 'volatility' ? config.selectedSymbol : undefined}+ textColor={colors.text}+ accentColor={colors.accent}+ />++ {/* 3D Chart Display */}+ <SurfaceChart+ chartType={activeChart}+ volatilityData={volatilityData}+ correlationData={correlationData}+ yieldCurveData={yieldCurveData}+ pcaData={pcaData}+ loading={loading}+ error={dataError || apiError}+ textColor={colors.text}+ accentColor={colors.accent}+ fontFamily={fontFamily}+ isDemoMode={isDemoMode}+ />+ </div>++ {/* Footer */}+ <div style={{ flexShrink: 0 }}>+ <TabFooter+ tabName="SURFACE ANALYTICS"+ statusInfo={`${activeChart.toUpperCase()} | ${currentMetrics.length} Metrics | ${isDemoMode ? 'DEMO DATA (synthetic)' : 'DATABENTO'} | ${lastUpdate ? `Updated: ${lastUpdate.toLocaleTimeString()}` : 'Click REFRESH to load data'}`}+ />+ </div>++ {/* Settings Modal */}+ <SettingsModal+ isOpen={showSettings}+ onClose={() => setShowSettings(false)}+ config={config}+ onSave={handleConfigSave}+ onApiKeyChange={handleApiKeyChange}+ accentColor={colors.accent}+ textColor={colors.text}+ />+ </div>+ );+};++export default SurfaceAnalyticsTab;diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/AdditionalSchemasPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/AdditionalSchemasPanel.tsxnew file mode 100644index 000000000..9e6582da1--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/AdditionalSchemasPanel.tsx@@ -0,0 +1,507 @@+/**+ * Surface Analytics - Additional Schemas Panel Component+ * Display TRADES, IMBALANCE, STATISTICS, and STATUS data+ */++import React, { useState, useCallback } from 'react';+import {+ RefreshCw,+ AlertCircle,+ Activity,+ BarChart3,+ FileText,+ AlertTriangle,+ TrendingUp,+ TrendingDown,+ ArrowRight,+ ChevronDown,+ ChevronUp,+} from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface TradeRecord {+ ts_event: string;+ symbol: string;+ price: number;+ size: number;+ action: string | null;+ side: string | null;+ sequence: number;+}++interface ImbalanceRecord {+ ts_event: string;+ symbol: string;+ ref_price: number;+ paired_qty: number;+ imbalance_qty: number;+ imbalance_side: string | null;+ auction_type: string | null;+}++interface StatisticsRecord {+ ts_event: string;+ symbol: string;+ stat_type: string | null;+ price: number;+ quantity: number;+ sequence: number;+ ts_ref: string | null;+}++interface StatusRecord {+ ts_event: string;+ symbol: string;+ action: string | null;+ reason: string | null;+ trading_event: string | null;+ is_short_sell_restricted: boolean | null;+}++interface AdditionalSchemasPanelProps {+ apiKey: string | null;+ symbols: string[];+ accentColor: string;+ textColor: string;+}++type SchemaType = 'trades' | 'imbalance' | 'statistics' | 'status';++const SCHEMA_TABS: { id: SchemaType; label: string; icon: React.ReactNode }[] = [+ { id: 'trades', label: 'Trades', icon: <Activity size={12} /> },+ { id: 'imbalance', label: 'Imbalance', icon: <BarChart3 size={12} /> },+ { id: 'statistics', label: 'Statistics', icon: <FileText size={12} /> },+ { id: 'status', label: 'Status', icon: <AlertTriangle size={12} /> },+];++export const AdditionalSchemasPanel: React.FC<AdditionalSchemasPanelProps> = ({+ apiKey,+ symbols,+ accentColor,+ textColor,+}) => {+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [activeSchema, setActiveSchema] = useState<SchemaType>('trades');+ const [trades, setTrades] = useState<TradeRecord[]>([]);+ const [imbalances, setImbalances] = useState<ImbalanceRecord[]>([]);+ const [statistics, setStatistics] = useState<StatisticsRecord[]>([]);+ const [statuses, setStatuses] = useState<StatusRecord[]>([]);+ const [expandedSection, setExpandedSection] = useState<string | null>(null);++ const fetchTrades = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_trades', {+ apiKey,+ symbols,+ dataset: null,+ days: 1,+ limit: 100,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setTrades(parsed.trades || []);+ }+ } catch (err) {+ setError(`Failed to fetch trades: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const fetchImbalances = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_imbalance', {+ apiKey,+ symbols,+ dataset: null,+ days: 5,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setImbalances(parsed.imbalances || []);+ }+ } catch (err) {+ setError(`Failed to fetch imbalances: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const fetchStatistics = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_statistics', {+ apiKey,+ symbols,+ dataset: null,+ days: 5,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setStatistics(parsed.statistics || []);+ }+ } catch (err) {+ setError(`Failed to fetch statistics: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const fetchStatuses = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_status', {+ apiKey,+ symbols,+ dataset: null,+ days: 5,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setStatuses(parsed.statuses || []);+ }+ } catch (err) {+ setError(`Failed to fetch statuses: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const handleSchemaChange = (schema: SchemaType) => {+ setActiveSchema(schema);+ setError(null);++ switch (schema) {+ case 'trades':+ if (trades.length === 0) fetchTrades();+ break;+ case 'imbalance':+ if (imbalances.length === 0) fetchImbalances();+ break;+ case 'statistics':+ if (statistics.length === 0) fetchStatistics();+ break;+ case 'status':+ if (statuses.length === 0) fetchStatuses();+ break;+ }+ };++ const handleRefresh = () => {+ switch (activeSchema) {+ case 'trades':+ fetchTrades();+ break;+ case 'imbalance':+ fetchImbalances();+ break;+ case 'statistics':+ fetchStatistics();+ break;+ case 'status':+ fetchStatuses();+ break;+ }+ };++ const formatPrice = (price: number): string => {+ if (!price || price === 0) return '--';+ return price.toFixed(4);+ };++ const formatTime = (ts: string): string => {+ if (!ts) return '--';+ try {+ const date = new Date(parseInt(ts) / 1000000);+ const timeStr = date.toLocaleTimeString('en-US', { hour12: false });+ const ms = date.getMilliseconds().toString().padStart(3, '0');+ return `${timeStr}.${ms}`;+ } catch {+ return ts;+ }+ };++ const formatQty = (qty: number): string => {+ if (!qty || qty === 0) return '--';+ if (qty >= 1000000) return `${(qty / 1000000).toFixed(1)}M`;+ if (qty >= 1000) return `${(qty / 1000).toFixed(1)}K`;+ return qty.toString();+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Activity size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key for additional schemas+ </div>+ </div>+ );+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ <Activity size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ ADDITIONAL SCHEMAS+ </span>+ </div>+ <button+ onClick={handleRefresh}+ disabled={loading}+ style={{ color: loading ? FINCEPT_COLORS.MUTED : accentColor }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>++ {/* Schema Tabs */}+ <div+ className="flex items-center gap-1 p-2"+ style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}+ >+ {SCHEMA_TABS.map((tab) => (+ <button+ key={tab.id}+ onClick={() => handleSchemaChange(tab.id)}+ className="flex items-center gap-1 px-2 py-1 text-[10px] font-bold"+ style={{+ backgroundColor: activeSchema === tab.id ? accentColor : FINCEPT_COLORS.BORDER,+ color: activeSchema === tab.id ? FINCEPT_COLORS.BLACK : textColor,+ borderRadius: '2px',+ }}+ >+ {tab.icon}+ {tab.label}+ </button>+ ))}+ </div>++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Content */}+ <div className="p-2 max-h-64 overflow-y-auto">+ {loading ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : (+ <>+ {/* Trades View */}+ {activeSchema === 'trades' && (+ trades.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load trades data+ </div>+ ) : (+ <div>+ <div className="grid grid-cols-5 gap-2 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div>TIME</div>+ <div>SYMBOL</div>+ <div className="text-right">PRICE</div>+ <div className="text-right">SIZE</div>+ <div className="text-right">SIDE</div>+ </div>+ {trades.slice(0, 20).map((trade, idx) => (+ <div key={idx} className="grid grid-cols-5 gap-2 py-0.5 text-[10px]">+ <div style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(trade.ts_event)}</div>+ <div style={{ color: accentColor, fontWeight: 'bold' }}>{trade.symbol}</div>+ <div className="text-right font-mono" style={{ color: FINCEPT_COLORS.WHITE }}>{formatPrice(trade.price)}</div>+ <div className="text-right" style={{ color: FINCEPT_COLORS.MUTED }}>{formatQty(trade.size)}</div>+ <div className="text-right flex items-center justify-end">+ {trade.side === 'B' || trade.side === 'BUY' ? (+ <TrendingUp size={10} style={{ color: FINCEPT_COLORS.GREEN }} />+ ) : trade.side === 'S' || trade.side === 'SELL' ? (+ <TrendingDown size={10} style={{ color: FINCEPT_COLORS.RED }} />+ ) : (+ <ArrowRight size={10} style={{ color: FINCEPT_COLORS.MUTED }} />+ )}+ </div>+ </div>+ ))}+ </div>+ )+ )}++ {/* Imbalance View */}+ {activeSchema === 'imbalance' && (+ imbalances.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load imbalance data (available at market open/close)+ </div>+ ) : (+ <div>+ <div className="grid grid-cols-5 gap-2 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div>TIME</div>+ <div>SYMBOL</div>+ <div className="text-right">REF PRICE</div>+ <div className="text-right">IMBALANCE</div>+ <div className="text-right">TYPE</div>+ </div>+ {imbalances.slice(0, 20).map((imb, idx) => (+ <div key={idx} className="grid grid-cols-5 gap-2 py-0.5 text-[10px]">+ <div style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(imb.ts_event)}</div>+ <div style={{ color: accentColor, fontWeight: 'bold' }}>{imb.symbol}</div>+ <div className="text-right font-mono" style={{ color: FINCEPT_COLORS.WHITE }}>{formatPrice(imb.ref_price)}</div>+ <div className="text-right" style={{ color: imb.imbalance_side === 'B' ? FINCEPT_COLORS.GREEN : FINCEPT_COLORS.RED }}>+ {formatQty(imb.imbalance_qty)} {imb.imbalance_side}+ </div>+ <div className="text-right" style={{ color: FINCEPT_COLORS.MUTED }}>{imb.auction_type || '--'}</div>+ </div>+ ))}+ </div>+ )+ )}++ {/* Statistics View */}+ {activeSchema === 'statistics' && (+ statistics.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load statistics (trading halts, circuit breakers)+ </div>+ ) : (+ <div>+ <div className="grid grid-cols-4 gap-2 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div>TIME</div>+ <div>SYMBOL</div>+ <div>TYPE</div>+ <div className="text-right">VALUE</div>+ </div>+ {statistics.slice(0, 20).map((stat, idx) => (+ <div key={idx} className="grid grid-cols-4 gap-2 py-0.5 text-[10px]">+ <div style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(stat.ts_event)}</div>+ <div style={{ color: accentColor, fontWeight: 'bold' }}>{stat.symbol}</div>+ <div style={{ color: FINCEPT_COLORS.YELLOW }}>{stat.stat_type || '--'}</div>+ <div className="text-right font-mono" style={{ color: FINCEPT_COLORS.WHITE }}>+ {stat.price > 0 ? formatPrice(stat.price) : formatQty(stat.quantity)}+ </div>+ </div>+ ))}+ </div>+ )+ )}++ {/* Status View */}+ {activeSchema === 'status' && (+ statuses.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load trading status (halts, Reg SHO)+ </div>+ ) : (+ <div>+ <div className="grid grid-cols-4 gap-2 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div>TIME</div>+ <div>SYMBOL</div>+ <div>ACTION</div>+ <div>REASON</div>+ </div>+ {statuses.slice(0, 20).map((status, idx) => (+ <div key={idx} className="grid grid-cols-4 gap-2 py-0.5 text-[10px]">+ <div style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(status.ts_event)}</div>+ <div style={{ color: accentColor, fontWeight: 'bold' }}>{status.symbol}</div>+ <div style={{ color: status.action === 'HALT' ? FINCEPT_COLORS.RED : FINCEPT_COLORS.GREEN }}>+ {status.action || '--'}+ </div>+ <div style={{ color: FINCEPT_COLORS.MUTED }}>{status.reason || status.trading_event || '--'}</div>+ </div>+ ))}+ {statuses.some(s => s.is_short_sell_restricted) && (+ <div className="mt-2 p-1 text-[9px]" style={{ backgroundColor: FINCEPT_COLORS.RED + '20', borderRadius: '2px', color: FINCEPT_COLORS.RED }}>+ Some symbols have Reg SHO restrictions+ </div>+ )}+ </div>+ )+ )}+ </>+ )}+ </div>++ {/* Data Count Footer */}+ <div+ className="flex items-center justify-between p-2 text-[9px]"+ style={{+ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: FINCEPT_COLORS.MUTED,+ }}+ >+ <span>Symbols: {symbols.join(', ')}</span>+ <span>+ {activeSchema === 'trades' && `${trades.length} trades`}+ {activeSchema === 'imbalance' && `${imbalances.length} imbalances`}+ {activeSchema === 'statistics' && `${statistics.length} stats`}+ {activeSchema === 'status' && `${statuses.length} statuses`}+ </span>+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/BatchDownloadPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/BatchDownloadPanel.tsxnew file mode 100644index 000000000..e6178c707--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/BatchDownloadPanel.tsx@@ -0,0 +1,675 @@+/**+ * Surface Analytics - Batch Download Panel Component+ * Submit and manage batch download jobs for large data requests+ */++import React, { useState, useCallback, useEffect } from 'react';+import {+ Download,+ RefreshCw,+ AlertCircle,+ FileDown,+ Clock,+ CheckCircle,+ Loader2,+ Archive,+ Trash2,+ ChevronRight,+ Plus,+ Info,+ Calendar,+ Database,+ FileText,+} from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface BatchJob {+ job_id: string;+ state: 'queued' | 'processing' | 'done' | 'expired';+ dataset: string;+ schema: string;+ symbols: string[];+ start: string;+ end: string;+ encoding: string;+ compression: string;+ cost: number;+ record_count: number;+ ts_received: string;+ ts_process_start: string;+ ts_process_done: string;+ size_bytes: number;+}++interface BatchFile {+ filename: string;+ size_bytes: number;+ hash: string;+ urls: Record<string, string>;+}++interface BatchDownloadPanelProps {+ apiKey: string | null;+ accentColor: string;+ textColor: string;+}++const JOB_STATE_COLORS: Record<string, string> = {+ queued: FINCEPT_COLORS.YELLOW,+ processing: FINCEPT_COLORS.CYAN,+ done: FINCEPT_COLORS.GREEN,+ expired: FINCEPT_COLORS.RED,+};++const JOB_STATE_ICONS: Record<string, React.ReactNode> = {+ queued: <Clock size={12} />,+ processing: <Loader2 size={12} className="animate-spin" />,+ done: <CheckCircle size={12} />,+ expired: <AlertCircle size={12} />,+};++const POPULAR_DATASETS = [+ { id: 'XNAS.ITCH', name: 'NASDAQ' },+ { id: 'GLBX.MDP3', name: 'CME Globex' },+ { id: 'OPRA.PILLAR', name: 'Options' },+ { id: 'DBEQ.BASIC', name: 'Sample' },+];++const SCHEMA_OPTIONS = [+ { value: 'trades', label: 'Trades' },+ { value: 'ohlcv-1d', label: 'OHLCV (Daily)' },+ { value: 'ohlcv-1h', label: 'OHLCV (Hourly)' },+ { value: 'ohlcv-1m', label: 'OHLCV (1min)' },+ { value: 'mbp-1', label: 'BBO' },+ { value: 'mbp-10', label: 'MBP-10' },+ { value: 'mbo', label: 'MBO' },+];++const ENCODING_OPTIONS = [+ { value: 'dbn', label: 'DBN (Binary)' },+ { value: 'csv', label: 'CSV' },+ { value: 'json', label: 'JSON' },+];++const COMPRESSION_OPTIONS = [+ { value: 'zstd', label: 'Zstandard' },+ { value: 'none', label: 'None' },+];++export const BatchDownloadPanel: React.FC<BatchDownloadPanelProps> = ({+ apiKey,+ accentColor,+ textColor,+}) => {+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [jobs, setJobs] = useState<BatchJob[]>([]);+ const [selectedJob, setSelectedJob] = useState<BatchJob | null>(null);+ const [jobFiles, setJobFiles] = useState<BatchFile[]>([]);+ const [showNewJobForm, setShowNewJobForm] = useState(false);+ const [downloadingJob, setDownloadingJob] = useState<string | null>(null);++ // New job form state+ const [newJobDataset, setNewJobDataset] = useState('XNAS.ITCH');+ const [newJobSymbols, setNewJobSymbols] = useState('SPY');+ const [newJobSchema, setNewJobSchema] = useState('trades');+ const [newJobStartDate, setNewJobStartDate] = useState('');+ const [newJobEndDate, setNewJobEndDate] = useState('');+ const [newJobEncoding, setNewJobEncoding] = useState('dbn');+ const [newJobCompression, setNewJobCompression] = useState('zstd');++ // Initialize dates+ useEffect(() => {+ const end = new Date();+ const start = new Date();+ start.setDate(start.getDate() - 7);+ setNewJobStartDate(start.toISOString().split('T')[0]);+ setNewJobEndDate(end.toISOString().split('T')[0]);+ }, []);++ const fetchJobs = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_batch_jobs', {+ apiKey,+ states: 'queued,processing,done',+ sinceDays: 14,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setJobs(parsed.jobs || []);+ }+ } catch (err) {+ setError(`Failed to fetch jobs: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ const fetchJobFiles = useCallback(async (jobId: string) => {+ if (!apiKey) return;++ try {+ const result = await invoke<string>('databento_list_batch_files', {+ apiKey,+ jobId,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setJobFiles(parsed.files || []);+ }+ } catch (err) {+ setError(`Failed to fetch files: ${err}`);+ }+ }, [apiKey]);++ const submitJob = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ const symbols = newJobSymbols.split(',').map((s) => s.trim().toUpperCase()).filter(Boolean);++ if (symbols.length === 0) {+ setError('Please enter at least one symbol');+ setLoading(false);+ return;+ }++ try {+ const result = await invoke<string>('databento_submit_batch_job', {+ apiKey,+ dataset: newJobDataset,+ symbols,+ schema: newJobSchema,+ startDate: newJobStartDate,+ endDate: newJobEndDate,+ encoding: newJobEncoding,+ compression: newJobCompression,+ stypeIn: 'raw_symbol',+ splitDuration: 'day',+ delivery: 'download',+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setShowNewJobForm(false);+ fetchJobs();+ }+ } catch (err) {+ setError(`Failed to submit job: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, newJobDataset, newJobSymbols, newJobSchema, newJobStartDate, newJobEndDate, newJobEncoding, newJobCompression, fetchJobs]);++ const downloadJob = useCallback(async (jobId: string) => {+ if (!apiKey) return;++ setDownloadingJob(jobId);++ try {+ const result = await invoke<string>('databento_download_batch_job', {+ apiKey,+ jobId,+ outputDir: null,+ filename: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ // Show success message with download location+ setError(null);+ alert(`Downloaded ${parsed.count} file(s) to:\n${parsed.output_dir}`);+ }+ } catch (err) {+ setError(`Failed to download: ${err}`);+ } finally {+ setDownloadingJob(null);+ }+ }, [apiKey]);++ useEffect(() => {+ if (apiKey) {+ fetchJobs();+ }+ }, [apiKey, fetchJobs]);++ const formatBytes = (bytes: number): string => {+ if (!bytes || bytes === 0) return '--';+ if (bytes >= 1073741824) return `${(bytes / 1073741824).toFixed(1)} GB`;+ if (bytes >= 1048576) return `${(bytes / 1048576).toFixed(1)} MB`;+ if (bytes >= 1024) return `${(bytes / 1024).toFixed(1)} KB`;+ return `${bytes} B`;+ };++ const formatRecordCount = (count: number): string => {+ if (!count || count === 0) return '--';+ if (count >= 1000000000) return `${(count / 1000000000).toFixed(1)}B`;+ if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;+ if (count >= 1000) return `${(count / 1000).toFixed(1)}K`;+ return count.toString();+ };++ const formatDate = (dateStr: string): string => {+ if (!dateStr) return '--';+ try {+ return new Date(dateStr).toLocaleDateString('en-US', {+ month: 'short',+ day: 'numeric',+ hour: '2-digit',+ minute: '2-digit',+ });+ } catch {+ return dateStr;+ }+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Download size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key for batch downloads+ </div>+ </div>+ );+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ <Archive size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ BATCH DOWNLOADS+ </span>+ <span className="text-[9px] px-1" style={{ backgroundColor: FINCEPT_COLORS.BORDER, color: FINCEPT_COLORS.MUTED, borderRadius: '2px' }}>+ {jobs.length}+ </span>+ </div>+ <div className="flex items-center gap-1">+ <button+ onClick={() => setShowNewJobForm(!showNewJobForm)}+ className="p-1"+ style={{ color: showNewJobForm ? FINCEPT_COLORS.GREEN : accentColor }}+ title="New Job"+ >+ <Plus size={12} />+ </button>+ <button+ onClick={fetchJobs}+ disabled={loading}+ style={{ color: loading ? FINCEPT_COLORS.MUTED : accentColor }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>+ </div>++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* New Job Form */}+ {showNewJobForm && (+ <div className="p-2" style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`, backgroundColor: FINCEPT_COLORS.BLACK }}>+ <div className="text-[10px] font-bold mb-2" style={{ color: accentColor }}>+ NEW BATCH JOB+ </div>++ <div className="grid grid-cols-2 gap-2 mb-2">+ {/* Dataset */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Dataset</label>+ <select+ value={newJobDataset}+ onChange={(e) => setNewJobDataset(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ {POPULAR_DATASETS.map((ds) => (+ <option key={ds.id} value={ds.id}>{ds.name} ({ds.id})</option>+ ))}+ </select>+ </div>++ {/* Schema */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Schema</label>+ <select+ value={newJobSchema}+ onChange={(e) => setNewJobSchema(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ {SCHEMA_OPTIONS.map((s) => (+ <option key={s.value} value={s.value}>{s.label}</option>+ ))}+ </select>+ </div>+ </div>++ {/* Symbols */}+ <div className="mb-2">+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Symbols (comma-separated)</label>+ <input+ type="text"+ value={newJobSymbols}+ onChange={(e) => setNewJobSymbols(e.target.value)}+ placeholder="SPY, QQQ, AAPL"+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ />+ </div>++ <div className="grid grid-cols-2 gap-2 mb-2">+ {/* Start Date */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Start Date</label>+ <input+ type="date"+ value={newJobStartDate}+ onChange={(e) => setNewJobStartDate(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ />+ </div>++ {/* End Date */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>End Date</label>+ <input+ type="date"+ value={newJobEndDate}+ onChange={(e) => setNewJobEndDate(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ />+ </div>+ </div>++ <div className="grid grid-cols-2 gap-2 mb-2">+ {/* Encoding */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Encoding</label>+ <select+ value={newJobEncoding}+ onChange={(e) => setNewJobEncoding(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ {ENCODING_OPTIONS.map((e) => (+ <option key={e.value} value={e.value}>{e.label}</option>+ ))}+ </select>+ </div>++ {/* Compression */}+ <div>+ <label className="text-[9px] mb-1 block" style={{ color: FINCEPT_COLORS.MUTED }}>Compression</label>+ <select+ value={newJobCompression}+ onChange={(e) => setNewJobCompression(e.target.value)}+ className="w-full text-[10px] p-1"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ {COMPRESSION_OPTIONS.map((c) => (+ <option key={c.value} value={c.value}>{c.label}</option>+ ))}+ </select>+ </div>+ </div>++ <button+ onClick={submitJob}+ disabled={loading}+ className="w-full py-1.5 text-[10px] font-bold flex items-center justify-center gap-1"+ style={{+ backgroundColor: loading ? FINCEPT_COLORS.BORDER : accentColor,+ color: FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ }}+ >+ {loading ? <Loader2 size={12} className="animate-spin" /> : <Plus size={12} />}+ SUBMIT JOB+ </button>+ </div>+ )}++ {/* Jobs List */}+ <div className="p-2">+ {loading && jobs.length === 0 ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : jobs.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ No batch jobs found. Click + to create one.+ </div>+ ) : (+ <div className="space-y-2">+ {jobs.map((job) => (+ <div+ key={job.job_id}+ className="p-2"+ style={{+ backgroundColor: selectedJob?.job_id === job.job_id ? `${accentColor}15` : FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ border: `1px solid ${selectedJob?.job_id === job.job_id ? accentColor : FINCEPT_COLORS.BORDER}`,+ }}+ >+ {/* Job Header */}+ <div className="flex items-center justify-between mb-1">+ <div className="flex items-center gap-2">+ <span style={{ color: JOB_STATE_COLORS[job.state] }}>+ {JOB_STATE_ICONS[job.state]}+ </span>+ <span className="text-[10px] font-bold" style={{ color: textColor }}>+ {job.dataset}+ </span>+ <span className="text-[9px] px-1" style={{ backgroundColor: FINCEPT_COLORS.BORDER, borderRadius: '2px', color: FINCEPT_COLORS.MUTED }}>+ {job.schema}+ </span>+ </div>+ <span className="text-[9px] font-bold" style={{ color: JOB_STATE_COLORS[job.state] }}>+ {job.state.toUpperCase()}+ </span>+ </div>++ {/* Job Details */}+ <div className="grid grid-cols-3 gap-1 text-[9px] mb-1" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div className="flex items-center gap-1">+ <FileText size={9} />+ <span>{job.symbols?.slice(0, 3).join(', ')}{job.symbols?.length > 3 ? '...' : ''}</span>+ </div>+ <div className="flex items-center gap-1">+ <Calendar size={9} />+ <span>{job.start?.substring(0, 10)}</span>+ </div>+ <div className="flex items-center gap-1">+ <Database size={9} />+ <span>{formatRecordCount(job.record_count)} records</span>+ </div>+ </div>++ {/* Job Size & Cost */}+ <div className="flex items-center justify-between">+ <div className="flex items-center gap-2 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <span>{formatBytes(job.size_bytes)}</span>+ {job.cost > 0 && (+ <span style={{ color: FINCEPT_COLORS.YELLOW }}>${job.cost.toFixed(2)}</span>+ )}+ </div>++ {/* Actions */}+ <div className="flex items-center gap-1">+ {job.state === 'done' && (+ <button+ onClick={() => downloadJob(job.job_id)}+ disabled={downloadingJob === job.job_id}+ className="p-1 text-[9px] flex items-center gap-1"+ style={{+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ }}+ >+ {downloadingJob === job.job_id ? (+ <Loader2 size={10} className="animate-spin" />+ ) : (+ <FileDown size={10} />+ )}+ Download+ </button>+ )}+ <button+ onClick={() => {+ if (selectedJob?.job_id === job.job_id) {+ setSelectedJob(null);+ setJobFiles([]);+ } else {+ setSelectedJob(job);+ if (job.state === 'done') {+ fetchJobFiles(job.job_id);+ }+ }+ }}+ className="p-1"+ style={{ color: FINCEPT_COLORS.MUTED }}+ >+ <ChevronRight+ size={12}+ style={{+ transform: selectedJob?.job_id === job.job_id ? 'rotate(90deg)' : 'none',+ transition: 'transform 0.2s',+ }}+ />+ </button>+ </div>+ </div>++ {/* Expanded Job Files */}+ {selectedJob?.job_id === job.job_id && job.state === 'done' && jobFiles.length > 0 && (+ <div className="mt-2 pt-2" style={{ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ <div className="text-[9px] mb-1" style={{ color: FINCEPT_COLORS.MUTED }}>+ FILES ({jobFiles.length})+ </div>+ <div className="space-y-1 max-h-32 overflow-y-auto">+ {jobFiles.map((file, idx) => (+ <div+ key={idx}+ className="flex items-center justify-between p-1 text-[9px]"+ style={{ backgroundColor: FINCEPT_COLORS.DARK_BG, borderRadius: '2px' }}+ >+ <span style={{ color: textColor }}>{file.filename}</span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>{formatBytes(file.size_bytes)}</span>+ </div>+ ))}+ </div>+ </div>+ )}+ </div>+ ))}+ </div>+ )}+ </div>++ {/* Info Footer */}+ <div+ className="flex items-center gap-1 p-2 text-[9px]"+ style={{+ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: FINCEPT_COLORS.MUTED,+ }}+ >+ <Info size={10} />+ <span>Jobs expire after 7 days. Download completed jobs promptly.</span>+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ControlBar.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ControlBar.tsxnew file mode 100644index 000000000..4da08d0b8--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ControlBar.tsx@@ -0,0 +1,189 @@+/**+ * Surface Analytics - Control Bar Component+ * Top navigation with chart type selection and controls+ * Follows UI Design System (UI_DESIGN_SYSTEM.md)+ */++import React from 'react';+import {+ RefreshCw,+ TrendingUp,+ Network,+ Activity,+ BarChart3,+ Settings,+ AlertCircle,+} from 'lucide-react';+import type { ChartType } from '../types';+import { FINCEPT_COLORS, TYPOGRAPHY } from '../constants';++interface ControlBarProps {+ activeChart: ChartType;+ onChartChange: (chart: ChartType) => void;+ onRefresh: () => void;+ onSettings: () => void;+ lastUpdate: Date;+ loading: boolean;+ hasApiKey: boolean;+ accentColor: string;+ textColor: string;+}++export const ControlBar: React.FC<ControlBarProps> = ({+ activeChart,+ onChartChange,+ onRefresh,+ onSettings,+ lastUpdate,+ loading,+ hasApiKey,+ accentColor,+ textColor,+}) => {+ const chartButtons = [+ { id: 'volatility' as ChartType, icon: TrendingUp, label: 'VOL SURFACE' },+ { id: 'correlation' as ChartType, icon: Network, label: 'CORRELATION' },+ { id: 'yield-curve' as ChartType, icon: Activity, label: 'YIELD CURVE' },+ { id: 'pca' as ChartType, icon: BarChart3, label: 'PCA FACTORS' },+ ];++ return (+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: '8px 16px',+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `2px solid ${accentColor}`,+ boxShadow: `0 2px 8px ${accentColor}20`,+ flexShrink: 0,+ }}+ >+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ {/* Title */}+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <BarChart3 size={14} style={{ color: accentColor }} />+ <span style={{+ fontSize: TYPOGRAPHY.HEADER_SIZE,+ fontWeight: 700,+ color: accentColor,+ letterSpacing: '0.5px',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}>+ SURFACE ANALYTICS+ </span>+ </div>++ <div style={{ height: '16px', width: '1px', backgroundColor: FINCEPT_COLORS.BORDER }} />++ {/* Chart Type Buttons - Tab style */}+ <div style={{ display: 'flex', gap: '4px' }}>+ {chartButtons.map(({ id, icon: Icon, label }) => (+ <button+ key={id}+ onClick={() => onChartChange(id)}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ padding: '6px 12px',+ backgroundColor: activeChart === id ? accentColor : 'transparent',+ color: activeChart === id ? FINCEPT_COLORS.BLACK : FINCEPT_COLORS.GRAY,+ border: 'none',+ borderRadius: '2px',+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ letterSpacing: '0.5px',+ cursor: 'pointer',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ transition: 'all 0.2s',+ }}+ >+ <Icon size={12} />+ {label}+ </button>+ ))}+ </div>+ </div>++ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ {/* API Key Warning */}+ {!hasApiKey && (+ <div style={{+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ padding: '2px 6px',+ backgroundColor: `${FINCEPT_COLORS.RED}20`,+ color: FINCEPT_COLORS.RED,+ fontSize: '8px',+ fontWeight: 700,+ borderRadius: '2px',+ }}>+ <AlertCircle size={10} />+ <span>NO API KEY</span>+ </div>+ )}++ {/* Last Update */}+ <span style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ color: FINCEPT_COLORS.GRAY,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}>+ LAST UPDATE:{' '}+ <span style={{ color: FINCEPT_COLORS.CYAN }}>+ {lastUpdate.toLocaleTimeString()}+ </span>+ </span>++ {/* Settings Button - Secondary/Outline style */}+ <button+ onClick={onSettings}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '4px',+ padding: '6px 10px',+ backgroundColor: 'transparent',+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: FINCEPT_COLORS.GRAY,+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ borderRadius: '2px',+ cursor: 'pointer',+ transition: 'all 0.2s',+ }}+ >+ <Settings size={12} />+ </button>++ {/* Refresh Button - Primary style */}+ <button+ onClick={onRefresh}+ disabled={loading}+ style={{+ display: 'flex',+ alignItems: 'center',+ gap: '6px',+ padding: '8px 16px',+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ cursor: loading ? 'not-allowed' : 'pointer',+ opacity: loading ? 0.7 : 1,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ {loading ? 'LOADING' : 'REFRESH'}+ </button>+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/CostEstimator.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/CostEstimator.tsxnew file mode 100644index 000000000..057561af1--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/CostEstimator.tsx@@ -0,0 +1,277 @@+/**+ * Surface Analytics - Cost Estimator Component+ * Estimate query costs before execution+ */++import React, { useState, useCallback } from 'react';+import { DollarSign, Calculator, AlertTriangle, CheckCircle, RefreshCw, FileText } from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface CostEstimate {+ dataset: string;+ symbols: string[];+ schema: string;+ record_count: number;+ cost_usd: number;+}++interface CostEstimatorProps {+ apiKey: string | null;+ dataset: string;+ symbols: string[];+ schema: string;+ startDate: string;+ endDate: string;+ accentColor: string;+ textColor: string;+ onEstimate?: (estimate: CostEstimate) => void;+}++// Schema descriptions+const SCHEMA_INFO: Record<string, { name: string; description: string; costLevel: 'low' | 'medium' | 'high' }> = {+ 'ohlcv-1d': { name: 'Daily OHLCV', description: 'Daily open/high/low/close/volume bars', costLevel: 'low' },+ 'ohlcv-1h': { name: 'Hourly OHLCV', description: 'Hourly bars', costLevel: 'low' },+ 'ohlcv-1m': { name: 'Minute OHLCV', description: 'Minute-level bars', costLevel: 'medium' },+ 'ohlcv-1s': { name: 'Second OHLCV', description: 'Second-level bars', costLevel: 'high' },+ 'trades': { name: 'Trades', description: 'Individual trade messages', costLevel: 'high' },+ 'mbp-1': { name: 'Top of Book', description: 'Best bid/ask quotes', costLevel: 'medium' },+ 'mbp-10': { name: '10-Level Book', description: '10 price levels', costLevel: 'high' },+ 'mbo': { name: 'Full Order Book', description: 'Every order book event', costLevel: 'high' },+ 'tbbo': { name: 'TBBO', description: 'Top BBO with trades', costLevel: 'medium' },+ 'definition': { name: 'Definitions', description: 'Instrument metadata', costLevel: 'low' },+};++export const CostEstimator: React.FC<CostEstimatorProps> = ({+ apiKey,+ dataset,+ symbols,+ schema,+ startDate,+ endDate,+ accentColor,+ textColor,+ onEstimate,+}) => {+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [estimate, setEstimate] = useState<CostEstimate | null>(null);++ const fetchEstimate = useCallback(async () => {+ if (!apiKey || !dataset || symbols.length === 0) {+ setError('Missing required parameters');+ return;+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_cost_estimate', {+ apiKey: apiKey,+ dataset: dataset,+ symbols: symbols,+ schema: schema,+ startDate: startDate,+ endDate: endDate,+ });++ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ const costEstimate: CostEstimate = {+ dataset: parsed.dataset,+ symbols: parsed.symbols,+ schema: parsed.schema,+ record_count: parsed.record_count || 0,+ cost_usd: parsed.cost_usd || 0,+ };+ setEstimate(costEstimate);+ onEstimate?.(costEstimate);+ }+ } catch (err) {+ setError(`Failed to estimate cost: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, dataset, symbols, schema, startDate, endDate, onEstimate]);++ const schemaInfo = SCHEMA_INFO[schema] || { name: schema, description: '', costLevel: 'medium' };++ const getCostLevelColor = (level: 'low' | 'medium' | 'high') => {+ switch (level) {+ case 'low': return FINCEPT_COLORS.GREEN;+ case 'medium': return FINCEPT_COLORS.YELLOW;+ case 'high': return FINCEPT_COLORS.RED;+ }+ };++ const formatCost = (cost: number) => {+ if (cost === 0) return 'FREE';+ if (cost < 0.01) return '< $0.01';+ return `$${cost.toFixed(2)}`;+ };++ const formatRecordCount = (count: number) => {+ if (count >= 1000000) return `${(count / 1000000).toFixed(1)}M`;+ if (count >= 1000) return `${(count / 1000).toFixed(1)}K`;+ return count.toString();+ };++ if (!apiKey) {+ return null;+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ padding: '12px',+ }}+ >+ {/* Header */}+ <div className="flex items-center justify-between mb-3">+ <div className="flex items-center gap-2">+ <Calculator size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor, letterSpacing: '0.5px' }}>+ COST ESTIMATOR+ </span>+ </div>+ <button+ onClick={fetchEstimate}+ disabled={loading || !dataset || symbols.length === 0}+ className="flex items-center gap-1 px-2 py-1 text-xs"+ style={{+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ opacity: loading || !dataset || symbols.length === 0 ? 0.5 : 1,+ }}+ >+ {loading ? (+ <RefreshCw size={10} className="animate-spin" />+ ) : (+ <DollarSign size={10} />+ )}+ ESTIMATE+ </button>+ </div>++ {/* Query Parameters Summary */}+ <div+ className="grid grid-cols-2 gap-2 mb-3 p-2 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Dataset: </span>+ <span style={{ color: textColor }}>{dataset || 'Not selected'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Schema: </span>+ <span style={{ color: getCostLevelColor(schemaInfo.costLevel) }}>{schemaInfo.name}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Symbols: </span>+ <span style={{ color: textColor }}>{symbols.length > 0 ? symbols.join(', ') : 'None'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Range: </span>+ <span style={{ color: textColor }}>{startDate} → {endDate}</span>+ </div>+ </div>++ {/* Cost Level Warning */}+ {schemaInfo.costLevel === 'high' && (+ <div+ className="flex items-center gap-2 mb-3 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.YELLOW}15`,+ border: `1px solid ${FINCEPT_COLORS.YELLOW}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.YELLOW,+ }}+ >+ <AlertTriangle size={12} />+ <span>High-frequency data schema - may incur significant costs</span>+ </div>+ )}++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 mb-3 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertTriangle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Estimate Result */}+ {estimate && (+ <div+ className="p-3"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.GREEN}`,+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center justify-between mb-2">+ <div className="flex items-center gap-2">+ <CheckCircle size={14} style={{ color: FINCEPT_COLORS.GREEN }} />+ <span className="text-xs font-bold" style={{ color: FINCEPT_COLORS.GREEN }}>+ ESTIMATE READY+ </span>+ </div>+ </div>++ <div className="grid grid-cols-2 gap-4">+ {/* Record Count */}+ <div className="text-center">+ <div className="flex items-center justify-center gap-1 mb-1">+ <FileText size={12} style={{ color: FINCEPT_COLORS.CYAN }} />+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ RECORDS+ </span>+ </div>+ <div className="text-lg font-bold" style={{ color: FINCEPT_COLORS.CYAN }}>+ {formatRecordCount(estimate.record_count)}+ </div>+ </div>++ {/* Cost */}+ <div className="text-center">+ <div className="flex items-center justify-center gap-1 mb-1">+ <DollarSign size={12} style={{ color: FINCEPT_COLORS.GREEN }} />+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ ESTIMATED COST+ </span>+ </div>+ <div+ className="text-lg font-bold"+ style={{ color: estimate.cost_usd === 0 ? FINCEPT_COLORS.GREEN : FINCEPT_COLORS.YELLOW }}+ >+ {formatCost(estimate.cost_usd)}+ </div>+ </div>+ </div>+ </div>+ )}+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/DatasetBrowser.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/DatasetBrowser.tsxnew file mode 100644index 000000000..2a3ad1405--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/DatasetBrowser.tsx@@ -0,0 +1,359 @@+/**+ * Surface Analytics - Dataset Browser Component+ * Browse and explore available Databento datasets+ */++import React, { useState, useEffect, useCallback } from 'react';+import { Database, ChevronRight, RefreshCw, AlertCircle, Calendar, FileText, DollarSign } from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS, TYPOGRAPHY } from '../constants';++interface DatasetInfo {+ id: string;+ name: string;+ start_date?: string;+ end_date?: string;+ schemas?: string[];+}++interface DatasetBrowserProps {+ apiKey: string | null;+ onSelectDataset?: (dataset: string) => void;+ selectedDataset?: string;+ accentColor: string;+ textColor: string;+}++// Dataset categories for organization+const DATASET_CATEGORIES: Record<string, string[]> = {+ 'US Equities': ['XNAS.ITCH', 'XNYS.PILLAR', 'XNAS.BASIC', 'DBEQ.BASIC', 'ARCX.PILLAR'],+ 'US Options': ['OPRA.PILLAR'],+ 'Futures': ['GLBX.MDP3', 'IFEU.IMPACT', 'IFUS.IMPACT'],+ 'Other': [],+};++// Dataset descriptions+const DATASET_DESCRIPTIONS: Record<string, string> = {+ 'OPRA.PILLAR': 'US equity options (all exchanges)',+ 'XNAS.ITCH': 'NASDAQ full depth order book',+ 'XNYS.PILLAR': 'NYSE full depth order book',+ 'GLBX.MDP3': 'CME Globex futures & options',+ 'DBEQ.BASIC': 'Sample equity data (free tier)',+ 'XNAS.BASIC': 'NASDAQ basic trades',+ 'ARCX.PILLAR': 'NYSE Arca equities',+ 'IFEU.IMPACT': 'ICE Futures Europe',+ 'IFUS.IMPACT': 'ICE Futures US',+};++export const DatasetBrowser: React.FC<DatasetBrowserProps> = ({+ apiKey,+ onSelectDataset,+ selectedDataset,+ accentColor,+ textColor,+}) => {+ const [datasets, setDatasets] = useState<DatasetInfo[]>([]);+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [expandedDataset, setExpandedDataset] = useState<string | null>(null);+ const [datasetDetails, setDatasetDetails] = useState<Record<string, DatasetInfo>>({});+ const [loadingDetails, setLoadingDetails] = useState<string | null>(null);++ // Fetch available datasets+ const fetchDatasets = useCallback(async () => {+ if (!apiKey) {+ setError('API key required to browse datasets');+ return;+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_datasets', {+ apiKey: apiKey,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setDatasets(parsed.datasets || []);+ }+ } catch (err) {+ setError(`Failed to fetch datasets: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ // Fetch dataset details when expanded+ const fetchDatasetDetails = useCallback(async (dataset: string) => {+ if (!apiKey || datasetDetails[dataset]) return;++ setLoadingDetails(dataset);++ try {+ const result = await invoke<string>('databento_get_dataset_info', {+ apiKey: apiKey,+ dataset: dataset,+ });+ const parsed = JSON.parse(result);++ if (!parsed.error) {+ setDatasetDetails(prev => ({+ ...prev,+ [dataset]: parsed,+ }));+ }+ } catch (err) {+ console.error(`Failed to fetch details for ${dataset}:`, err);+ } finally {+ setLoadingDetails(null);+ }+ }, [apiKey, datasetDetails]);++ // Load datasets on mount+ useEffect(() => {+ if (apiKey) {+ fetchDatasets();+ }+ }, [apiKey, fetchDatasets]);++ // Handle dataset expansion+ const handleToggleExpand = (dataset: string) => {+ if (expandedDataset === dataset) {+ setExpandedDataset(null);+ } else {+ setExpandedDataset(dataset);+ fetchDatasetDetails(dataset);+ }+ };++ // Categorize datasets+ const categorizedDatasets = () => {+ const result: Record<string, DatasetInfo[]> = {};+ const usedIds = new Set<string>();++ // Categorize known datasets+ for (const [category, knownIds] of Object.entries(DATASET_CATEGORIES)) {+ result[category] = datasets.filter(d => {+ const isInCategory = knownIds.some(known => d.id.includes(known) || d.name.includes(known));+ if (isInCategory) {+ usedIds.add(d.id);+ }+ return isInCategory;+ });+ }++ // Add uncategorized to "Other"+ result['Other'] = datasets.filter(d => !usedIds.has(d.id));++ return result;+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Database size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key to browse datasets+ </div>+ </div>+ );+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ <Database size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ AVAILABLE DATASETS+ </span>+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ ({datasets.length})+ </span>+ </div>+ <button+ onClick={fetchDatasets}+ disabled={loading}+ style={{ color: FINCEPT_COLORS.MUTED }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>++ {/* Content */}+ <div className="max-h-64 overflow-y-auto p-2">+ {error ? (+ <div className="flex items-center gap-2 p-2 text-xs" style={{ color: FINCEPT_COLORS.RED }}>+ <AlertCircle size={14} />+ {error}+ </div>+ ) : loading ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : datasets.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ No datasets available+ </div>+ ) : (+ Object.entries(categorizedDatasets()).map(([category, categoryDatasets]) => {+ if (categoryDatasets.length === 0) return null;++ return (+ <div key={category} className="mb-3">+ <div+ className="text-xs font-bold mb-1 px-1"+ style={{ color: FINCEPT_COLORS.MUTED, letterSpacing: '0.5px' }}+ >+ {category.toUpperCase()}+ </div>++ {categoryDatasets.map(dataset => {+ const isExpanded = expandedDataset === dataset.id;+ const isSelected = selectedDataset === dataset.id;+ const details = datasetDetails[dataset.id];+ const description = DATASET_DESCRIPTIONS[dataset.id] || dataset.name;++ return (+ <div+ key={dataset.id}+ style={{+ backgroundColor: isSelected ? `${accentColor}20` : FINCEPT_COLORS.BLACK,+ border: `1px solid ${isSelected ? accentColor : FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ marginBottom: '4px',+ }}+ >+ {/* Dataset Row */}+ <div+ className="flex items-center justify-between p-2 cursor-pointer"+ onClick={() => handleToggleExpand(dataset.id)}+ >+ <div className="flex items-center gap-2">+ <ChevronRight+ size={12}+ style={{+ color: FINCEPT_COLORS.MUTED,+ transform: isExpanded ? 'rotate(90deg)' : 'none',+ transition: 'transform 0.2s',+ }}+ />+ <span className="text-xs font-bold" style={{ color: textColor }}>+ {dataset.id}+ </span>+ </div>+ <button+ onClick={(e) => {+ e.stopPropagation();+ onSelectDataset?.(dataset.id);+ }}+ className="px-2 py-0.5 text-xs"+ style={{+ backgroundColor: isSelected ? accentColor : 'transparent',+ color: isSelected ? FINCEPT_COLORS.BLACK : accentColor,+ border: `1px solid ${accentColor}`,+ borderRadius: '2px',+ }}+ >+ {isSelected ? 'SELECTED' : 'SELECT'}+ </button>+ </div>++ {/* Dataset Details (expanded) */}+ {isExpanded && (+ <div+ className="px-2 pb-2"+ style={{ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}` }}+ >+ <div className="text-xs mt-2 mb-2" style={{ color: FINCEPT_COLORS.MUTED }}>+ {description}+ </div>++ {loadingDetails === dataset.id ? (+ <div className="flex items-center gap-2 text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ <RefreshCw size={10} className="animate-spin" />+ Loading details...+ </div>+ ) : details ? (+ <div className="grid grid-cols-2 gap-2 text-xs">+ {details.start_date && (+ <div className="flex items-center gap-1" style={{ color: FINCEPT_COLORS.CYAN }}>+ <Calendar size={10} />+ <span>From: {details.start_date}</span>+ </div>+ )}+ {details.end_date && (+ <div className="flex items-center gap-1" style={{ color: FINCEPT_COLORS.CYAN }}>+ <Calendar size={10} />+ <span>To: {details.end_date}</span>+ </div>+ )}+ {details.schemas && details.schemas.length > 0 && (+ <div className="col-span-2">+ <div className="flex items-center gap-1 mb-1" style={{ color: FINCEPT_COLORS.GREEN }}>+ <FileText size={10} />+ <span>Schemas:</span>+ </div>+ <div className="flex flex-wrap gap-1">+ {details.schemas.slice(0, 8).map(schema => (+ <span+ key={schema}+ className="px-1 py-0.5"+ style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ color: textColor,+ fontSize: '9px',+ borderRadius: '2px',+ }}+ >+ {schema}+ </span>+ ))}+ {details.schemas.length > 8 && (+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ +{details.schemas.length - 8} more+ </span>+ )}+ </div>+ </div>+ )}+ </div>+ ) : null}+ </div>+ )}+ </div>+ );+ })}+ </div>+ );+ })+ )}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/FuturesPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/FuturesPanel.tsxnew file mode 100644index 000000000..d8fff0f63--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/FuturesPanel.tsx@@ -0,0 +1,383 @@+/**+ * Surface Analytics - Futures Panel Component+ * Display CME futures data with SMART symbology (GLBX.MDP3)+ */++import React, { useState, useCallback, useEffect } from 'react';+import {+ TrendingUp,+ TrendingDown,+ RefreshCw,+ AlertCircle,+ LineChart,+ Info,+ ChevronRight,+} from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface FuturesContract {+ symbol: string;+ smart_symbol: string;+ name: string;+ exchange: string;+ tick_size: number;+ multiplier: number;+}++interface TermStructurePoint {+ contract_month: number;+ smart_symbol: string;+ close: number;+ volume: number;+}++interface FuturesPanelProps {+ apiKey: string | null;+ accentColor: string;+ textColor: string;+}++const POPULAR_FUTURES = [+ { symbol: 'ES', name: 'E-mini S&P 500', category: 'Index' },+ { symbol: 'NQ', name: 'E-mini NASDAQ', category: 'Index' },+ { symbol: 'CL', name: 'Crude Oil', category: 'Energy' },+ { symbol: 'GC', name: 'Gold', category: 'Metals' },+ { symbol: 'ZN', name: '10-Year T-Note', category: 'Rates' },+ { symbol: '6E', name: 'Euro FX', category: 'Currency' },+];++export const FuturesPanel: React.FC<FuturesPanelProps> = ({+ apiKey,+ accentColor,+ textColor,+}) => {+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [selectedFuture, setSelectedFuture] = useState('ES');+ const [contracts, setContracts] = useState<FuturesContract[]>([]);+ const [termStructure, setTermStructure] = useState<TermStructurePoint[]>([]);+ const [showAllContracts, setShowAllContracts] = useState(false);++ const fetchContracts = useCallback(async () => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_futures', {+ apiKey,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setContracts(parsed.contracts || []);+ }+ } catch (err) {+ setError(`Failed to fetch contracts: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ const fetchTermStructure = useCallback(async (rootSymbol: string) => {+ if (!apiKey) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_futures_term_structure', {+ apiKey,+ rootSymbol,+ numContracts: 8,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setTermStructure(parsed.term_structure || []);+ }+ } catch (err) {+ setError(`Failed to fetch term structure: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ useEffect(() => {+ if (apiKey) {+ fetchContracts();+ }+ }, [apiKey, fetchContracts]);++ const formatPrice = (price: number): string => {+ if (!price || price === 0) return '--';+ if (price >= 1000) return price.toFixed(2);+ if (price >= 100) return price.toFixed(3);+ return price.toFixed(4);+ };++ const formatVolume = (volume: number): string => {+ if (!volume || volume === 0) return '--';+ if (volume >= 1000000) return `${(volume / 1000000).toFixed(1)}M`;+ if (volume >= 1000) return `${(volume / 1000).toFixed(1)}K`;+ return volume.toString();+ };++ const getContango = (): { isContango: boolean; spread: number } | null => {+ if (termStructure.length < 2) return null;+ const front = termStructure[0]?.close || 0;+ const back = termStructure[termStructure.length - 1]?.close || 0;+ if (!front || !back) return null;+ return {+ isContango: back > front,+ spread: ((back - front) / front) * 100,+ };+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <LineChart size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key for futures data+ </div>+ </div>+ );+ }++ const contango = getContango();++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ <LineChart size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ FUTURES (CME GLOBEX)+ </span>+ </div>+ <button+ onClick={fetchContracts}+ disabled={loading}+ style={{ color: loading ? FINCEPT_COLORS.MUTED : accentColor }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>++ {/* Popular Futures Selector */}+ <div className="flex flex-wrap items-center gap-1 p-2" style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>Popular:</span>+ {POPULAR_FUTURES.map((f) => (+ <button+ key={f.symbol}+ onClick={() => {+ setSelectedFuture(f.symbol);+ fetchTermStructure(f.symbol);+ }}+ className="px-2 py-0.5 text-[9px] font-bold"+ style={{+ backgroundColor: selectedFuture === f.symbol ? accentColor : FINCEPT_COLORS.BORDER,+ color: selectedFuture === f.symbol ? FINCEPT_COLORS.BLACK : textColor,+ borderRadius: '2px',+ }}+ title={f.name}+ >+ {f.symbol}+ </button>+ ))}+ </div>++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Term Structure */}+ <div className="p-2">+ {loading ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : termStructure.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click a futures symbol to view term structure+ </div>+ ) : (+ <div>+ {/* Market Structure Info */}+ {contango && (+ <div+ className="flex items-center justify-between mb-2 p-2 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center gap-2">+ {contango.isContango ? (+ <TrendingUp size={12} style={{ color: FINCEPT_COLORS.YELLOW }} />+ ) : (+ <TrendingDown size={12} style={{ color: FINCEPT_COLORS.CYAN }} />+ )}+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Market Structure:</span>+ <span+ style={{+ color: contango.isContango ? FINCEPT_COLORS.YELLOW : FINCEPT_COLORS.CYAN,+ fontWeight: 'bold',+ }}+ >+ {contango.isContango ? 'CONTANGO' : 'BACKWARDATION'}+ </span>+ </div>+ <span style={{ color: contango.isContango ? FINCEPT_COLORS.YELLOW : FINCEPT_COLORS.CYAN }}>+ {contango.spread > 0 ? '+' : ''}{contango.spread.toFixed(2)}%+ </span>+ </div>+ )}++ {/* Header Row */}+ <div className="grid grid-cols-4 gap-2 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div>CONTRACT</div>+ <div className="text-right">PRICE</div>+ <div className="text-right">VOLUME</div>+ <div className="text-right">SPREAD</div>+ </div>++ {/* Term Structure Rows */}+ {termStructure.map((point, idx) => {+ const prevClose = idx > 0 ? termStructure[idx - 1]?.close || 0 : point.close;+ const spread = prevClose ? ((point.close - prevClose) / prevClose) * 100 : 0;++ return (+ <div+ key={point.smart_symbol}+ className="grid grid-cols-4 gap-2 py-1 text-[10px]"+ style={{+ backgroundColor: idx === 0 ? `${accentColor}15` : 'transparent',+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center gap-1">+ {idx === 0 && <ChevronRight size={10} style={{ color: accentColor }} />}+ <span style={{ color: idx === 0 ? accentColor : textColor, fontWeight: idx === 0 ? 'bold' : 'normal' }}>+ {point.smart_symbol}+ </span>+ {idx === 0 && (+ <span className="text-[8px] px-1" style={{ backgroundColor: accentColor, color: FINCEPT_COLORS.BLACK, borderRadius: '2px' }}>+ FRONT+ </span>+ )}+ </div>+ <div className="text-right font-mono" style={{ color: FINCEPT_COLORS.WHITE }}>+ {formatPrice(point.close)}+ </div>+ <div className="text-right" style={{ color: FINCEPT_COLORS.MUTED }}>+ {formatVolume(point.volume)}+ </div>+ <div+ className="text-right font-mono"+ style={{+ color: idx === 0 ? FINCEPT_COLORS.MUTED : spread > 0 ? FINCEPT_COLORS.GREEN : spread < 0 ? FINCEPT_COLORS.RED : FINCEPT_COLORS.MUTED,+ }}+ >+ {idx === 0 ? '--' : `${spread > 0 ? '+' : ''}${spread.toFixed(3)}%`}+ </div>+ </div>+ );+ })}+ </div>+ )}+ </div>++ {/* All Contracts Section */}+ <div style={{ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ <button+ onClick={() => setShowAllContracts(!showAllContracts)}+ className="flex items-center justify-between w-full p-2 text-[10px]"+ style={{ color: FINCEPT_COLORS.MUTED }}+ >+ <div className="flex items-center gap-1">+ <Info size={10} />+ <span>Available Contracts ({contracts.length})</span>+ </div>+ <ChevronRight+ size={12}+ style={{+ transform: showAllContracts ? 'rotate(90deg)' : 'none',+ transition: 'transform 0.2s',+ }}+ />+ </button>++ {showAllContracts && (+ <div className="p-2 max-h-48 overflow-y-auto" style={{ backgroundColor: FINCEPT_COLORS.BLACK }}>+ <div className="grid grid-cols-3 gap-1">+ {contracts.map((c) => (+ <button+ key={c.symbol}+ onClick={() => {+ setSelectedFuture(c.symbol);+ fetchTermStructure(c.symbol);+ setShowAllContracts(false);+ }}+ className="text-left p-1 text-[9px]"+ style={{+ backgroundColor: selectedFuture === c.symbol ? `${accentColor}30` : 'transparent',+ borderRadius: '2px',+ }}+ title={`${c.name} (${c.exchange})`}+ >+ <div className="font-bold" style={{ color: selectedFuture === c.symbol ? accentColor : textColor }}>+ {c.symbol}+ </div>+ <div style={{ color: FINCEPT_COLORS.MUTED, fontSize: '8px' }}>+ {c.name.length > 15 ? c.name.substring(0, 15) + '...' : c.name}+ </div>+ </button>+ ))}+ </div>+ </div>+ )}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/LiveStreamPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/LiveStreamPanel.tsxnew file mode 100644index 000000000..a81cc78c4--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/LiveStreamPanel.tsx@@ -0,0 +1,550 @@+/**+ * Surface Analytics - Live Stream Panel Component+ * Real-time market data streaming from Databento+ */++import React, { useState, useCallback, useRef, useEffect } from 'react';+import {+ Radio,+ Play,+ Square,+ AlertCircle,+ Wifi,+ WifiOff,+ Activity,+ TrendingUp,+ TrendingDown,+ Clock,+ Trash2,+} from 'lucide-react';+import { FINCEPT_COLORS } from '../constants';++interface LiveStreamRecord {+ type: 'data' | 'status' | 'error' | 'info';+ timestamp: number;+ record?: {+ record_type: string;+ ts_event: string;+ symbol: string;+ schema: string;+ price?: number;+ size?: number;+ side?: string;+ levels?: Array<{+ bid_px: number;+ ask_px: number;+ bid_sz: number;+ ask_sz: number;+ }>;+ [key: string]: unknown;+ };+ message?: string;+ connected?: boolean;+}++interface LiveStreamPanelProps {+ apiKey: string | null;+ symbols: string[];+ accentColor: string;+ textColor: string;+ onStartStream: (+ dataset: string,+ schema: string,+ symbols: string[],+ callback: (record: LiveStreamRecord) => void,+ options?: { stypeIn?: string; snapshot?: boolean }+ ) => Promise<{ streamId: string } | { error: true; message: string }>;+ onStopStream: (streamId: string) => Promise<unknown>;+ onStopAllStreams: () => Promise<unknown>;+ activeStreams: string[];+}++const LIVE_DATASETS = [+ { id: 'XNAS.ITCH', name: 'NASDAQ', description: 'NASDAQ TotalView ITCH' },+ { id: 'XNYS.PILLAR', name: 'NYSE', description: 'NYSE Pillar' },+ { id: 'GLBX.MDP3', name: 'CME', description: 'CME Globex MDP 3.0' },+ { id: 'OPRA.PILLAR', name: 'Options', description: 'US Options OPRA' },+ { id: 'DBEQ.BASIC', name: 'Sample', description: 'Free Sample Data' },+];++const LIVE_SCHEMAS = [+ { id: 'trades', name: 'Trades', description: 'Trade executions' },+ { id: 'mbp-1', name: 'BBO', description: 'Best bid/offer' },+ { id: 'mbp-10', name: 'Depth', description: '10-level depth' },+ { id: 'tbbo', name: 'TBBO', description: 'Top BBO consolidated' },+ { id: 'ohlcv-1s', name: '1s Bars', description: '1-second OHLCV' },+ { id: 'ohlcv-1m', name: '1m Bars', description: '1-minute OHLCV' },+];++const MAX_RECORDS = 100;++export const LiveStreamPanel: React.FC<LiveStreamPanelProps> = ({+ apiKey,+ symbols,+ accentColor,+ textColor,+ onStartStream,+ onStopStream,+ onStopAllStreams,+ activeStreams,+}) => {+ const [selectedDataset, setSelectedDataset] = useState('XNAS.ITCH');+ const [selectedSchema, setSelectedSchema] = useState('trades');+ const [selectedSymbol, setSelectedSymbol] = useState(symbols[0] || 'SPY');+ const [customSymbol, setCustomSymbol] = useState('');+ const [isConnected, setIsConnected] = useState(false);+ const [isConnecting, setIsConnecting] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [records, setRecords] = useState<LiveStreamRecord[]>([]);+ const [recordCount, setRecordCount] = useState(0);+ const [currentStreamId, setCurrentStreamId] = useState<string | null>(null);++ const recordsContainerRef = useRef<HTMLDivElement>(null);++ // Auto-scroll to bottom when new records arrive+ useEffect(() => {+ if (recordsContainerRef.current) {+ recordsContainerRef.current.scrollTop = recordsContainerRef.current.scrollHeight;+ }+ }, [records]);++ const handleStreamData = useCallback((record: LiveStreamRecord) => {+ if (record.type === 'status') {+ setIsConnected(record.connected ?? false);+ if (!record.connected) {+ setIsConnecting(false);+ }+ } else if (record.type === 'error') {+ setError(record.message || 'Unknown error');+ setIsConnecting(false);+ } else if (record.type === 'data') {+ setRecordCount((prev) => prev + 1);+ setRecords((prev) => {+ const newRecords = [...prev, record];+ // Keep only the last MAX_RECORDS+ if (newRecords.length > MAX_RECORDS) {+ return newRecords.slice(-MAX_RECORDS);+ }+ return newRecords;+ });+ }+ }, []);++ const startStream = useCallback(async () => {+ if (!apiKey) return;++ setIsConnecting(true);+ setError(null);+ setRecords([]);+ setRecordCount(0);++ const symbolToUse = customSymbol.trim() || selectedSymbol;+ const result = await onStartStream(+ selectedDataset,+ selectedSchema,+ [symbolToUse],+ handleStreamData,+ { snapshot: false }+ );++ if ('error' in result && result.error) {+ setError(result.message);+ setIsConnecting(false);+ } else if ('streamId' in result) {+ setCurrentStreamId(result.streamId);+ }+ }, [apiKey, selectedDataset, selectedSchema, selectedSymbol, customSymbol, onStartStream, handleStreamData]);++ const stopStream = useCallback(async () => {+ if (currentStreamId) {+ await onStopStream(currentStreamId);+ setCurrentStreamId(null);+ setIsConnected(false);+ }+ }, [currentStreamId, onStopStream]);++ const clearRecords = useCallback(() => {+ setRecords([]);+ setRecordCount(0);+ }, []);++ const formatPrice = (price: number | undefined): string => {+ if (price === undefined || price === 0) return '--';+ return price.toFixed(4);+ };++ const formatSize = (size: number | undefined): string => {+ if (size === undefined || size === 0) return '--';+ if (size >= 1000000) return `${(size / 1000000).toFixed(1)}M`;+ if (size >= 1000) return `${(size / 1000).toFixed(1)}K`;+ return size.toString();+ };++ const formatTime = (ts: string | number): string => {+ if (!ts) return '--:--:--';+ const date = new Date(typeof ts === 'string' ? parseInt(ts) / 1000000 : ts);+ const timeStr = date.toLocaleTimeString('en-US', { hour12: false });+ const ms = date.getMilliseconds().toString().padStart(3, '0');+ return `${timeStr}.${ms}`;+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Radio size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key for live streaming+ </div>+ </div>+ );+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ {isConnected ? (+ <Wifi size={14} style={{ color: FINCEPT_COLORS.GREEN }} />+ ) : (+ <WifiOff size={14} style={{ color: FINCEPT_COLORS.MUTED }} />+ )}+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ LIVE STREAM+ </span>+ {isConnected && (+ <span className="text-[9px] px-1" style={{ color: FINCEPT_COLORS.GREEN, backgroundColor: `${FINCEPT_COLORS.GREEN}20`, borderRadius: '2px' }}>+ CONNECTED+ </span>+ )}+ </div>+ <div className="flex items-center gap-2">+ <Activity size={12} style={{ color: isConnected ? FINCEPT_COLORS.GREEN : FINCEPT_COLORS.MUTED }} />+ <span className="text-[10px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ {recordCount} msgs+ </span>+ </div>+ </div>++ {/* Controls */}+ <div className="p-2 space-y-2" style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ {/* Dataset Selection */}+ <div className="flex items-center gap-1 flex-wrap">+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED, width: '45px' }}>Dataset:</span>+ {LIVE_DATASETS.slice(0, 4).map((ds) => (+ <button+ key={ds.id}+ onClick={() => setSelectedDataset(ds.id)}+ disabled={isConnected}+ className="px-2 py-0.5 text-[9px]"+ style={{+ backgroundColor: selectedDataset === ds.id ? accentColor : FINCEPT_COLORS.BORDER,+ color: selectedDataset === ds.id ? FINCEPT_COLORS.BLACK : textColor,+ borderRadius: '2px',+ opacity: isConnected ? 0.5 : 1,+ }}+ title={ds.description}+ >+ {ds.name}+ </button>+ ))}+ </div>++ {/* Schema Selection */}+ <div className="flex items-center gap-1 flex-wrap">+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED, width: '45px' }}>Schema:</span>+ {LIVE_SCHEMAS.map((schema) => (+ <button+ key={schema.id}+ onClick={() => setSelectedSchema(schema.id)}+ disabled={isConnected}+ className="px-2 py-0.5 text-[9px]"+ style={{+ backgroundColor: selectedSchema === schema.id ? FINCEPT_COLORS.BORDER : 'transparent',+ color: selectedSchema === schema.id ? textColor : FINCEPT_COLORS.MUTED,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ opacity: isConnected ? 0.5 : 1,+ }}+ title={schema.description}+ >+ {schema.name}+ </button>+ ))}+ </div>++ {/* Symbol Input */}+ <div className="flex items-center gap-2">+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED, width: '45px' }}>Symbol:</span>+ <div className="flex items-center gap-1">+ {symbols.slice(0, 3).map((sym) => (+ <button+ key={sym}+ onClick={() => {+ setSelectedSymbol(sym);+ setCustomSymbol('');+ }}+ disabled={isConnected}+ className="px-2 py-0.5 text-[9px] font-bold"+ style={{+ backgroundColor: selectedSymbol === sym && !customSymbol ? accentColor : FINCEPT_COLORS.BORDER,+ color: selectedSymbol === sym && !customSymbol ? FINCEPT_COLORS.BLACK : textColor,+ borderRadius: '2px',+ opacity: isConnected ? 0.5 : 1,+ }}+ >+ {sym}+ </button>+ ))}+ </div>+ <input+ type="text"+ value={customSymbol}+ onChange={(e) => setCustomSymbol(e.target.value.toUpperCase())}+ placeholder="Custom..."+ disabled={isConnected}+ className="px-2 py-0.5 text-[10px] w-20"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: textColor,+ opacity: isConnected ? 0.5 : 1,+ }}+ />+ </div>++ {/* Start/Stop Buttons */}+ <div className="flex items-center gap-2">+ {!isConnected ? (+ <button+ onClick={startStream}+ disabled={isConnecting}+ className="flex items-center gap-1 px-3 py-1 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.GREEN,+ color: FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ opacity: isConnecting ? 0.5 : 1,+ }}+ >+ <Play size={12} />+ {isConnecting ? 'Connecting...' : 'Start Stream'}+ </button>+ ) : (+ <button+ onClick={stopStream}+ className="flex items-center gap-1 px-3 py-1 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.RED,+ color: FINCEPT_COLORS.WHITE,+ borderRadius: '2px',+ }}+ >+ <Square size={12} />+ Stop Stream+ </button>+ )}++ <button+ onClick={clearRecords}+ className="flex items-center gap-1 px-2 py-1 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ <Trash2 size={10} />+ Clear+ </button>++ {activeStreams.length > 1 && (+ <button+ onClick={onStopAllStreams}+ className="px-2 py-1 text-[9px]"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}30`,+ color: FINCEPT_COLORS.RED,+ borderRadius: '2px',+ }}+ >+ Stop All ({activeStreams.length})+ </button>+ )}+ </div>+ </div>++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Live Data Feed */}+ <div+ ref={recordsContainerRef}+ className="p-2 overflow-y-auto"+ style={{+ maxHeight: '300px',+ minHeight: '150px',+ }}+ >+ {records.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ {isConnected ? 'Waiting for data...' : 'Click Start Stream to begin receiving live data'}+ </div>+ ) : (+ <div className="space-y-1">+ {records.map((record, idx) => (+ <RecordRow key={idx} record={record} formatPrice={formatPrice} formatSize={formatSize} formatTime={formatTime} />+ ))}+ </div>+ )}+ </div>++ {/* Footer Stats */}+ {isConnected && (+ <div+ className="flex items-center justify-between p-2 text-[9px]"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}`,+ color: FINCEPT_COLORS.MUTED,+ }}+ >+ <div className="flex items-center gap-2">+ <Clock size={10} />+ <span>Live</span>+ </div>+ <div>+ {recordCount} messages | Buffer: {records.length}/{MAX_RECORDS}+ </div>+ </div>+ )}+ </div>+ );+};++// Record Row Component+const RecordRow: React.FC<{+ record: LiveStreamRecord;+ formatPrice: (p: number | undefined) => string;+ formatSize: (s: number | undefined) => string;+ formatTime: (t: string | number) => string;+}> = ({ record, formatPrice, formatSize, formatTime }) => {+ if (record.type !== 'data' || !record.record) return null;++ const { record: data } = record;+ const isBuy = data.side === 'B' || data.side === 'BUY';+ const isSell = data.side === 'A' || data.side === 'S' || data.side === 'SELL';++ // Trade record+ if (data.schema === 'trades') {+ return (+ <div+ className="flex items-center justify-between py-0.5 px-1 text-[10px]"+ style={{+ backgroundColor: isBuy ? `${FINCEPT_COLORS.GREEN}10` : isSell ? `${FINCEPT_COLORS.RED}10` : 'transparent',+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center gap-2">+ {isBuy ? (+ <TrendingUp size={10} style={{ color: FINCEPT_COLORS.GREEN }} />+ ) : isSell ? (+ <TrendingDown size={10} style={{ color: FINCEPT_COLORS.RED }} />+ ) : (+ <Activity size={10} style={{ color: FINCEPT_COLORS.MUTED }} />+ )}+ <span className="font-bold" style={{ color: FINCEPT_COLORS.CYAN }}>{data.symbol}</span>+ </div>+ <div className="flex items-center gap-3">+ <span style={{ color: isBuy ? FINCEPT_COLORS.GREEN : isSell ? FINCEPT_COLORS.RED : FINCEPT_COLORS.WHITE }}>+ {formatPrice(data.price)}+ </span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>{formatSize(data.size)}</span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(data.ts_event)}</span>+ </div>+ </div>+ );+ }++ // Quote/BBO record+ if (data.schema === 'mbp' || data.schema === 'tbbo') {+ const level = data.levels?.[0];+ if (!level) return null;++ return (+ <div+ className="flex items-center justify-between py-0.5 px-1 text-[10px]"+ style={{ backgroundColor: `${FINCEPT_COLORS.BORDER}50`, borderRadius: '2px' }}+ >+ <span className="font-bold" style={{ color: FINCEPT_COLORS.CYAN }}>{data.symbol}</span>+ <div className="flex items-center gap-2">+ <span style={{ color: FINCEPT_COLORS.GREEN }}>{formatPrice(level.bid_px)}</span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>×</span>+ <span style={{ color: FINCEPT_COLORS.RED }}>{formatPrice(level.ask_px)}</span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>{formatTime(data.ts_event)}</span>+ </div>+ </div>+ );+ }++ // OHLCV record+ if (data.schema === 'ohlcv') {+ const ohlcv = data as { open?: number; high?: number; low?: number; close?: number; volume?: number } & typeof data;+ return (+ <div+ className="flex items-center justify-between py-0.5 px-1 text-[10px]"+ style={{ backgroundColor: `${FINCEPT_COLORS.BORDER}30`, borderRadius: '2px' }}+ >+ <span className="font-bold" style={{ color: FINCEPT_COLORS.CYAN }}>{data.symbol}</span>+ <div className="flex items-center gap-2 font-mono">+ <span style={{ color: FINCEPT_COLORS.MUTED }}>O:{formatPrice(ohlcv.open)}</span>+ <span style={{ color: FINCEPT_COLORS.GREEN }}>H:{formatPrice(ohlcv.high)}</span>+ <span style={{ color: FINCEPT_COLORS.RED }}>L:{formatPrice(ohlcv.low)}</span>+ <span style={{ color: FINCEPT_COLORS.WHITE }}>C:{formatPrice(ohlcv.close)}</span>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>V:{formatSize(ohlcv.volume)}</span>+ </div>+ </div>+ );+ }++ // Generic record+ return (+ <div className="py-0.5 px-1 text-[10px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ {data.symbol}: {data.record_type}+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/MetricsPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/MetricsPanel.tsxnew file mode 100644index 000000000..7b4bad7b8--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/MetricsPanel.tsx@@ -0,0 +1,235 @@+/**+ * Surface Analytics - Metrics Panel Component+ * Left sidebar with key metrics and data info+ * Follows UI Design System (UI_DESIGN_SYSTEM.md)+ */++import React from 'react';+import type { ChartMetric, ChartType } from '../types';+import { FINCEPT_COLORS, TYPOGRAPHY } from '../constants';++interface MetricsPanelProps {+ chartType: ChartType;+ metrics: ChartMetric[];+ dataSource: string;+ frequency: string;+ quality: string;+ symbol?: string;+ textColor: string;+ accentColor: string;+}++export const MetricsPanel: React.FC<MetricsPanelProps> = ({+ chartType,+ metrics,+ dataSource,+ frequency,+ quality,+ symbol,+ textColor,+ accentColor,+}) => {+ const chartTitles: Record<ChartType, string> = {+ volatility: 'IV SURFACE METRICS',+ correlation: 'CORRELATION METRICS',+ 'yield-curve': 'YIELD CURVE METRICS',+ pca: 'PCA FACTOR METRICS',+ };++ return (+ <div+ style={{+ width: '280px',+ borderRight: `1px solid ${FINCEPT_COLORS.BORDER}`,+ display: 'flex',+ flexDirection: 'column',+ flexShrink: 0,+ backgroundColor: FINCEPT_COLORS.PANEL_BG,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}+ >+ {/* Header */}+ <div style={{+ padding: '12px',+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}>+ <span style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ }}>+ {chartTitles[chartType]}+ </span>+ {symbol && (+ <div style={{+ fontSize: TYPOGRAPHY.HEADER_SIZE,+ fontWeight: 700,+ color: accentColor,+ marginTop: '4px',+ }}>+ {symbol}+ </div>+ )}+ </div>++ {/* Metrics List */}+ <div style={{ flex: 1, overflowY: 'auto' }}>+ {metrics.map((metric, idx) => (+ <div+ key={idx}+ style={{+ padding: '10px 12px',+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ }}>+ {metric.label}+ </div>+ <div style={{+ display: 'flex',+ alignItems: 'baseline',+ justifyContent: 'space-between',+ marginTop: '4px',+ }}>+ <span style={{+ fontSize: '14px',+ fontWeight: 700,+ color: FINCEPT_COLORS.CYAN,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}>+ {metric.value}+ </span>+ <span+ style={{+ fontSize: '8px',+ fontWeight: 700,+ padding: '2px 6px',+ borderRadius: '2px',+ backgroundColor:+ metric.positive === null+ ? `${FINCEPT_COLORS.MUTED}20`+ : metric.positive+ ? `${FINCEPT_COLORS.GREEN}20`+ : `${FINCEPT_COLORS.RED}20`,+ color:+ metric.positive === null+ ? FINCEPT_COLORS.MUTED+ : metric.positive+ ? FINCEPT_COLORS.GREEN+ : FINCEPT_COLORS.RED,+ }}+ >+ {metric.change}+ </span>+ </div>+ </div>+ ))}++ {/* Data Info Section */}+ <div style={{ padding: '12px', marginTop: '8px' }}>+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ marginBottom: '8px',+ }}>+ DATA INFO+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: TYPOGRAPHY.DATA_SIZE }}>+ <span style={{ color: FINCEPT_COLORS.GRAY }}>SOURCE:</span>+ <span style={{ color: FINCEPT_COLORS.CYAN }}>{dataSource}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: TYPOGRAPHY.DATA_SIZE }}>+ <span style={{ color: FINCEPT_COLORS.GRAY }}>FREQUENCY:</span>+ <span style={{ color: textColor }}>{frequency}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: TYPOGRAPHY.DATA_SIZE }}>+ <span style={{ color: FINCEPT_COLORS.GRAY }}>QUALITY:</span>+ <span style={{ color: quality === 'ERROR' ? FINCEPT_COLORS.RED : FINCEPT_COLORS.GREEN }}>{quality}</span>+ </div>+ </div>+ </div>++ {/* Legend for correlation */}+ {chartType === 'correlation' && (+ <div style={{ padding: '12px', marginTop: '8px' }}>+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ marginBottom: '8px',+ }}>+ CORRELATION SCALE+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '6px', fontSize: TYPOGRAPHY.DATA_SIZE }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <div style={{ width: '12px', height: '12px', backgroundColor: '#2e7d32', borderRadius: '2px' }} />+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Strong Positive (0.7-1.0)</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <div style={{ width: '12px', height: '12px', backgroundColor: '#ffeb3b', borderRadius: '2px' }} />+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Neutral (0.3-0.7)</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <div style={{ width: '12px', height: '12px', backgroundColor: '#b71c1c', borderRadius: '2px' }} />+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Strong Negative (-1.0-0.3)</span>+ </div>+ </div>+ </div>+ )}++ {/* Greeks legend for volatility */}+ {chartType === 'volatility' && (+ <div style={{ padding: '12px', marginTop: '8px' }}>+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ marginBottom: '8px',+ }}>+ IV INTERPRETATION+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: TYPOGRAPHY.DATA_SIZE, color: FINCEPT_COLORS.MUTED }}>+ <div>• High IV = Expensive Options</div>+ <div>• Low IV = Cheap Options</div>+ <div>• Skew = Put/Call IV Diff</div>+ <div>• Term Structure = Time Effect</div>+ </div>+ </div>+ )}++ {/* PCA legend */}+ {chartType === 'pca' && (+ <div style={{ padding: '12px', marginTop: '8px' }}>+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.GRAY,+ letterSpacing: '0.5px',+ marginBottom: '8px',+ }}>+ PCA INTERPRETATION+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '4px', fontSize: TYPOGRAPHY.DATA_SIZE, color: FINCEPT_COLORS.MUTED }}>+ <div>• PC1 = Market Factor</div>+ <div>• PC2 = Size/Value Factor</div>+ <div>• PC3 = Sector Rotation</div>+ <div>• Higher Var = More Explanatory</div>+ </div>+ </div>+ )}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/OrderBookPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/OrderBookPanel.tsxnew file mode 100644index 000000000..7955e28e0--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/OrderBookPanel.tsx@@ -0,0 +1,326 @@+/**+ * Surface Analytics - Order Book Panel Component+ * Display order book data (MBP-1, MBP-10, MBO)+ */++import React, { useState, useCallback } from 'react';+import {+ BookOpen,+ RefreshCw,+ AlertCircle,+ TrendingUp,+ TrendingDown,+} from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface OrderBookLevel {+ bid_px: number;+ ask_px: number;+ bid_sz: number;+ ask_sz: number;+ bid_ct: number;+ ask_ct: number;+}++interface OrderBookSnapshot {+ symbol: string;+ ts_event: string;+ levels: OrderBookLevel[];+}++interface OrderBookPanelProps {+ apiKey: string | null;+ symbols: string[];+ accentColor: string;+ textColor: string;+}++type SchemaType = 'mbp-1' | 'mbp-10' | 'tbbo';++export const OrderBookPanel: React.FC<OrderBookPanelProps> = ({+ apiKey,+ symbols,+ accentColor,+ textColor,+}) => {+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [selectedSchema, setSelectedSchema] = useState<SchemaType>('mbp-10');+ const [selectedSymbol, setSelectedSymbol] = useState(symbols[0] || 'SPY');+ const [snapshots, setSnapshots] = useState<OrderBookSnapshot[]>([]);++ const fetchOrderBook = useCallback(async () => {+ if (!apiKey || !selectedSymbol) return;++ setLoading(true);+ setError(null);++ try {+ const levels = selectedSchema === 'mbp-1' ? 1 : 10;+ const result = await invoke<string>('databento_get_order_book_snapshot', {+ apiKey,+ symbols: [selectedSymbol],+ dataset: null,+ levels,+ snapshotTime: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setSnapshots(parsed.snapshots || []);+ }+ } catch (err) {+ setError(`Failed to fetch order book: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, selectedSymbol, selectedSchema]);++ const formatPrice = (price: number): string => {+ if (!price || price === 0) return '--';+ return price.toFixed(2);+ };++ const formatSize = (size: number): string => {+ if (!size || size === 0) return '--';+ if (size >= 1000000) return `${(size / 1000000).toFixed(1)}M`;+ if (size >= 1000) return `${(size / 1000).toFixed(1)}K`;+ return size.toString();+ };++ const getSpread = (levels: OrderBookLevel[]): { spread: number; spreadPct: number } => {+ if (!levels || levels.length === 0) return { spread: 0, spreadPct: 0 };+ const bid = levels[0].bid_px;+ const ask = levels[0].ask_px;+ if (!bid || !ask) return { spread: 0, spreadPct: 0 };+ const spread = ask - bid;+ const mid = (bid + ask) / 2;+ const spreadPct = (spread / mid) * 100;+ return { spread, spreadPct };+ };++ const getMaxSize = (levels: OrderBookLevel[]): number => {+ if (!levels || levels.length === 0) return 1;+ return Math.max(+ ...levels.map(l => Math.max(l.bid_sz || 0, l.ask_sz || 0)),+ 1+ );+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <BookOpen size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key to view order book+ </div>+ </div>+ );+ }++ const currentSnapshot = snapshots.find(s => s.symbol === selectedSymbol);+ const { spread, spreadPct } = currentSnapshot ? getSpread(currentSnapshot.levels) : { spread: 0, spreadPct: 0 };+ const maxSize = currentSnapshot ? getMaxSize(currentSnapshot.levels) : 1;++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-2">+ <BookOpen size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ ORDER BOOK+ </span>+ </div>+ <button+ onClick={fetchOrderBook}+ disabled={loading}+ style={{ color: loading ? FINCEPT_COLORS.MUTED : accentColor }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>++ {/* Controls */}+ <div className="flex items-center justify-between p-2" style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ {/* Symbol selector */}+ <div className="flex items-center gap-1">+ {symbols.slice(0, 4).map(sym => (+ <button+ key={sym}+ onClick={() => setSelectedSymbol(sym)}+ className="px-2 py-0.5 text-[9px] font-bold"+ style={{+ backgroundColor: selectedSymbol === sym ? accentColor : FINCEPT_COLORS.BORDER,+ color: selectedSymbol === sym ? FINCEPT_COLORS.BLACK : textColor,+ borderRadius: '2px',+ }}+ >+ {sym}+ </button>+ ))}+ </div>++ {/* Schema selector */}+ <div className="flex items-center gap-1">+ {(['mbp-1', 'mbp-10'] as SchemaType[]).map(schema => (+ <button+ key={schema}+ onClick={() => setSelectedSchema(schema)}+ className="px-2 py-0.5 text-[9px]"+ style={{+ backgroundColor: selectedSchema === schema ? FINCEPT_COLORS.BORDER : 'transparent',+ color: selectedSchema === schema ? textColor : FINCEPT_COLORS.MUTED,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ {schema === 'mbp-1' ? 'TOP' : '10-LVL'}+ </button>+ ))}+ </div>+ </div>++ {/* Error */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Spread Info */}+ {currentSnapshot && (+ <div+ className="flex items-center justify-between p-2 text-xs"+ style={{ backgroundColor: FINCEPT_COLORS.BLACK, borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}+ >+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Spread:</span>+ <span style={{ color: FINCEPT_COLORS.YELLOW }}>+ ${spread.toFixed(2)} ({spreadPct.toFixed(3)}%)+ </span>+ </div>+ )}++ {/* Order Book Display */}+ <div className="p-2">+ {loading ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : !currentSnapshot || currentSnapshot.levels.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load order book data+ </div>+ ) : (+ <div>+ {/* Header Row */}+ <div className="grid grid-cols-4 gap-1 mb-1 text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ <div className="text-right">BID SIZE</div>+ <div className="text-right">BID</div>+ <div className="text-left">ASK</div>+ <div className="text-left">ASK SIZE</div>+ </div>++ {/* Order Book Levels */}+ {currentSnapshot.levels.map((level, idx) => {+ const bidWidth = (level.bid_sz / maxSize) * 100;+ const askWidth = (level.ask_sz / maxSize) * 100;++ return (+ <div+ key={idx}+ className="grid grid-cols-4 gap-1 py-0.5 text-[10px] relative"+ style={{+ backgroundColor: idx === 0 ? `${FINCEPT_COLORS.BORDER}50` : 'transparent',+ }}+ >+ {/* Bid side visualization */}+ <div className="relative text-right pr-1" style={{ color: FINCEPT_COLORS.GREEN }}>+ <div+ className="absolute right-0 top-0 bottom-0"+ style={{+ width: `${bidWidth}%`,+ backgroundColor: `${FINCEPT_COLORS.GREEN}20`,+ }}+ />+ <span className="relative z-10">{formatSize(level.bid_sz)}</span>+ </div>+ <div className="text-right font-mono" style={{ color: FINCEPT_COLORS.GREEN }}>+ {formatPrice(level.bid_px)}+ </div>+ <div className="text-left font-mono" style={{ color: FINCEPT_COLORS.RED }}>+ {formatPrice(level.ask_px)}+ </div>+ {/* Ask side visualization */}+ <div className="relative text-left pl-1" style={{ color: FINCEPT_COLORS.RED }}>+ <div+ className="absolute left-0 top-0 bottom-0"+ style={{+ width: `${askWidth}%`,+ backgroundColor: `${FINCEPT_COLORS.RED}20`,+ }}+ />+ <span className="relative z-10">{formatSize(level.ask_sz)}</span>+ </div>+ </div>+ );+ })}++ {/* Summary Stats */}+ <div+ className="grid grid-cols-2 gap-2 mt-2 pt-2 text-[9px]"+ style={{ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}` }}+ >+ <div className="flex items-center gap-1">+ <TrendingUp size={10} style={{ color: FINCEPT_COLORS.GREEN }} />+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Total Bid:</span>+ <span style={{ color: FINCEPT_COLORS.GREEN }}>+ {formatSize(currentSnapshot.levels.reduce((sum, l) => sum + l.bid_sz, 0))}+ </span>+ </div>+ <div className="flex items-center gap-1">+ <TrendingDown size={10} style={{ color: FINCEPT_COLORS.RED }} />+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Total Ask:</span>+ <span style={{ color: FINCEPT_COLORS.RED }}>+ {formatSize(currentSnapshot.levels.reduce((sum, l) => sum + l.ask_sz, 0))}+ </span>+ </div>+ </div>+ </div>+ )}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ReferenceDataPanel.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ReferenceDataPanel.tsxnew file mode 100644index 000000000..11871d402--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/ReferenceDataPanel.tsx@@ -0,0 +1,485 @@+/**+ * Surface Analytics - Reference Data Panel Component+ * Display security master, corporate actions, and adjustment factors+ */++import React, { useState, useCallback } from 'react';+import {+ Building2,+ Calendar,+ TrendingUp,+ RefreshCw,+ ChevronDown,+ ChevronUp,+ AlertCircle,+ DollarSign,+ Percent,+ Globe,+} from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import { FINCEPT_COLORS } from '../constants';++interface SecurityMaster {+ raw_symbol: string;+ instrument_id: string;+ security_type: string;+ exchange: string;+ currency: string;+ name: string;+ description: string;+ sector: string;+ industry: string;+ market_cap: number | null;+ shares_outstanding: number | null;+}++interface CorporateAction {+ raw_symbol: string;+ action_type: string;+ ex_date: string;+ record_date: string;+ payment_date: string;+ amount: number | null;+ ratio: string | null;+ currency: string;+ description: string;+}++interface AdjustmentFactor {+ raw_symbol: string;+ date: string;+ split_factor: number;+ dividend_factor: number;+ cumulative_factor: number;+}++interface ReferenceDataPanelProps {+ apiKey: string | null;+ symbols: string[];+ accentColor: string;+ textColor: string;+}++type TabType = 'security' | 'corporate' | 'adjustments';++export const ReferenceDataPanel: React.FC<ReferenceDataPanelProps> = ({+ apiKey,+ symbols,+ accentColor,+ textColor,+}) => {+ const [activeTab, setActiveTab] = useState<TabType>('security');+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);++ // Data states+ const [securityData, setSecurityData] = useState<SecurityMaster[]>([]);+ const [corporateActions, setCorporateActions] = useState<CorporateAction[]>([]);+ const [adjustmentFactors, setAdjustmentFactors] = useState<AdjustmentFactor[]>([]);++ // Expanded rows for detail views+ const [expandedRow, setExpandedRow] = useState<string | null>(null);++ const fetchSecurityMaster = useCallback(async () => {+ if (!apiKey || symbols.length === 0) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_security_master', {+ apiKey,+ symbols,+ dataset: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setSecurityData(parsed.securities || []);+ }+ } catch (err) {+ setError(`Failed to fetch security master: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const fetchCorporateActions = useCallback(async () => {+ if (!apiKey || symbols.length === 0) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_corporate_actions', {+ apiKey,+ symbols,+ startDate: null,+ endDate: null,+ actionType: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setCorporateActions(parsed.actions || []);+ }+ } catch (err) {+ setError(`Failed to fetch corporate actions: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const fetchAdjustmentFactors = useCallback(async () => {+ if (!apiKey || symbols.length === 0) return;++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_adjustment_factors', {+ apiKey,+ symbols,+ startDate: null,+ endDate: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ } else {+ setAdjustmentFactors(parsed.factors || []);+ }+ } catch (err) {+ setError(`Failed to fetch adjustment factors: ${err}`);+ } finally {+ setLoading(false);+ }+ }, [apiKey, symbols]);++ const handleRefresh = useCallback(() => {+ switch (activeTab) {+ case 'security':+ fetchSecurityMaster();+ break;+ case 'corporate':+ fetchCorporateActions();+ break;+ case 'adjustments':+ fetchAdjustmentFactors();+ break;+ }+ }, [activeTab, fetchSecurityMaster, fetchCorporateActions, fetchAdjustmentFactors]);++ const formatMarketCap = (value: number | null): string => {+ if (!value) return 'N/A';+ if (value >= 1e12) return `$${(value / 1e12).toFixed(2)}T`;+ if (value >= 1e9) return `$${(value / 1e9).toFixed(2)}B`;+ if (value >= 1e6) return `$${(value / 1e6).toFixed(2)}M`;+ return `$${value.toLocaleString()}`;+ };++ const formatActionType = (type: string): { label: string; color: string } => {+ switch (type.toLowerCase()) {+ case 'dividend':+ return { label: 'DIVIDEND', color: FINCEPT_COLORS.GREEN };+ case 'split':+ return { label: 'SPLIT', color: FINCEPT_COLORS.CYAN };+ case 'spinoff':+ return { label: 'SPINOFF', color: FINCEPT_COLORS.YELLOW };+ case 'merger':+ return { label: 'MERGER', color: FINCEPT_COLORS.PURPLE };+ default:+ return { label: type.toUpperCase(), color: FINCEPT_COLORS.MUTED };+ }+ };++ if (!apiKey) {+ return (+ <div+ className="p-4 text-center"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Building2 size={24} style={{ color: FINCEPT_COLORS.MUTED, margin: '0 auto 8px' }} />+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Configure Databento API key to access reference data+ </div>+ </div>+ );+ }++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ overflow: 'hidden',+ }}+ >+ {/* Header with Tabs */}+ <div+ className="flex items-center justify-between p-2"+ style={{+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ >+ <div className="flex items-center gap-1">+ {[+ { id: 'security', label: 'SECURITY MASTER', icon: Building2 },+ { id: 'corporate', label: 'CORPORATE ACTIONS', icon: Calendar },+ { id: 'adjustments', label: 'ADJUSTMENTS', icon: TrendingUp },+ ].map(({ id, label, icon: Icon }) => (+ <button+ key={id}+ onClick={() => setActiveTab(id as TabType)}+ className="flex items-center gap-1 px-2 py-1 text-[9px] font-bold"+ style={{+ backgroundColor: activeTab === id ? accentColor : 'transparent',+ color: activeTab === id ? FINCEPT_COLORS.BLACK : FINCEPT_COLORS.MUTED,+ border: `1px solid ${activeTab === id ? accentColor : FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <Icon size={10} />+ {label}+ </button>+ ))}+ </div>+ <button+ onClick={handleRefresh}+ disabled={loading || symbols.length === 0}+ style={{ color: loading ? FINCEPT_COLORS.MUTED : accentColor }}+ >+ <RefreshCw size={12} className={loading ? 'animate-spin' : ''} />+ </button>+ </div>++ {/* Symbols Badge */}+ <div className="flex flex-wrap gap-1 p-2" style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>SYMBOLS:</span>+ {symbols.slice(0, 5).map(sym => (+ <span+ key={sym}+ className="px-1 py-0.5 text-[9px]"+ style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ color: textColor,+ borderRadius: '2px',+ }}+ >+ {sym}+ </span>+ ))}+ {symbols.length > 5 && (+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ +{symbols.length - 5} more+ </span>+ )}+ </div>++ {/* Error Message */}+ {error && (+ <div+ className="flex items-center gap-2 m-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.RED}15`,+ border: `1px solid ${FINCEPT_COLORS.RED}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.RED,+ }}+ >+ <AlertCircle size={12} />+ <span>{error}</span>+ </div>+ )}++ {/* Content Area */}+ <div className="p-2 max-h-64 overflow-y-auto">+ {loading ? (+ <div className="flex items-center justify-center p-4">+ <RefreshCw size={16} className="animate-spin" style={{ color: accentColor }} />+ </div>+ ) : activeTab === 'security' ? (+ securityData.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load security master data+ </div>+ ) : (+ securityData.map((sec, idx) => (+ <div+ key={`${sec.raw_symbol}-${idx}`}+ className="mb-2"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <div+ className="flex items-center justify-between p-2 cursor-pointer"+ onClick={() => setExpandedRow(expandedRow === sec.raw_symbol ? null : sec.raw_symbol)}+ >+ <div className="flex items-center gap-2">+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ {sec.raw_symbol}+ </span>+ <span className="text-[9px]" style={{ color: FINCEPT_COLORS.MUTED }}>+ {sec.name || sec.description}+ </span>+ </div>+ {expandedRow === sec.raw_symbol ? (+ <ChevronUp size={12} style={{ color: FINCEPT_COLORS.MUTED }} />+ ) : (+ <ChevronDown size={12} style={{ color: FINCEPT_COLORS.MUTED }} />+ )}+ </div>+ {expandedRow === sec.raw_symbol && (+ <div className="grid grid-cols-2 gap-2 p-2 text-[9px]" style={{ borderTop: `1px solid ${FINCEPT_COLORS.BORDER}` }}>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Exchange: </span>+ <span style={{ color: textColor }}>{sec.exchange || 'N/A'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Currency: </span>+ <span style={{ color: textColor }}>{sec.currency || 'USD'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Sector: </span>+ <span style={{ color: textColor }}>{sec.sector || 'N/A'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Industry: </span>+ <span style={{ color: textColor }}>{sec.industry || 'N/A'}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Market Cap: </span>+ <span style={{ color: FINCEPT_COLORS.GREEN }}>{formatMarketCap(sec.market_cap)}</span>+ </div>+ <div>+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Type: </span>+ <span style={{ color: textColor }}>{sec.security_type || 'Equity'}</span>+ </div>+ </div>+ )}+ </div>+ ))+ )+ ) : activeTab === 'corporate' ? (+ corporateActions.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load corporate actions+ </div>+ ) : (+ corporateActions.map((action, idx) => {+ const { label, color } = formatActionType(action.action_type);+ return (+ <div+ key={`${action.raw_symbol}-${action.ex_date}-${idx}`}+ className="flex items-center justify-between p-2 mb-1"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center gap-2">+ <span className="text-xs font-bold" style={{ color: accentColor }}>+ {action.raw_symbol}+ </span>+ <span+ className="px-1 py-0.5 text-[8px] font-bold"+ style={{+ backgroundColor: `${color}20`,+ color: color,+ borderRadius: '2px',+ }}+ >+ {label}+ </span>+ </div>+ <div className="flex items-center gap-3 text-[9px]">+ {action.amount && (+ <div className="flex items-center gap-1" style={{ color: FINCEPT_COLORS.GREEN }}>+ <DollarSign size={10} />+ <span>{action.amount.toFixed(4)} {action.currency}</span>+ </div>+ )}+ {action.ratio && (+ <div className="flex items-center gap-1" style={{ color: FINCEPT_COLORS.CYAN }}>+ <Percent size={10} />+ <span>{action.ratio}</span>+ </div>+ )}+ <span style={{ color: FINCEPT_COLORS.MUTED }}>{action.ex_date}</span>+ </div>+ </div>+ );+ })+ )+ ) : (+ adjustmentFactors.length === 0 ? (+ <div className="text-xs text-center p-4" style={{ color: FINCEPT_COLORS.MUTED }}>+ Click refresh to load adjustment factors+ </div>+ ) : (+ <div+ className="overflow-x-auto"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <table className="w-full text-[9px]">+ <thead>+ <tr style={{ backgroundColor: FINCEPT_COLORS.HEADER_BG }}>+ <th className="p-1 text-left" style={{ color: accentColor }}>SYMBOL</th>+ <th className="p-1 text-left" style={{ color: accentColor }}>DATE</th>+ <th className="p-1 text-right" style={{ color: accentColor }}>SPLIT</th>+ <th className="p-1 text-right" style={{ color: accentColor }}>DIVIDEND</th>+ <th className="p-1 text-right" style={{ color: accentColor }}>CUMULATIVE</th>+ </tr>+ </thead>+ <tbody>+ {adjustmentFactors.slice(0, 20).map((factor, idx) => (+ <tr+ key={`${factor.raw_symbol}-${factor.date}-${idx}`}+ style={{ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}` }}+ >+ <td className="p-1" style={{ color: textColor }}>{factor.raw_symbol}</td>+ <td className="p-1" style={{ color: FINCEPT_COLORS.MUTED }}>{factor.date}</td>+ <td className="p-1 text-right" style={{ color: factor.split_factor !== 1 ? FINCEPT_COLORS.CYAN : textColor }}>+ {factor.split_factor.toFixed(6)}+ </td>+ <td className="p-1 text-right" style={{ color: factor.dividend_factor !== 1 ? FINCEPT_COLORS.GREEN : textColor }}>+ {factor.dividend_factor.toFixed(6)}+ </td>+ <td className="p-1 text-right" style={{ color: FINCEPT_COLORS.YELLOW }}>+ {factor.cumulative_factor.toFixed(6)}+ </td>+ </tr>+ ))}+ </tbody>+ </table>+ {adjustmentFactors.length > 20 && (+ <div className="p-1 text-[9px] text-center" style={{ color: FINCEPT_COLORS.MUTED }}>+ Showing 20 of {adjustmentFactors.length} records+ </div>+ )}+ </div>+ )+ )}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SettingsModal.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SettingsModal.tsxnew file mode 100644index 000000000..a102bfad8--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SettingsModal.tsx@@ -0,0 +1,894 @@+/**+ * Surface Analytics - Settings Modal Component+ * Configuration for symbols, date ranges, data sources, and API credentials+ */++import React, { useState, useEffect, useCallback } from 'react';+import { X, Plus, Trash2, Key, Eye, EyeOff, AlertCircle, CheckCircle, Search, Loader2, Database, ChevronDown, ChevronUp, Clock } from 'lucide-react';+import { invoke } from '@tauri-apps/api/core';+import type { SurfaceAnalyticsConfig, OHLCVTimeframe } from '../types';+import { VOL_SURFACE_SYMBOLS, CORRELATION_ASSETS, FINCEPT_COLORS, TYPOGRAPHY } from '../constants';+import { sqliteService } from '@/services/core/sqliteService';+import { DatasetBrowser } from './DatasetBrowser';+import { CostEstimator } from './CostEstimator';+import { TimeframeSelector } from './TimeframeSelector';+import { ReferenceDataPanel } from './ReferenceDataPanel';+import { OrderBookPanel } from './OrderBookPanel';+import { LiveStreamPanel } from './LiveStreamPanel';+import { FuturesPanel } from './FuturesPanel';+import { BatchDownloadPanel } from './BatchDownloadPanel';+import { AdditionalSchemasPanel } from './AdditionalSchemasPanel';+import { useDatabentoApi } from '../hooks/useDatabentoApi';++interface SettingsModalProps {+ isOpen: boolean;+ onClose: () => void;+ config: SurfaceAnalyticsConfig;+ onSave: (config: SurfaceAnalyticsConfig) => void;+ onApiKeyChange?: () => void;+ accentColor: string;+ textColor: string;+}++export const SettingsModal: React.FC<SettingsModalProps> = ({+ isOpen,+ onClose,+ config,+ onSave,+ onApiKeyChange,+ accentColor,+ textColor,+}) => {+ const [localConfig, setLocalConfig] = useState<SurfaceAnalyticsConfig>(config);+ const [newAsset, setNewAsset] = useState('');+ const [apiKey, setApiKey] = useState('');+ const [showApiKey, setShowApiKey] = useState(false);+ const [apiKeyStatus, setApiKeyStatus] = useState<'none' | 'valid' | 'invalid' | 'saving'>('none');+ const [hasExistingKey, setHasExistingKey] = useState(false);++ // Symbol search state+ const [symbolSearchQuery, setSymbolSearchQuery] = useState('');+ const [symbolSearching, setSymbolSearching] = useState(false);+ const [symbolSearchResult, setSymbolSearchResult] = useState<'none' | 'valid' | 'invalid'>('none');+ const [customSymbol, setCustomSymbol] = useState('');++ // Advanced sections toggle+ const [showDatasetBrowser, setShowDatasetBrowser] = useState(false);+ const [showCostEstimator, setShowCostEstimator] = useState(false);+ const [showTimeframeSelector, setShowTimeframeSelector] = useState(false);+ const [showReferenceData, setShowReferenceData] = useState(false);+ const [showOrderBook, setShowOrderBook] = useState(false);+ const [showLiveStream, setShowLiveStream] = useState(false);+ const [showFutures, setShowFutures] = useState(false);+ const [showBatchDownload, setShowBatchDownload] = useState(false);+ const [showAdditionalSchemas, setShowAdditionalSchemas] = useState(false);+ const [storedApiKey, setStoredApiKey] = useState<string | null>(null);++ // Live streaming hook+ const {+ startLiveStream,+ stopLiveStream,+ stopAllLiveStreams,+ activeStreams,+ } = useDatabentoApi();++ // Load stored API key for child components+ useEffect(() => {+ const loadStoredKey = async () => {+ try {+ const key = await sqliteService.getApiKey('DATABENTO_API_KEY');+ setStoredApiKey(key);+ } catch (err) {+ console.error('Failed to load stored API key:', err);+ }+ };+ if (isOpen) {+ loadStoredKey();+ }+ }, [isOpen, hasExistingKey]);++ // Load existing API key status on mount+ useEffect(() => {+ if (isOpen) {+ loadApiKeyStatus();+ }+ }, [isOpen]);++ const loadApiKeyStatus = async () => {+ try {+ const existingKey = await sqliteService.getApiKey('DATABENTO_API_KEY');+ if (existingKey && existingKey.startsWith('db-')) {+ setHasExistingKey(true);+ setApiKeyStatus('valid');+ setApiKey(''); // Don't show existing key for security+ } else {+ setHasExistingKey(false);+ setApiKeyStatus('none');+ }+ } catch (err) {+ console.error('Failed to load API key status:', err);+ setApiKeyStatus('none');+ }+ };++ const handleSaveApiKey = async () => {+ if (!apiKey.trim()) return;++ // Validate format+ if (!apiKey.startsWith('db-')) {+ setApiKeyStatus('invalid');+ return;+ }++ setApiKeyStatus('saving');+ try {+ await sqliteService.setApiKey('DATABENTO_API_KEY', apiKey.trim());+ setApiKeyStatus('valid');+ setHasExistingKey(true);+ setApiKey('');+ onApiKeyChange?.();+ } catch (err) {+ console.error('Failed to save API key:', err);+ setApiKeyStatus('invalid');+ }+ };++ const handleRemoveApiKey = async () => {+ try {+ await sqliteService.setApiKey('DATABENTO_API_KEY', '');+ setApiKeyStatus('none');+ setHasExistingKey(false);+ setApiKey('');+ onApiKeyChange?.();+ } catch (err) {+ console.error('Failed to remove API key:', err);+ }+ };++ // Symbol search handler+ const handleSymbolSearch = useCallback(async () => {+ if (!symbolSearchQuery.trim()) return;++ const symbol = symbolSearchQuery.toUpperCase().trim();+ setSymbolSearching(true);+ setSymbolSearchResult('none');++ try {+ // Get API key for search+ const storedApiKey = await sqliteService.getApiKey('DATABENTO_API_KEY');+ if (!storedApiKey) {+ // If no API key, just accept the symbol without validation+ setLocalConfig({ ...localConfig, selectedSymbol: symbol });+ setCustomSymbol(symbol);+ setSymbolSearchResult('valid');+ setSymbolSearchQuery('');+ return;+ }++ // Try to resolve the symbol via Databento+ const result = await invoke<string>('databento_resolve_symbols', {+ apiKey: storedApiKey,+ symbols: [symbol],+ dataset: null,+ stypeIn: null,+ stypeOut: null,+ });++ const parsed = JSON.parse(result);++ if (!parsed.error && parsed.mappings && parsed.mappings.length > 0) {+ setLocalConfig({ ...localConfig, selectedSymbol: symbol });+ setCustomSymbol(symbol);+ setSymbolSearchResult('valid');+ setSymbolSearchQuery('');+ } else {+ // Symbol not found, but still allow it (for demo mode)+ setLocalConfig({ ...localConfig, selectedSymbol: symbol });+ setCustomSymbol(symbol);+ setSymbolSearchResult('valid');+ setSymbolSearchQuery('');+ }+ } catch (err) {+ console.error('Symbol search failed:', err);+ // Allow symbol anyway for demo mode+ setLocalConfig({ ...localConfig, selectedSymbol: symbolSearchQuery.toUpperCase().trim() });+ setCustomSymbol(symbolSearchQuery.toUpperCase().trim());+ setSymbolSearchResult('valid');+ setSymbolSearchQuery('');+ } finally {+ setSymbolSearching(false);+ }+ }, [symbolSearchQuery, localConfig]);++ if (!isOpen) return null;++ const handleAddAsset = () => {+ if (newAsset && !localConfig.correlationAssets.includes(newAsset.toUpperCase())) {+ setLocalConfig({+ ...localConfig,+ correlationAssets: [...localConfig.correlationAssets, newAsset.toUpperCase()],+ });+ setNewAsset('');+ }+ };++ const handleRemoveAsset = (asset: string) => {+ setLocalConfig({+ ...localConfig,+ correlationAssets: localConfig.correlationAssets.filter(a => a !== asset),+ });+ };++ const handleSave = () => {+ onSave(localConfig);+ onClose();+ };++ const inputStyle: React.CSSProperties = {+ width: '100%',+ padding: '8px 10px',+ backgroundColor: FINCEPT_COLORS.BLACK,+ color: textColor,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ fontSize: '11px',+ fontFamily: '"IBM Plex Mono", monospace',+ outline: 'none',+ };++ return (+ <div+ className="fixed inset-0 flex items-center justify-center z-50"+ style={{ backgroundColor: 'rgba(0,0,0,0.8)' }}+ onClick={onClose}+ >+ <div+ className="w-full max-w-lg p-4 overflow-hidden"+ style={{+ backgroundColor: FINCEPT_COLORS.PANEL_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ }}+ onClick={e => e.stopPropagation()}+ >+ {/* Header */}+ <div className="flex items-center justify-between mb-4">+ <h2 className="text-sm font-bold" style={{ color: accentColor }}>+ SURFACE ANALYTICS SETTINGS+ </h2>+ <button onClick={onClose} style={{ color: FINCEPT_COLORS.MUTED }}>+ <X size={16} />+ </button>+ </div>++ {/* Databento API Key Section */}+ <div+ className="mb-4 p-3"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${apiKeyStatus === 'valid' ? FINCEPT_COLORS.GREEN : apiKeyStatus === 'invalid' ? FINCEPT_COLORS.RED : FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center gap-2 mb-2">+ <Key size={14} style={{ color: accentColor }} />+ <label className="text-xs font-bold" style={{ color: accentColor, letterSpacing: '0.5px' }}>+ DATABENTO API KEY+ </label>+ {apiKeyStatus === 'valid' && (+ <span className="flex items-center gap-1 text-xs" style={{ color: FINCEPT_COLORS.GREEN }}>+ <CheckCircle size={12} /> CONFIGURED+ </span>+ )}+ {apiKeyStatus === 'invalid' && (+ <span className="flex items-center gap-1 text-xs" style={{ color: FINCEPT_COLORS.RED }}>+ <AlertCircle size={12} /> INVALID FORMAT+ </span>+ )}+ </div>++ {hasExistingKey ? (+ <div className="flex items-center justify-between">+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ API key is configured (db-*****)+ </span>+ <button+ onClick={handleRemoveApiKey}+ className="flex items-center gap-1 px-2 py-1 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.RED + '20',+ color: FINCEPT_COLORS.RED,+ border: `1px solid ${FINCEPT_COLORS.RED}`,+ borderRadius: '2px',+ }}+ >+ <Trash2 size={10} /> REMOVE+ </button>+ </div>+ ) : (+ <>+ <div className="flex gap-2 mb-2">+ <div className="flex-1 relative">+ <input+ type={showApiKey ? 'text' : 'password'}+ value={apiKey}+ onChange={e => {+ setApiKey(e.target.value);+ setApiKeyStatus('none');+ }}+ placeholder="Enter your Databento API key (db-*****)"+ style={{+ ...inputStyle,+ paddingRight: '36px',+ }}+ />+ <button+ onClick={() => setShowApiKey(!showApiKey)}+ className="absolute right-2 top-1/2 transform -translate-y-1/2"+ style={{ color: FINCEPT_COLORS.MUTED }}+ >+ {showApiKey ? <EyeOff size={14} /> : <Eye size={14} />}+ </button>+ </div>+ <button+ onClick={handleSaveApiKey}+ disabled={!apiKey.trim() || apiKeyStatus === 'saving'}+ className="px-3 text-xs font-bold"+ style={{+ backgroundColor: apiKey.trim() ? accentColor : FINCEPT_COLORS.MUTED,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ opacity: apiKey.trim() ? 1 : 0.5,+ }}+ >+ {apiKeyStatus === 'saving' ? 'SAVING...' : 'SAVE'}+ </button>+ </div>+ <div className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Get your API key from{' '}+ <a+ href="https://databento.com"+ target="_blank"+ rel="noopener noreferrer"+ style={{ color: FINCEPT_COLORS.CYAN, textDecoration: 'underline' }}+ >+ databento.com+ </a>+ {' '}→ Dashboard → API Keys+ </div>+ </>+ )}+ </div>++ {/* Volatility Surface Symbol */}+ <div className="mb-4">+ <label className="block text-xs font-bold mb-2" style={{ color: FINCEPT_COLORS.MUTED }}>+ VOLATILITY SURFACE SYMBOL+ </label>++ {/* Current selected symbol */}+ <div+ className="flex items-center justify-between p-2 mb-2"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.GREEN}`,+ borderRadius: '2px',+ }}+ >+ <span className="text-sm font-bold" style={{ color: FINCEPT_COLORS.GREEN }}>+ {localConfig.selectedSymbol}+ </span>+ <CheckCircle size={14} style={{ color: FINCEPT_COLORS.GREEN }} />+ </div>++ {/* Symbol search input */}+ <div className="flex gap-2 mb-2">+ <div className="flex-1 relative">+ <input+ type="text"+ value={symbolSearchQuery}+ onChange={e => setSymbolSearchQuery(e.target.value.toUpperCase())}+ placeholder="Search any symbol (e.g., MSFT, GOOGL, META)"+ style={inputStyle}+ onKeyPress={e => e.key === 'Enter' && handleSymbolSearch()}+ />+ </div>+ <button+ onClick={handleSymbolSearch}+ disabled={!symbolSearchQuery.trim() || symbolSearching}+ className="px-3 flex items-center gap-1"+ style={{+ backgroundColor: symbolSearchQuery.trim() ? accentColor : FINCEPT_COLORS.MUTED,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ borderRadius: '2px',+ opacity: symbolSearchQuery.trim() ? 1 : 0.5,+ }}+ >+ {symbolSearching ? (+ <Loader2 size={14} className="animate-spin" />+ ) : (+ <Search size={14} />+ )}+ </button>+ </div>++ {/* Quick select popular symbols */}+ <div className="flex flex-wrap gap-1">+ {VOL_SURFACE_SYMBOLS.map(sym => (+ <button+ key={sym.value}+ onClick={() => setLocalConfig({ ...localConfig, selectedSymbol: sym.value })}+ className="px-2 py-0.5 text-xs"+ style={{+ backgroundColor: localConfig.selectedSymbol === sym.value ? accentColor : FINCEPT_COLORS.BORDER,+ color: localConfig.selectedSymbol === sym.value ? FINCEPT_COLORS.BLACK : textColor,+ border: 'none',+ borderRadius: '2px',+ }}+ >+ {sym.value}+ </button>+ ))}+ </div>+ </div>++ {/* Correlation Assets */}+ <div className="mb-4">+ <label className="block text-xs font-bold mb-2" style={{ color: FINCEPT_COLORS.MUTED }}>+ CORRELATION ASSETS ({localConfig.correlationAssets.length})+ </label>+ <div className="flex gap-2 mb-2">+ <input+ type="text"+ value={newAsset}+ onChange={e => setNewAsset(e.target.value)}+ placeholder="Add symbol (e.g., AAPL)"+ style={inputStyle}+ onKeyPress={e => e.key === 'Enter' && handleAddAsset()}+ />+ <button+ onClick={handleAddAsset}+ className="px-3"+ style={{+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ border: 'none',+ }}+ >+ <Plus size={14} />+ </button>+ </div>+ <div className="flex flex-wrap gap-1 max-h-24 overflow-y-auto">+ {localConfig.correlationAssets.map(asset => (+ <div+ key={asset}+ className="flex items-center gap-1 px-2 py-0.5 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ color: textColor,+ }}+ >+ {asset}+ <button+ onClick={() => handleRemoveAsset(asset)}+ style={{ color: FINCEPT_COLORS.RED }}+ >+ <Trash2 size={10} />+ </button>+ </div>+ ))}+ </div>+ <button+ className="mt-2 text-xs underline"+ style={{ color: FINCEPT_COLORS.MUTED }}+ onClick={() =>+ setLocalConfig({+ ...localConfig,+ correlationAssets: [...CORRELATION_ASSETS],+ })+ }+ >+ Reset to defaults+ </button>+ </div>++ {/* Date Range */}+ <div className="mb-4">+ <label className="block text-xs font-bold mb-2" style={{ color: FINCEPT_COLORS.MUTED }}>+ HISTORICAL DATE RANGE+ </label>+ <div className="flex gap-2">+ <div className="flex-1">+ <label className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Start+ </label>+ <input+ type="date"+ value={localConfig.dateRange.start}+ onChange={e =>+ setLocalConfig({+ ...localConfig,+ dateRange: { ...localConfig.dateRange, start: e.target.value },+ })+ }+ style={inputStyle}+ />+ </div>+ <div className="flex-1">+ <label className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ End+ </label>+ <input+ type="date"+ value={localConfig.dateRange.end}+ onChange={e =>+ setLocalConfig({+ ...localConfig,+ dateRange: { ...localConfig.dateRange, end: e.target.value },+ })+ }+ style={inputStyle}+ />+ </div>+ </div>+ </div>++ {/* Auto Refresh */}+ <div className="mb-4">+ <label className="block text-xs font-bold mb-2" style={{ color: FINCEPT_COLORS.MUTED }}>+ AUTO REFRESH INTERVAL+ </label>+ <select+ value={localConfig.refreshInterval}+ onChange={e =>+ setLocalConfig({+ ...localConfig,+ refreshInterval: parseInt(e.target.value),+ })+ }+ style={inputStyle}+ >+ <option value={0}>Manual Only</option>+ <option value={60000}>Every 1 minute</option>+ <option value={300000}>Every 5 minutes</option>+ <option value={900000}>Every 15 minutes</option>+ <option value={3600000}>Every 1 hour</option>+ </select>+ </div>++ {/* Timeframe Selector Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowTimeframeSelector(!showTimeframeSelector)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <Clock size={14} />+ DATA TIMEFRAME+ <span className="px-1 py-0.5 text-[9px]" style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ borderRadius: '2px',+ color: textColor,+ }}>+ {localConfig.timeframe?.toUpperCase().replace('OHLCV-', '') || '1D'}+ </span>+ </div>+ {showTimeframeSelector ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showTimeframeSelector && (+ <div className="mt-2">+ <TimeframeSelector+ value={localConfig.timeframe || 'ohlcv-1d'}+ onChange={(tf: OHLCVTimeframe) => setLocalConfig({ ...localConfig, timeframe: tf })}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Dataset Browser Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowDatasetBrowser(!showDatasetBrowser)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <Database size={14} />+ BROWSE DATASETS+ <span className="px-1 py-0.5 text-[9px]" style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ borderRadius: '2px',+ color: textColor,+ }}>+ {localConfig.dataset || 'DBEQ.BASIC'}+ </span>+ </div>+ {showDatasetBrowser ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showDatasetBrowser && (+ <div className="mt-2">+ <DatasetBrowser+ apiKey={storedApiKey}+ selectedDataset={localConfig.dataset || 'DBEQ.BASIC'}+ onSelectDataset={(ds: string) => setLocalConfig({ ...localConfig, dataset: ds })}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Cost Estimator Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowCostEstimator(!showCostEstimator)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>💰</span>+ COST ESTIMATOR+ </div>+ {showCostEstimator ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showCostEstimator && (+ <div className="mt-2">+ <CostEstimator+ apiKey={storedApiKey}+ dataset={localConfig.dataset || 'DBEQ.BASIC'}+ symbols={[localConfig.selectedSymbol, ...localConfig.correlationAssets.slice(0, 3)]}+ schema={localConfig.timeframe || 'ohlcv-1d'}+ startDate={localConfig.dateRange.start}+ endDate={localConfig.dateRange.end}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Reference Data Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowReferenceData(!showReferenceData)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📋</span>+ REFERENCE DATA+ </div>+ {showReferenceData ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showReferenceData && (+ <div className="mt-2">+ <ReferenceDataPanel+ apiKey={storedApiKey}+ symbols={[localConfig.selectedSymbol, ...localConfig.correlationAssets.slice(0, 4)]}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Order Book Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowOrderBook(!showOrderBook)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📊</span>+ ORDER BOOK+ </div>+ {showOrderBook ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showOrderBook && (+ <div className="mt-2">+ <OrderBookPanel+ apiKey={storedApiKey}+ symbols={[localConfig.selectedSymbol, ...localConfig.correlationAssets.slice(0, 3)]}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Live Stream Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowLiveStream(!showLiveStream)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${activeStreams.length > 0 ? FINCEPT_COLORS.GREEN : FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: activeStreams.length > 0 ? FINCEPT_COLORS.GREEN : accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📡</span>+ LIVE STREAMING+ {activeStreams.length > 0 && (+ <span+ className="px-1 text-[9px]"+ style={{+ backgroundColor: FINCEPT_COLORS.GREEN,+ color: FINCEPT_COLORS.BLACK,+ borderRadius: '2px',+ }}+ >+ {activeStreams.length} ACTIVE+ </span>+ )}+ </div>+ {showLiveStream ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showLiveStream && (+ <div className="mt-2">+ <LiveStreamPanel+ apiKey={storedApiKey}+ symbols={[localConfig.selectedSymbol, ...localConfig.correlationAssets.slice(0, 3)]}+ accentColor={accentColor}+ textColor={textColor}+ onStartStream={startLiveStream}+ onStopStream={stopLiveStream}+ onStopAllStreams={stopAllLiveStreams}+ activeStreams={activeStreams}+ />+ </div>+ )}+ </div>++ {/* Futures Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowFutures(!showFutures)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📈</span>+ FUTURES (CME GLOBEX)+ </div>+ {showFutures ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showFutures && (+ <div className="mt-2">+ <FuturesPanel+ apiKey={storedApiKey}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Batch Download Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowBatchDownload(!showBatchDownload)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📦</span>+ BATCH DOWNLOADS+ </div>+ {showBatchDownload ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showBatchDownload && (+ <div className="mt-2">+ <BatchDownloadPanel+ apiKey={storedApiKey}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Additional Schemas Toggle */}+ <div className="mb-4">+ <button+ onClick={() => setShowAdditionalSchemas(!showAdditionalSchemas)}+ className="flex items-center justify-between w-full p-2 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ color: accentColor,+ }}+ >+ <div className="flex items-center gap-2">+ <span>📊</span>+ ADDITIONAL SCHEMAS+ <span className="px-1 py-0.5 text-[8px]" style={{ backgroundColor: FINCEPT_COLORS.BORDER, borderRadius: '2px', color: FINCEPT_COLORS.MUTED }}>+ TRADES, IMBALANCE, STATUS+ </span>+ </div>+ {showAdditionalSchemas ? <ChevronUp size={14} /> : <ChevronDown size={14} />}+ </button>+ {showAdditionalSchemas && (+ <div className="mt-2">+ <AdditionalSchemasPanel+ apiKey={storedApiKey}+ symbols={[localConfig.selectedSymbol, ...localConfig.correlationAssets.slice(0, 3)]}+ accentColor={accentColor}+ textColor={textColor}+ />+ </div>+ )}+ </div>++ {/* Actions */}+ <div className="flex justify-end gap-2 mt-6">+ <button+ onClick={onClose}+ className="px-4 py-1 text-xs font-bold"+ style={{+ backgroundColor: FINCEPT_COLORS.BORDER,+ color: textColor,+ border: `1px solid ${FINCEPT_COLORS.MUTED}`,+ }}+ >+ CANCEL+ </button>+ <button+ onClick={handleSave}+ className="px-4 py-1 text-xs font-bold"+ style={{+ backgroundColor: accentColor,+ color: FINCEPT_COLORS.BLACK,+ border: `1px solid ${accentColor}`,+ }}+ >+ SAVE CHANGES+ </button>+ </div>+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SurfaceChart.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SurfaceChart.tsxnew file mode 100644index 000000000..8a343b70d--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/SurfaceChart.tsx@@ -0,0 +1,489 @@+/**+ * Surface Analytics - 3D Surface Chart Component+ * Renders Plotly 3D surface visualizations+ * Follows UI Design System (UI_DESIGN_SYSTEM.md)+ */++import React, { Suspense, lazy, useMemo } from 'react';+import { RefreshCw, AlertCircle, TrendingUp } from 'lucide-react';+import type { ChartType, VolatilitySurfaceData, CorrelationMatrixData, YieldCurveData, PCAData } from '../types';+import { FINCEPT_COLORS, TYPOGRAPHY } from '../constants';++// Lazy load Plotly+const Plot = lazy(() => import('react-plotly.js'));++// Color scales as arrays (mutable for Plotly)+const COLOR_SCALES = {+ volatility: [+ [0, '#1a237e'], [0.2, '#1565c0'], [0.4, '#0288d1'],+ [0.6, '#26c6da'], [0.75, '#ffa726'], [0.9, '#ff7043'], [1, '#d32f2f']+ ] as Array<[number, string]>,+ correlation: [+ [0, '#b71c1c'], [0.3, '#e53935'], [0.45, '#ff9800'],+ [0.5, '#ffeb3b'], [0.65, '#7cb342'], [0.8, '#43a047'], [1, '#2e7d32']+ ] as Array<[number, string]>,+ yieldCurve: [+ [0, '#1a237e'], [0.25, '#283593'], [0.4, '#3949ab'],+ [0.55, '#5e35b1'], [0.7, '#7e57c2'], [0.85, '#ba68c8'], [1, '#f06292']+ ] as Array<[number, string]>,+ pca: [+ [0, '#0d47a1'], [0.2, '#1976d2'], [0.4, '#42a5f5'],+ [0.5, '#e0e0e0'], [0.6, '#ef5350'], [0.8, '#e53935'], [1, '#b71c1c']+ ] as Array<[number, string]>,+};++interface SurfaceChartProps {+ chartType: ChartType;+ volatilityData: VolatilitySurfaceData | null;+ correlationData: CorrelationMatrixData | null;+ yieldCurveData: YieldCurveData | null;+ pcaData: PCAData | null;+ loading: boolean;+ error: string | null;+ textColor: string;+ accentColor: string;+ fontFamily: string;+ isDemoMode?: boolean;+}++export const SurfaceChart: React.FC<SurfaceChartProps> = ({+ chartType,+ volatilityData,+ correlationData,+ yieldCurveData,+ pcaData,+ loading,+ error,+ textColor,+ accentColor,+ fontFamily,+ isDemoMode = false,+}) => {+ const plotConfig = useMemo(() => ({+ displayModeBar: true,+ displaylogo: false,+ modeBarButtonsToRemove: ['select2d', 'lasso2d'] as any[],+ responsive: true,+ }), []);++ const colorbarConfig = useMemo(() => ({+ tickfont: { size: 10, color: textColor },+ len: 0.85,+ thickness: 18,+ x: 1.02,+ bgcolor: FINCEPT_COLORS.BLACK,+ bordercolor: accentColor,+ borderwidth: 1,+ }), [textColor, accentColor]);++ const sceneConfig = useMemo(() => ({+ bgcolor: FINCEPT_COLORS.BLACK,+ xaxis: {+ gridcolor: FINCEPT_COLORS.BORDER,+ color: textColor,+ titlefont: { size: 12, color: accentColor },+ tickfont: { size: 10 },+ showbackground: true,+ backgroundcolor: FINCEPT_COLORS.PANEL_BG,+ },+ yaxis: {+ gridcolor: FINCEPT_COLORS.BORDER,+ color: textColor,+ titlefont: { size: 12, color: accentColor },+ tickfont: { size: 10 },+ showbackground: true,+ backgroundcolor: FINCEPT_COLORS.PANEL_BG,+ },+ zaxis: {+ gridcolor: FINCEPT_COLORS.BORDER,+ color: textColor,+ titlefont: { size: 12, color: accentColor },+ tickfont: { size: 10 },+ showbackground: true,+ backgroundcolor: FINCEPT_COLORS.PANEL_BG,+ },+ camera: {+ eye: { x: 1.6, y: 1.6, z: 1.4 },+ center: { x: 0, y: 0, z: 0 },+ },+ }), [textColor, accentColor]);++ const baseLayout = useMemo(() => ({+ autosize: true,+ font: { family: fontFamily, color: textColor, size: 11 },+ paper_bgcolor: 'transparent',+ plot_bgcolor: 'transparent',+ margin: { l: 10, r: 10, t: 10, b: 10 },+ hoverlabel: {+ bgcolor: FINCEPT_COLORS.BORDER,+ bordercolor: accentColor,+ font: { family: fontFamily, color: textColor, size: 11 },+ },+ }), [textColor, accentColor, fontFamily]);++ const renderVolatilitySurface = () => {+ if (!volatilityData) return null;++ return (+ <Plot+ data={[{+ type: 'surface' as const,+ x: volatilityData.strikes,+ y: volatilityData.expirations,+ z: volatilityData.z,+ colorscale: COLOR_SCALES.volatility,+ colorbar: {+ title: { text: 'IV %', font: { size: 11, color: accentColor } },+ ...colorbarConfig,+ },+ hovertemplate: '<b>STRIKE:</b> %{x:.1f}<br><b>DTE:</b> %{y:.0f}<br><b>IV:</b> %{z:.2f}%<extra></extra>'+ } as any]}+ layout={{+ ...baseLayout,+ scene: {+ ...sceneConfig,+ xaxis: { ...sceneConfig.xaxis, title: 'STRIKE PRICE' },+ yaxis: { ...sceneConfig.yaxis, title: 'DAYS TO EXPIRY' },+ zaxis: { ...sceneConfig.zaxis, title: 'IMPLIED VOL (%)' },+ }+ } as any}+ config={plotConfig}+ style={{ width: '100%', height: '100%' }}+ useResizeHandler={true}+ />+ );+ };++ const renderCorrelationMatrix = () => {+ if (!correlationData) return null;++ return (+ <Plot+ data={[{+ type: 'surface' as const,+ z: correlationData.z,+ colorscale: COLOR_SCALES.correlation,+ colorbar: {+ title: { text: 'ρ', font: { size: 12, color: accentColor } },+ ...colorbarConfig,+ },+ hovertemplate: '<b>CORRELATION:</b> %{z:.3f}<extra></extra>'+ } as any]}+ layout={{+ ...baseLayout,+ scene: {+ ...sceneConfig,+ xaxis: { ...sceneConfig.xaxis, title: 'ASSET PAIR INDEX' },+ yaxis: { ...sceneConfig.yaxis, title: 'TIME (DAYS)' },+ zaxis: { ...sceneConfig.zaxis, title: 'CORRELATION COEFF' },+ }+ } as any}+ config={plotConfig}+ style={{ width: '100%', height: '100%' }}+ useResizeHandler={true}+ />+ );+ };++ const renderYieldCurve = () => {+ if (!yieldCurveData) return null;++ return (+ <Plot+ data={[{+ type: 'surface' as const,+ x: yieldCurveData.maturities,+ y: yieldCurveData.timePoints,+ z: yieldCurveData.z,+ colorscale: COLOR_SCALES.yieldCurve,+ colorbar: {+ title: { text: 'YIELD %', font: { size: 11, color: accentColor } },+ ...colorbarConfig,+ },+ hovertemplate: '<b>MATURITY:</b> %{x}M<br><b>YIELD:</b> %{z:.2f}%<extra></extra>'+ } as any]}+ layout={{+ ...baseLayout,+ scene: {+ ...sceneConfig,+ xaxis: { ...sceneConfig.xaxis, title: 'MATURITY (MONTHS)' },+ yaxis: { ...sceneConfig.yaxis, title: 'HISTORICAL DAYS' },+ zaxis: { ...sceneConfig.zaxis, title: 'YIELD (%)' },+ }+ } as any}+ config={plotConfig}+ style={{ width: '100%', height: '100%' }}+ useResizeHandler={true}+ />+ );+ };++ const renderPCA = () => {+ if (!pcaData) return null;++ return (+ <Plot+ data={[{+ type: 'surface' as const,+ z: pcaData.z,+ colorscale: COLOR_SCALES.pca,+ colorbar: {+ title: { text: 'LOADING', font: { size: 11, color: accentColor } },+ ...colorbarConfig,+ },+ hovertemplate: '<b>LOADING:</b> %{z:.3f}<extra></extra>'+ } as any]}+ layout={{+ ...baseLayout,+ scene: {+ ...sceneConfig,+ xaxis: { ...sceneConfig.xaxis, title: 'PRINCIPAL COMPONENT' },+ yaxis: { ...sceneConfig.yaxis, title: 'ASSET INDEX' },+ zaxis: { ...sceneConfig.zaxis, title: 'FACTOR LOADING' },+ }+ } as any}+ config={plotConfig}+ style={{ width: '100%', height: '100%' }}+ useResizeHandler={true}+ />+ );+ };++ const getChartTitle = (): string => {+ switch (chartType) {+ case 'volatility':+ return volatilityData+ ? `${volatilityData.underlying} OPTIONS - IMPLIED VOLATILITY SURFACE`+ : 'IMPLIED VOLATILITY SURFACE';+ case 'correlation':+ return correlationData+ ? `MULTI-ASSET CORRELATION MATRIX - ${correlationData.window} DAY ROLLING`+ : 'MULTI-ASSET CORRELATION MATRIX';+ case 'yield-curve':+ return 'U.S. TREASURY YIELD CURVE - HISTORICAL EVOLUTION';+ case 'pca':+ return 'PRINCIPAL COMPONENT ANALYSIS - FACTOR LOADINGS';+ default:+ return '';+ }+ };++ const getDataSource = (): string => {+ if (isDemoMode) {+ return 'DEMO DATA (SYNTHETIC)';+ }+ switch (chartType) {+ case 'volatility':+ return volatilityData ? `${volatilityData.underlying} | DATABENTO OPRA` : 'DATABENTO OPRA';+ case 'correlation':+ return 'MULTI-ASSET | DATABENTO';+ case 'yield-curve':+ return yieldCurveData?.source || 'UST | FEDERAL RESERVE';+ case 'pca':+ return 'PORTFOLIO | COMPUTED';+ default:+ return '';+ }+ };++ const renderContent = () => {+ if (loading) {+ return (+ <div style={{+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ }}>+ <RefreshCw size={32} className="animate-spin" style={{ color: accentColor }} />+ <span style={{+ marginTop: '16px',+ fontSize: TYPOGRAPHY.BODY_SIZE,+ color: FINCEPT_COLORS.MUTED,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ letterSpacing: '0.5px',+ }}>+ LOADING DATA...+ </span>+ </div>+ );+ }++ // Check if we have data to display+ const hasData = (chartType === 'volatility' && volatilityData) ||+ (chartType === 'correlation' && correlationData) ||+ (chartType === 'yield-curve' && yieldCurveData) ||+ (chartType === 'pca' && pcaData);++ // If we have data, show the chart (even if there was an error - demo data fallback)+ if (hasData) {+ return (+ <Suspense+ fallback={+ <div style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ }}>+ <RefreshCw size={24} className="animate-spin" style={{ color: accentColor }} />+ </div>+ }+ >+ {chartType === 'volatility' && renderVolatilitySurface()}+ {chartType === 'correlation' && renderCorrelationMatrix()}+ {chartType === 'yield-curve' && renderYieldCurve()}+ {chartType === 'pca' && renderPCA()}+ </Suspense>+ );+ }++ // Only show error if we have no data+ if (error) {+ // Parse error for user-friendly messages+ const isAuthError = error.toLowerCase().includes('401') || error.toLowerCase().includes('auth');+ const isAccessError = error.toLowerCase().includes('403') || error.toLowerCase().includes('access');+ const isNotFoundError = error.toLowerCase().includes('404') || error.toLowerCase().includes('not found');++ let errorTitle = 'FAILED TO LOAD DATA';+ let errorHelp = '';++ if (isAuthError) {+ errorTitle = 'AUTHENTICATION FAILED';+ errorHelp = 'Your Databento API key may be invalid, expired, or missing required permissions. Please verify your key at databento.com/portal/api-keys';+ } else if (isAccessError) {+ errorTitle = 'ACCESS DENIED';+ errorHelp = 'Your API key may not have access to this dataset. OPRA options data requires specific permissions.';+ } else if (isNotFoundError) {+ errorTitle = 'SYMBOL NOT FOUND';+ errorHelp = 'The requested symbol was not found. Try a different symbol like SPY, AAPL, or QQQ.';+ }++ return (+ <div style={{+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ padding: '24px',+ }}>+ <div style={{+ width: '48px',+ height: '48px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ backgroundColor: `${FINCEPT_COLORS.RED}20`,+ borderRadius: '50%',+ marginBottom: '16px',+ }}>+ <AlertCircle size={24} style={{ color: FINCEPT_COLORS.RED }} />+ </div>+ <div style={{+ fontSize: TYPOGRAPHY.HEADER_SIZE,+ fontWeight: 700,+ color: FINCEPT_COLORS.RED,+ marginBottom: '8px',+ }}>+ {errorTitle}+ </div>+ {errorHelp && (+ <span style={{+ fontSize: TYPOGRAPHY.BODY_SIZE,+ color: FINCEPT_COLORS.YELLOW,+ textAlign: 'center',+ maxWidth: '500px',+ lineHeight: '1.5',+ marginBottom: '12px',+ }}>+ {errorHelp}+ </span>+ )}+ <span style={{+ fontSize: '9px',+ color: FINCEPT_COLORS.MUTED,+ textAlign: 'center',+ maxWidth: '500px',+ lineHeight: '1.5',+ padding: '8px',+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ fontFamily: 'monospace',+ }}>+ {error}+ </span>+ </div>+ );+ }++ // Show empty state if no data and no error+ return (+ <div style={{+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ color: FINCEPT_COLORS.MUTED,+ fontSize: TYPOGRAPHY.BODY_SIZE,+ textAlign: 'center',+ }}>+ <TrendingUp size={48} style={{ marginBottom: '16px', opacity: 0.3 }} />+ <div style={{ fontWeight: 700, marginBottom: '8px' }}>NO DATA LOADED</div>+ <span>Click REFRESH to fetch data</span>+ </div>+ );+ };++ return (+ <div style={{+ flex: 1,+ display: 'flex',+ flexDirection: 'column',+ overflow: 'hidden',+ minWidth: 0,+ }}>+ {/* Chart Header */}+ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'space-between',+ padding: '8px 12px',+ backgroundColor: FINCEPT_COLORS.HEADER_BG,+ borderBottom: `1px solid ${FINCEPT_COLORS.BORDER}`,+ flexShrink: 0,+ }}+ >+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ fontWeight: 700,+ color: accentColor,+ letterSpacing: '0.5px',+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}>+ {getChartTitle()}+ </div>+ <div style={{+ fontSize: TYPOGRAPHY.LABEL_SIZE,+ color: FINCEPT_COLORS.CYAN,+ fontFamily: TYPOGRAPHY.FONT_FAMILY,+ }}>+ {getDataSource()}+ </div>+ </div>++ {/* Chart Area */}+ <div style={{+ flex: 1,+ overflow: 'hidden',+ backgroundColor: FINCEPT_COLORS.BLACK,+ }}>+ {renderContent()}+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/TimeframeSelector.tsx b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/TimeframeSelector.tsxnew file mode 100644index 000000000..ea538a7ad--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/TimeframeSelector.tsx@@ -0,0 +1,203 @@+/**+ * Surface Analytics - Timeframe Selector Component+ * Select OHLCV timeframes (1D, 1H, 1M, 1S)+ */++import React from 'react';+import { Clock, AlertTriangle, TrendingUp } from 'lucide-react';+import { FINCEPT_COLORS } from '../constants';+import type { OHLCVTimeframe, TimeframeInfo } from '../types';++interface TimeframeSelectorProps {+ value: OHLCVTimeframe;+ onChange: (timeframe: OHLCVTimeframe) => void;+ accentColor: string;+ textColor: string;+ disabled?: boolean;+}++// Timeframe definitions with metadata+const TIMEFRAMES: TimeframeInfo[] = [+ {+ value: 'ohlcv-1d',+ label: 'Daily',+ description: 'End-of-day OHLCV bars',+ costLevel: 'low',+ recordsPerDay: '1',+ },+ {+ value: 'ohlcv-eod',+ label: 'EOD',+ description: 'End-of-day with adjustments',+ costLevel: 'low',+ recordsPerDay: '1',+ },+ {+ value: 'ohlcv-1h',+ label: 'Hourly',+ description: '60-minute OHLCV bars',+ costLevel: 'low',+ recordsPerDay: '~7',+ },+ {+ value: 'ohlcv-1m',+ label: 'Minute',+ description: '1-minute OHLCV bars',+ costLevel: 'medium',+ recordsPerDay: '~390',+ },+ {+ value: 'ohlcv-1s',+ label: 'Second',+ description: '1-second OHLCV bars',+ costLevel: 'high',+ recordsPerDay: '~23K',+ },+];++const getCostLevelColor = (level: 'low' | 'medium' | 'high') => {+ switch (level) {+ case 'low': return FINCEPT_COLORS.GREEN;+ case 'medium': return FINCEPT_COLORS.YELLOW;+ case 'high': return FINCEPT_COLORS.RED;+ }+};++const getCostLevelLabel = (level: 'low' | 'medium' | 'high') => {+ switch (level) {+ case 'low': return '$';+ case 'medium': return '$$';+ case 'high': return '$$$';+ }+};++export const TimeframeSelector: React.FC<TimeframeSelectorProps> = ({+ value,+ onChange,+ accentColor,+ textColor,+ disabled = false,+}) => {+ const selectedTimeframe = TIMEFRAMES.find(tf => tf.value === value) || TIMEFRAMES[0];++ return (+ <div+ style={{+ backgroundColor: FINCEPT_COLORS.DARK_BG,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ padding: '12px',+ opacity: disabled ? 0.6 : 1,+ }}+ >+ {/* Header */}+ <div className="flex items-center gap-2 mb-3">+ <Clock size={14} style={{ color: accentColor }} />+ <span className="text-xs font-bold" style={{ color: accentColor, letterSpacing: '0.5px' }}>+ DATA TIMEFRAME+ </span>+ </div>++ {/* Timeframe Buttons */}+ <div className="grid grid-cols-5 gap-1 mb-3">+ {TIMEFRAMES.map(tf => {+ const isSelected = value === tf.value;+ return (+ <button+ key={tf.value}+ onClick={() => !disabled && onChange(tf.value)}+ disabled={disabled}+ className="flex flex-col items-center p-2 transition-all"+ style={{+ backgroundColor: isSelected ? accentColor : FINCEPT_COLORS.BLACK,+ border: `1px solid ${isSelected ? accentColor : FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ cursor: disabled ? 'not-allowed' : 'pointer',+ }}+ >+ <span+ className="text-xs font-bold"+ style={{ color: isSelected ? FINCEPT_COLORS.BLACK : textColor }}+ >+ {tf.label}+ </span>+ <span+ className="text-[9px] mt-0.5"+ style={{ color: isSelected ? FINCEPT_COLORS.BLACK : getCostLevelColor(tf.costLevel) }}+ >+ {getCostLevelLabel(tf.costLevel)}+ </span>+ </button>+ );+ })}+ </div>++ {/* Selected Timeframe Details */}+ <div+ className="p-2 text-xs"+ style={{+ backgroundColor: FINCEPT_COLORS.BLACK,+ border: `1px solid ${FINCEPT_COLORS.BORDER}`,+ borderRadius: '2px',+ }}+ >+ <div className="flex items-center justify-between mb-1">+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Schema:</span>+ <span className="font-mono" style={{ color: textColor }}>{selectedTimeframe.value}</span>+ </div>+ <div className="flex items-center justify-between mb-1">+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Description:</span>+ <span style={{ color: textColor }}>{selectedTimeframe.description}</span>+ </div>+ <div className="flex items-center justify-between">+ <span style={{ color: FINCEPT_COLORS.MUTED }}>Records/Day:</span>+ <span style={{ color: textColor }}>{selectedTimeframe.recordsPerDay}</span>+ </div>+ </div>++ {/* Warning for high-frequency data */}+ {selectedTimeframe.costLevel === 'high' && (+ <div+ className="flex items-center gap-2 mt-2 p-2 text-xs"+ style={{+ backgroundColor: `${FINCEPT_COLORS.YELLOW}15`,+ border: `1px solid ${FINCEPT_COLORS.YELLOW}50`,+ borderRadius: '2px',+ color: FINCEPT_COLORS.YELLOW,+ }}+ >+ <AlertTriangle size={12} />+ <span>High-frequency data generates many records and may incur higher costs</span>+ </div>+ )}++ {/* Data Volume Indicator */}+ <div className="mt-3">+ <div className="flex items-center justify-between mb-1">+ <span className="text-xs" style={{ color: FINCEPT_COLORS.MUTED }}>+ Data Volume+ </span>+ <div className="flex items-center gap-1">+ <TrendingUp size={10} style={{ color: getCostLevelColor(selectedTimeframe.costLevel) }} />+ <span className="text-xs" style={{ color: getCostLevelColor(selectedTimeframe.costLevel) }}>+ {selectedTimeframe.costLevel.toUpperCase()}+ </span>+ </div>+ </div>+ <div+ className="h-1 rounded"+ style={{ backgroundColor: FINCEPT_COLORS.BORDER }}+ >+ <div+ className="h-full rounded transition-all"+ style={{+ width: selectedTimeframe.costLevel === 'low' ? '20%' :+ selectedTimeframe.costLevel === 'medium' ? '60%' : '100%',+ backgroundColor: getCostLevelColor(selectedTimeframe.costLevel),+ }}+ />+ </div>+ </div>+ </div>+ );+};diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/index.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/index.tsnew file mode 100644index 000000000..a29bab07d--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/components/index.ts@@ -0,0 +1,13 @@+export { ControlBar } from './ControlBar';+export { MetricsPanel } from './MetricsPanel';+export { SettingsModal } from './SettingsModal';+export { SurfaceChart } from './SurfaceChart';+export { DatasetBrowser } from './DatasetBrowser';+export { CostEstimator } from './CostEstimator';+export { TimeframeSelector } from './TimeframeSelector';+export { ReferenceDataPanel } from './ReferenceDataPanel';+export { OrderBookPanel } from './OrderBookPanel';+export { LiveStreamPanel } from './LiveStreamPanel';+export { FuturesPanel } from './FuturesPanel';+export { BatchDownloadPanel } from './BatchDownloadPanel';+export { AdditionalSchemasPanel } from './AdditionalSchemasPanel';diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/constants.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/constants.tsnew file mode 100644index 000000000..36cdc015e--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/constants.ts@@ -0,0 +1,129 @@+/**+ * Surface Analytics - Constants+ */++// Default symbols for volatility surface analysis+export const VOL_SURFACE_SYMBOLS = [+ { value: 'SPY', label: 'SPY - S&P 500 ETF' },+ { value: 'QQQ', label: 'QQQ - NASDAQ 100 ETF' },+ { value: 'IWM', label: 'IWM - Russell 2000 ETF' },+ { value: 'VIX', label: 'VIX - Volatility Index' },+ { value: 'AAPL', label: 'AAPL - Apple Inc.' },+ { value: 'TSLA', label: 'TSLA - Tesla Inc.' },+ { value: 'NVDA', label: 'NVDA - NVIDIA Corp.' },+ { value: 'AMZN', label: 'AMZN - Amazon.com' },+] as const;++// Default assets for correlation analysis+export const CORRELATION_ASSETS = [+ 'SPY', // S&P 500+ 'QQQ', // NASDAQ 100+ 'IWM', // Russell 2000+ 'DIA', // Dow Jones+ 'GLD', // Gold+ 'SLV', // Silver+ 'TLT', // 20+ Year Treasury+ 'IEF', // 7-10 Year Treasury+ 'HYG', // High Yield Bonds+ 'LQD', // Investment Grade Bonds+ 'VNQ', // Real Estate+ 'EEM', // Emerging Markets+ 'EFA', // Developed Markets+ 'USO', // Oil+ 'UNG', // Natural Gas+] as const;++// Treasury maturities for yield curve+export const TREASURY_MATURITIES = [+ { months: 1, label: '1M' },+ { months: 2, label: '2M' },+ { months: 3, label: '3M' },+ { months: 6, label: '6M' },+ { months: 12, label: '1Y' },+ { months: 24, label: '2Y' },+ { months: 36, label: '3Y' },+ { months: 60, label: '5Y' },+ { months: 84, label: '7Y' },+ { months: 120, label: '10Y' },+ { months: 240, label: '20Y' },+ { months: 360, label: '30Y' },+] as const;++// Databento datasets+export const DATABENTO_DATASETS = {+ OPRA_OPTIONS: 'OPRA.PILLAR',+ CME_FUTURES: 'GLBX.MDP3',+ XNAS_EQUITIES: 'XNAS.ITCH',+} as const;++// Databento schemas+export const DATABENTO_SCHEMAS = {+ OHLCV_1D: 'ohlcv-1d',+ OHLCV_1H: 'ohlcv-1h',+ OHLCV_1M: 'ohlcv-1m',+ MBP_1: 'mbp-1',+ CMBP_1: 'cmbp-1', // Consolidated MBP for OPRA (2025+)+ DEFINITION: 'definition',+ TRADES: 'trades',+} as const;++// Risk-free rate (approximate, should be fetched from Fed)+export const RISK_FREE_RATE = 0.043; // 4.3%++// Color scales for charts+export const COLOR_SCALES = {+ volatility: [+ [0, '#1a237e'], [0.2, '#1565c0'], [0.4, '#0288d1'],+ [0.6, '#26c6da'], [0.75, '#ffa726'], [0.9, '#ff7043'], [1, '#d32f2f']+ ],+ correlation: [+ [0, '#b71c1c'], [0.3, '#e53935'], [0.45, '#ff9800'],+ [0.5, '#ffeb3b'], [0.65, '#7cb342'], [0.8, '#43a047'], [1, '#2e7d32']+ ],+ yieldCurve: [+ [0, '#1a237e'], [0.25, '#283593'], [0.4, '#3949ab'],+ [0.55, '#5e35b1'], [0.7, '#7e57c2'], [0.85, '#ba68c8'], [1, '#f06292']+ ],+ pca: [+ [0, '#0d47a1'], [0.2, '#1976d2'], [0.4, '#42a5f5'],+ [0.5, '#e0e0e0'], [0.6, '#ef5350'], [0.8, '#e53935'], [1, '#b71c1c']+ ],+} as const;++// Chart configuration+export const PLOTLY_CONFIG = {+ displayModeBar: true,+ displaylogo: false,+ modeBarButtonsToRemove: ['select2d', 'lasso2d'],+ responsive: true,+} as const;++// Terminal styling - UI Design System compliant+export const FINCEPT_COLORS = {+ ORANGE: '#FF8800', // Primary accent, CTAs, selected states+ WHITE: '#FFFFFF', // Primary text+ BLACK: '#000000', // Main background+ RED: '#FF3B3B', // Negative, errors, sell+ GREEN: '#00D66F', // Positive, success, buy+ GRAY: '#787878', // Secondary text, labels+ DARK_BG: '#000000', // Main background+ PANEL_BG: '#0F0F0F', // Card/panel background+ HEADER_BG: '#1A1A1A', // Header/toolbar background+ BORDER: '#2A2A2A', // Borders, dividers+ HOVER: '#1F1F1F', // Hover state background+ MUTED: '#4A4A4A', // Disabled, inactive+ CYAN: '#00E5FF', // Info, data values+ YELLOW: '#FFD700', // Alerts, prices+ BLUE: '#0088FF', // Secondary accent+ PURPLE: '#9D4EDD', // Tertiary accent+ ACCENT: '#FF8800',+} as const;++// Typography+export const TYPOGRAPHY = {+ FONT_FAMILY: '"IBM Plex Mono", "Consolas", monospace',+ LABEL_SIZE: '9px',+ BODY_SIZE: '10px',+ HEADER_SIZE: '11px',+ DATA_SIZE: '10px',+} as const;diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/index.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/index.tsnew file mode 100644index 000000000..fa4f9062d--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/index.ts@@ -0,0 +1,3 @@+export { useDatabentoApi } from './useDatabentoApi';+export { useSurfaceComputation } from './useSurfaceComputation';+export { useDemoData, generateDemoVolatilitySurface, generateDemoCorrelationMatrix, generateDemoYieldCurve, generateDemoPCA } from './useDemoData';diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDatabentoApi.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDatabentoApi.tsnew file mode 100644index 000000000..5a134163b--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDatabentoApi.ts@@ -0,0 +1,1711 @@+/**+ * Surface Analytics - Databento API Hook+ * Handles all Databento API interactions for volatility surfaces,+ * correlation matrices, and historical OHLCV data.+ */++import { useState, useCallback, useRef, useEffect } from 'react';+import { invoke } from '@tauri-apps/api/core';+import { listen, UnlistenFn } from '@tauri-apps/api/event';+import { sqliteService } from '@/services/core/sqliteService';+import type { DatabentoResponse } from '../types';++interface SymbolResolution {+ raw_symbol: string;+ instrument_id: string;+ start_date?: string;+ end_date?: string;+}++interface DatasetInfo {+ id: string;+ name: string;+ start_date?: string;+ end_date?: string;+ schemas?: string[];+}++interface CostEstimate {+ dataset: string;+ symbols: string[];+ schema: string;+ record_count: number;+ cost_usd: number;+}++interface SecurityMaster {+ raw_symbol: string;+ instrument_id: string;+ security_type: string;+ exchange: string;+ currency: string;+ name: string;+ description: string;+ sector: string;+ industry: string;+ market_cap: number | null;+ shares_outstanding: number | null;+}++interface CorporateAction {+ raw_symbol: string;+ action_type: string;+ ex_date: string;+ record_date: string;+ payment_date: string;+ amount: number | null;+ ratio: string | null;+ currency: string;+ description: string;+}++interface AdjustmentFactor {+ raw_symbol: string;+ date: string;+ split_factor: number;+ dividend_factor: number;+ cumulative_factor: number;+}++// Live Streaming Types+interface LiveStreamInfo {+ databento_available: boolean;+ schemas: string[];+ datasets: string[];+ stype_options: string[];+}++interface LiveStreamRecord {+ type: 'data' | 'status' | 'error' | 'info';+ timestamp: number;+ record?: {+ record_type: string;+ ts_event: string;+ symbol: string;+ schema: string;+ price?: number;+ size?: number;+ side?: string;+ levels?: Array<{+ bid_px: number;+ ask_px: number;+ bid_sz: number;+ ask_sz: number;+ }>;+ [key: string]: unknown;+ };+ message?: string;+ connected?: boolean;+}++type LiveStreamCallback = (record: LiveStreamRecord) => void;++// Futures Types+interface FuturesContract {+ symbol: string;+ smart_symbol: string;+ name: string;+ exchange: string;+ tick_size: number;+ multiplier: number;+}++interface FuturesDefinition {+ raw_symbol: string;+ instrument_id: number;+ exchange: string;+ underlying: string;+ expiration: string | null;+ contract_multiplier: number;+ min_price_increment: number;+ currency: string;+}++interface TermStructurePoint {+ contract_month: number;+ smart_symbol: string;+ close: number;+ volume: number;+}++// Batch Download Types+interface BatchJob {+ job_id: string;+ state: 'queued' | 'processing' | 'done' | 'expired';+ dataset: string;+ schema: string;+ symbols: string[];+ start: string;+ end: string;+ encoding: string;+ compression: string;+ cost: number;+ record_count: number;+ ts_received: string;+ ts_process_start: string;+ ts_process_done: string;+ size_bytes: number;+}++interface BatchFile {+ filename: string;+ size_bytes: number;+ hash: string;+ urls: Record<string, string>;+}++interface BatchJobSubmitResult {+ job_id: string;+ state: string;+ dataset: string;+ symbols: string[];+ schema: string;+ start_date: string;+ end_date: string;+ encoding: string;+ compression: string;+ cost: number;+ record_count: number;+ ts_received: string;+}++// Additional Schema Types+interface TradeRecord {+ ts_event: string;+ symbol: string;+ price: number;+ size: number;+ action: string | null;+ side: string | null;+ sequence: number;+}++interface ImbalanceRecord {+ ts_event: string;+ symbol: string;+ ref_price: number;+ paired_qty: number;+ imbalance_qty: number;+ imbalance_side: string | null;+ auction_type: string | null;+}++interface StatisticsRecord {+ ts_event: string;+ symbol: string;+ stat_type: string | null;+ price: number;+ quantity: number;+ sequence: number;+ ts_ref: string | null;+}++interface StatusRecord {+ ts_event: string;+ symbol: string;+ action: string | null;+ reason: string | null;+ trading_event: string | null;+ is_short_sell_restricted: boolean | null;+}++interface UseDatabentoApiResult {+ // Data fetching+ testConnection: () => Promise<DatabentoResponse>;+ fetchOptionsChain: (symbol: string, date?: string) => Promise<DatabentoResponse>;+ fetchOptionsDefinitions: (symbol: string, date?: string) => Promise<DatabentoResponse>;+ fetchHistoricalBars: (symbols: string[], days?: number, schema?: string) => Promise<DatabentoResponse>;+ fetchHistoricalOHLCV: (symbols: string[], days?: number, dataset?: string, schema?: string) => Promise<DatabentoResponse>;++ // Symbol search & resolution+ resolveSymbols: (symbols: string[], dataset?: string) => Promise<DatabentoResponse<SymbolResolution[]>>;+ searchSymbol: (query: string, dataset?: string) => Promise<DatabentoResponse<SymbolResolution[]>>;++ // Metadata+ listDatasets: () => Promise<DatabentoResponse<DatasetInfo[]>>;+ getDatasetInfo: (dataset: string) => Promise<DatabentoResponse<DatasetInfo>>;+ listSchemas: (dataset?: string) => Promise<DatabentoResponse<string[]>>;++ // Cost estimation+ getCostEstimate: (dataset: string, symbols: string[], schema: string, startDate: string, endDate: string) => Promise<DatabentoResponse<CostEstimate>>;++ // Reference Data+ getSecurityMaster: (symbols: string[], dataset?: string) => Promise<DatabentoResponse<{ securities: SecurityMaster[] }>>;+ getCorporateActions: (symbols: string[], startDate?: string, endDate?: string, actionType?: string) => Promise<DatabentoResponse<{ actions: CorporateAction[] }>>;+ getAdjustmentFactors: (symbols: string[], startDate?: string, endDate?: string) => Promise<DatabentoResponse<{ factors: AdjustmentFactor[] }>>;++ // Live Streaming+ getLiveStreamInfo: () => Promise<DatabentoResponse<LiveStreamInfo>>;+ startLiveStream: (+ dataset: string,+ schema: string,+ symbols: string[],+ callback: LiveStreamCallback,+ options?: { stypeIn?: string; snapshot?: boolean }+ ) => Promise<{ streamId: string } | { error: true; message: string }>;+ stopLiveStream: (streamId: string) => Promise<DatabentoResponse>;+ stopAllLiveStreams: () => Promise<DatabentoResponse>;+ listLiveStreams: () => Promise<DatabentoResponse<{ streams: string[]; count: number }>>;+ activeStreams: string[];++ // Futures (GLBX.MDP3, SMART symbology)+ listFuturesContracts: () => Promise<DatabentoResponse<{ contracts: FuturesContract[]; count: number }>>;+ getFuturesData: (symbols: string[], days?: number, schema?: string, stypeIn?: string) => Promise<DatabentoResponse>;+ getFuturesDefinitions: (symbols: string[], date?: string) => Promise<DatabentoResponse<{ definitions: FuturesDefinition[] }>>;+ getFuturesTermStructure: (rootSymbol: string, numContracts?: number) => Promise<DatabentoResponse<{ term_structure: TermStructurePoint[] }>>;++ // Batch Download+ submitBatchJob: (+ dataset: string,+ symbols: string[],+ schema: string,+ startDate: string,+ endDate: string,+ options?: {+ encoding?: string;+ compression?: string;+ stypeIn?: string;+ splitDuration?: string;+ delivery?: string;+ }+ ) => Promise<DatabentoResponse<BatchJobSubmitResult>>;+ listBatchJobs: (states?: string, sinceDays?: number) => Promise<DatabentoResponse<{ jobs: BatchJob[]; count: number }>>;+ listBatchFiles: (jobId: string) => Promise<DatabentoResponse<{ files: BatchFile[]; count: number; total_size_bytes: number }>>;+ downloadBatchJob: (jobId: string, outputDir?: string, filename?: string) => Promise<DatabentoResponse<{ files: string[]; count: number; output_dir: string }>>;++ // Additional Schemas+ getTrades: (symbols: string[], dataset?: string, days?: number, limit?: number) => Promise<DatabentoResponse<{ trades: TradeRecord[]; count: number }>>;+ getImbalance: (symbols: string[], dataset?: string, days?: number) => Promise<DatabentoResponse<{ imbalances: ImbalanceRecord[]; count: number }>>;+ getStatistics: (symbols: string[], dataset?: string, days?: number) => Promise<DatabentoResponse<{ statistics: StatisticsRecord[]; count: number }>>;+ getStatus: (symbols: string[], dataset?: string, days?: number) => Promise<DatabentoResponse<{ statuses: StatusRecord[]; count: number }>>;+ getSchemaData: (symbols: string[], schema: string, dataset?: string, days?: number, limit?: number) => Promise<DatabentoResponse>;++ // API key management+ apiKey: string | null;+ loadApiKey: () => Promise<void>;+ hasApiKey: boolean;++ // State+ loading: boolean;+ error: string | null;+}++export function useDatabentoApi(): UseDatabentoApiResult {+ const [apiKey, setApiKey] = useState<string | null>(null);+ const [loading, setLoading] = useState(false);+ const [error, setError] = useState<string | null>(null);+ const [activeStreams, setActiveStreams] = useState<string[]>([]);++ // Store event listeners for cleanup+ const streamListeners = useRef<Map<string, UnlistenFn>>(new Map());++ // Cleanup listeners on unmount+ useEffect(() => {+ return () => {+ // Cleanup all active stream listeners+ streamListeners.current.forEach((unlisten) => unlisten());+ streamListeners.current.clear();+ };+ }, []);++ const loadApiKey = useCallback(async () => {+ try {+ const key = await sqliteService.getApiKey('DATABENTO_API_KEY');+ setApiKey(key);+ } catch (err) {+ console.error('Failed to load Databento API key:', err);+ setError('Failed to load API key');+ }+ }, []);++ /**+ * Test the Databento API connection with current API key+ */+ const testConnection = useCallback(async (): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured. Please add it in Settings.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_test_connection', {+ apiKey: apiKey,+ });+ return JSON.parse(result);+ } catch (err) {+ const errorMsg = `Connection test failed: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Fetch options chain data for volatility surface+ * NOTE: Requires OPRA.PILLAR access (paid dataset)+ */+ const fetchOptionsChain = useCallback(async (+ symbol: string,+ date?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured. Please add it in Settings > Credentials.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_options_chain', {+ apiKey: apiKey,+ symbol,+ date: date || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch options chain: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Fetch options definitions (instrument metadata)+ * NOTE: Requires OPRA.PILLAR access (paid dataset)+ */+ const fetchOptionsDefinitions = useCallback(async (+ symbol: string,+ date?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_options_definitions', {+ apiKey: apiKey,+ symbol,+ date: date || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch options definitions: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Fetch multi-asset historical data for correlation matrix+ * Uses DBEQ.BASIC (free) first, falls back to XNAS.ITCH+ * Supports multiple timeframes: ohlcv-1d, ohlcv-1h, ohlcv-1m, ohlcv-1s, ohlcv-eod+ */+ const fetchHistoricalBars = useCallback(async (+ symbols: string[],+ days: number = 60,+ schema?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured. Please add it in Settings > Credentials.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_multi_asset_data', {+ apiKey: apiKey,+ symbols,+ days,+ schema: schema || 'ohlcv-1d',+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch historical data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Fetch historical OHLCV data with optional dataset and schema override+ * Supports multiple timeframes: ohlcv-1d, ohlcv-1h, ohlcv-1m, ohlcv-1s, ohlcv-eod+ */+ const fetchHistoricalOHLCV = useCallback(async (+ symbols: string[],+ days: number = 30,+ dataset?: string,+ schema?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_historical_ohlcv', {+ apiKey: apiKey,+ symbols,+ days,+ dataset: dataset || null,+ schema: schema || 'ohlcv-1d',+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch OHLCV data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Resolve/validate symbols using Databento symbology+ */+ const resolveSymbols = useCallback(async (+ symbols: string[],+ dataset?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_resolve_symbols', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ stypeIn: null,+ stypeOut: null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to resolve symbols: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Search for a symbol (wrapper around resolveSymbols for single symbol)+ */+ const searchSymbol = useCallback(async (+ query: string,+ dataset?: string+ ): Promise<DatabentoResponse> => {+ return resolveSymbols([query.toUpperCase().trim()], dataset);+ }, [resolveSymbols]);++ /**+ * List all available datasets+ */+ const listDatasets = useCallback(async (): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_datasets', {+ apiKey: apiKey,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to list datasets: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get detailed info about a dataset+ */+ const getDatasetInfo = useCallback(async (+ dataset: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_dataset_info', {+ apiKey: apiKey,+ dataset,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to get dataset info: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * List available schemas for a dataset+ */+ const listSchemas = useCallback(async (+ dataset?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_schemas', {+ apiKey: apiKey,+ dataset: dataset || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to list schemas: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get cost estimate before executing a query+ */+ const getCostEstimate = useCallback(async (+ dataset: string,+ symbols: string[],+ schema: string,+ startDate: string,+ endDate: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_cost_estimate', {+ apiKey: apiKey,+ dataset,+ symbols,+ schema,+ startDate,+ endDate,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to get cost estimate: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get security master data (instrument metadata, fundamental info)+ */+ const getSecurityMaster = useCallback(async (+ symbols: string[],+ dataset?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_security_master', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to get security master: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get corporate actions (dividends, splits, spinoffs, etc.)+ */+ const getCorporateActions = useCallback(async (+ symbols: string[],+ startDate?: string,+ endDate?: string,+ actionType?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_corporate_actions', {+ apiKey: apiKey,+ symbols,+ startDate: startDate || null,+ endDate: endDate || null,+ actionType: actionType || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to get corporate actions: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get adjustment factors for historical price adjustments+ */+ const getAdjustmentFactors = useCallback(async (+ symbols: string[],+ startDate?: string,+ endDate?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_adjustment_factors', {+ apiKey: apiKey,+ symbols,+ startDate: startDate || null,+ endDate: endDate || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to get adjustment factors: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ // ==========================================================================+ // Live Streaming API+ // ==========================================================================++ /**+ * Get live streaming capabilities and info+ */+ const getLiveStreamInfo = useCallback(async (): Promise<DatabentoResponse> => {+ try {+ const result = await invoke<string>('databento_live_info');+ return JSON.parse(result);+ } catch (err) {+ const errorMsg = `Failed to get live stream info: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ }+ }, []);++ /**+ * Start a live data stream+ */+ const startLiveStream = useCallback(async (+ dataset: string,+ schema: string,+ symbols: string[],+ callback: LiveStreamCallback,+ options?: { stypeIn?: string; snapshot?: boolean }+ ): Promise<{ streamId: string } | { error: true; message: string }> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ };+ }++ try {+ const result = await invoke<string>('databento_live_start', {+ apiKey: apiKey,+ dataset,+ schema,+ symbols,+ stypeIn: options?.stypeIn || 'raw_symbol',+ snapshot: options?.snapshot || false,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ return { error: true, message: parsed.message };+ }++ const streamId = parsed.stream_id;++ // Set up event listener for this stream+ const eventName = `databento-live-${streamId}`;+ const unlisten = await listen<LiveStreamRecord>(eventName, (event) => {+ callback(event.payload);+ });++ // Store listener for cleanup+ streamListeners.current.set(streamId, unlisten);+ setActiveStreams((prev) => [...prev, streamId]);++ return { streamId };+ } catch (err) {+ const errorMsg = `Failed to start live stream: ${err}`;+ setError(errorMsg);+ return { error: true, message: errorMsg };+ }+ }, [apiKey]);++ /**+ * Stop a live data stream+ */+ const stopLiveStream = useCallback(async (+ streamId: string+ ): Promise<DatabentoResponse> => {+ try {+ // Remove event listener+ const unlisten = streamListeners.current.get(streamId);+ if (unlisten) {+ unlisten();+ streamListeners.current.delete(streamId);+ }++ const result = await invoke<string>('databento_live_stop', {+ streamId,+ });+ const parsed = JSON.parse(result);++ // Update active streams+ setActiveStreams((prev) => prev.filter((id) => id !== streamId));++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to stop live stream: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ }+ }, []);++ /**+ * Stop all active live streams+ */+ const stopAllLiveStreams = useCallback(async (): Promise<DatabentoResponse> => {+ try {+ // Remove all event listeners+ streamListeners.current.forEach((unlisten) => unlisten());+ streamListeners.current.clear();++ const result = await invoke<string>('databento_live_stop_all');+ const parsed = JSON.parse(result);++ setActiveStreams([]);++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to stop all streams: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ }+ }, []);++ /**+ * List all active live streams+ */+ const listLiveStreams = useCallback(async (): Promise<DatabentoResponse> => {+ try {+ const result = await invoke<string>('databento_live_list');+ return JSON.parse(result);+ } catch (err) {+ const errorMsg = `Failed to list live streams: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ }+ }, []);++ // ==========================================================================+ // Futures API (GLBX.MDP3, SMART symbology)+ // ==========================================================================++ /**+ * List available futures contracts with specifications+ */+ const listFuturesContracts = useCallback(async (): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ try {+ const result = await invoke<string>('databento_list_futures', {+ apiKey: apiKey,+ });+ return JSON.parse(result);+ } catch (err) {+ const errorMsg = `Failed to list futures contracts: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ }+ }, [apiKey]);++ /**+ * Fetch futures data using SMART symbology+ */+ const getFuturesData = useCallback(async (+ symbols: string[],+ days: number = 30,+ schema: string = 'ohlcv-1d',+ stypeIn: string = 'smart'+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_futures_data', {+ apiKey: apiKey,+ symbols,+ days,+ schema,+ stypeIn,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch futures data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get futures contract definitions+ */+ const getFuturesDefinitions = useCallback(async (+ symbols: string[],+ date?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_futures_definitions', {+ apiKey: apiKey,+ symbols,+ date: date || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch futures definitions: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get futures term structure (curve)+ */+ const getFuturesTermStructure = useCallback(async (+ rootSymbol: string,+ numContracts: number = 6+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_futures_term_structure', {+ apiKey: apiKey,+ rootSymbol,+ numContracts,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch term structure: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ // ==========================================================================+ // Batch Download API+ // ==========================================================================++ /**+ * Submit a batch download job for large data requests+ */+ const submitBatchJob = useCallback(async (+ dataset: string,+ symbols: string[],+ schema: string,+ startDate: string,+ endDate: string,+ options?: {+ encoding?: string;+ compression?: string;+ stypeIn?: string;+ splitDuration?: string;+ delivery?: string;+ }+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_submit_batch_job', {+ apiKey: apiKey,+ dataset,+ symbols,+ schema,+ startDate,+ endDate,+ encoding: options?.encoding || null,+ compression: options?.compression || null,+ stypeIn: options?.stypeIn || null,+ splitDuration: options?.splitDuration || null,+ delivery: options?.delivery || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to submit batch job: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * List batch download jobs+ */+ const listBatchJobs = useCallback(async (+ states?: string,+ sinceDays?: number+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_batch_jobs', {+ apiKey: apiKey,+ states: states || null,+ sinceDays: sinceDays || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to list batch jobs: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * List files from a batch job+ */+ const listBatchFiles = useCallback(async (+ jobId: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_list_batch_files', {+ apiKey: apiKey,+ jobId,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to list batch files: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Download files from a completed batch job+ */+ const downloadBatchJob = useCallback(async (+ jobId: string,+ outputDir?: string,+ filename?: string+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_download_batch_job', {+ apiKey: apiKey,+ jobId,+ outputDir: outputDir || null,+ filename: filename || null,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to download batch job: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ // ==========================================================================+ // Additional Schemas API (TRADES, IMBALANCE, STATISTICS, STATUS)+ // ==========================================================================++ /**+ * Get trades data for symbols+ */+ const getTrades = useCallback(async (+ symbols: string[],+ dataset?: string,+ days: number = 1,+ limit: number = 1000+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_trades', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ days,+ limit,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch trades: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get auction imbalance data+ */+ const getImbalance = useCallback(async (+ symbols: string[],+ dataset?: string,+ days: number = 1+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_imbalance', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ days,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch imbalance data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get exchange statistics+ */+ const getStatistics = useCallback(async (+ symbols: string[],+ dataset?: string,+ days: number = 5+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_statistics', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ days,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch statistics: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get instrument status+ */+ const getStatus = useCallback(async (+ symbols: string[],+ dataset?: string,+ days: number = 5+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_status', {+ apiKey: apiKey,+ symbols,+ dataset: dataset || null,+ days,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch status data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ /**+ * Get generic schema data+ */+ const getSchemaData = useCallback(async (+ symbols: string[],+ schema: string,+ dataset?: string,+ days: number = 1,+ limit: number = 1000+ ): Promise<DatabentoResponse> => {+ if (!apiKey) {+ return {+ error: true,+ message: 'Databento API key not configured.',+ timestamp: Date.now(),+ };+ }++ setLoading(true);+ setError(null);++ try {+ const result = await invoke<string>('databento_get_schema_data', {+ apiKey: apiKey,+ symbols,+ schema,+ dataset: dataset || null,+ days,+ limit,+ });+ const parsed = JSON.parse(result);++ if (parsed.error) {+ setError(parsed.message);+ }++ return parsed;+ } catch (err) {+ const errorMsg = `Failed to fetch ${schema} data: ${err}`;+ setError(errorMsg);+ return {+ error: true,+ message: errorMsg,+ timestamp: Date.now(),+ };+ } finally {+ setLoading(false);+ }+ }, [apiKey]);++ return {+ testConnection,+ fetchOptionsChain,+ fetchOptionsDefinitions,+ fetchHistoricalBars,+ fetchHistoricalOHLCV,+ resolveSymbols,+ searchSymbol,+ listDatasets,+ getDatasetInfo,+ listSchemas,+ getCostEstimate,+ // Reference Data+ getSecurityMaster,+ getCorporateActions,+ getAdjustmentFactors,+ // Live Streaming+ getLiveStreamInfo,+ startLiveStream,+ stopLiveStream,+ stopAllLiveStreams,+ listLiveStreams,+ activeStreams,+ // Futures+ listFuturesContracts,+ getFuturesData,+ getFuturesDefinitions,+ getFuturesTermStructure,+ // Batch Download+ submitBatchJob,+ listBatchJobs,+ listBatchFiles,+ downloadBatchJob,+ // Additional Schemas+ getTrades,+ getImbalance,+ getStatistics,+ getStatus,+ getSchemaData,+ apiKey,+ loadApiKey,+ hasApiKey: !!apiKey,+ loading,+ error,+ };+}diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDemoData.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDemoData.tsnew file mode 100644index 000000000..4bb0f381c--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useDemoData.ts@@ -0,0 +1,256 @@+/**+ * Surface Analytics - Demo Data Generator+ * Generates realistic synthetic data for visualization when API is unavailable+ * Used as fallback when Databento API fails or for demo purposes+ */++import { useCallback } from 'react';+import type {+ VolatilitySurfaceData,+ CorrelationMatrixData,+ YieldCurveData,+ PCAData,+} from '../types';++/**+ * Generate realistic volatility smile/skew pattern+ */+function generateVolSmile(+ moneyness: number, // Strike / Spot+ dte: number, // Days to expiration+ baseVol: number = 0.20+): number {+ // ATM vol decreases with time (term structure)+ const atmVol = baseVol * (1 + 0.1 * Math.exp(-dte / 60));++ // Skew: OTM puts have higher IV (negative skew)+ const skew = -0.15 * (1 - moneyness);++ // Smile: both wings have elevated IV+ const smile = 0.08 * Math.pow(moneyness - 1, 2) * (1 + 30 / dte);++ // Random noise+ const noise = (Math.random() - 0.5) * 0.02;++ return Math.max(0.05, atmVol + skew + smile + noise);+}++/**+ * Generate demo volatility surface data+ */+export function generateDemoVolatilitySurface(+ symbol: string = 'SPY',+ spotPrice: number = 450+): VolatilitySurfaceData {+ // Generate strikes around spot price (80% to 120%)+ const numStrikes = 15;+ const strikes: number[] = [];+ for (let i = 0; i < numStrikes; i++) {+ const pct = 0.80 + (i / (numStrikes - 1)) * 0.40;+ strikes.push(Math.round(spotPrice * pct));+ }++ // Generate expirations (7 DTE to 180 DTE)+ const expirations = [7, 14, 21, 30, 45, 60, 90, 120, 180];++ // Generate IV surface+ const z: number[][] = [];+ for (const dte of expirations) {+ const row: number[] = [];+ for (const strike of strikes) {+ const moneyness = strike / spotPrice;+ const iv = generateVolSmile(moneyness, dte, 0.18);+ row.push(iv * 100); // Convert to percentage+ }+ z.push(row);+ }++ return {+ strikes,+ expirations,+ z,+ underlying: symbol,+ spotPrice,+ timestamp: Date.now(),+ };+}++/**+ * Generate demo correlation matrix with realistic asset correlations+ */+export function generateDemoCorrelationMatrix(+ assets: string[] = ['SPY', 'QQQ', 'IWM', 'GLD', 'TLT', 'VIX']+): CorrelationMatrixData {+ // Base correlation structure (realistic for these assets)+ const baseCorrelations: Record<string, Record<string, number>> = {+ SPY: { SPY: 1.0, QQQ: 0.92, IWM: 0.88, GLD: 0.05, TLT: -0.35, VIX: -0.75 },+ QQQ: { SPY: 0.92, QQQ: 1.0, IWM: 0.82, GLD: 0.02, TLT: -0.38, VIX: -0.72 },+ IWM: { SPY: 0.88, QQQ: 0.82, IWM: 1.0, GLD: 0.08, TLT: -0.30, VIX: -0.68 },+ GLD: { SPY: 0.05, QQQ: 0.02, IWM: 0.08, GLD: 1.0, TLT: 0.35, VIX: 0.10 },+ TLT: { SPY: -0.35, QQQ: -0.38, IWM: -0.30, GLD: 0.35, TLT: 1.0, VIX: 0.20 },+ VIX: { SPY: -0.75, QQQ: -0.72, IWM: -0.68, GLD: 0.10, TLT: 0.20, VIX: 1.0 },+ };++ // Generate time-varying correlations (30 time points)+ const numTimePoints = 30;+ const timePoints: number[] = [];+ const z: number[][] = [];++ for (let t = 0; t < numTimePoints; t++) {+ timePoints.push(t);+ const row: number[] = [];++ // Correlation regime changes over time+ const regimeShift = Math.sin(t / 10) * 0.1;++ for (let i = 0; i < assets.length; i++) {+ for (let j = 0; j < assets.length; j++) {+ const asset1 = assets[i];+ const asset2 = assets[j];++ let corr = baseCorrelations[asset1]?.[asset2] ?? 0.5;++ // Add time variation+ if (i !== j) {+ corr += regimeShift * (1 - Math.abs(corr));+ // Add noise+ corr += (Math.random() - 0.5) * 0.05;+ // Clamp to valid range+ corr = Math.max(-0.99, Math.min(0.99, corr));+ }++ row.push(corr);+ }+ }+ z.push(row);+ }++ return {+ assets,+ timePoints,+ z,+ window: 30,+ timestamp: Date.now(),+ };+}++/**+ * Generate demo yield curve evolution+ */+export function generateDemoYieldCurve(): YieldCurveData {+ // Treasury maturities in months+ const maturities = [1, 3, 6, 12, 24, 36, 60, 84, 120, 240, 360];++ // Generate historical yield curves (60 days)+ const numDays = 60;+ const timePoints: number[] = [];+ const z: number[][] = [];++ // Base yield curve (as of late 2024 - inverted)+ const baseYields = [5.25, 5.30, 5.15, 4.85, 4.30, 4.15, 4.10, 4.20, 4.35, 4.50, 4.55];++ for (let day = 0; day < numDays; day++) {+ timePoints.push(day);+ const row: number[] = [];++ // Simulate yield changes over time+ const trendShift = (day - numDays / 2) / numDays * 0.3;+ const volatility = Math.sin(day / 5) * 0.1;++ for (let i = 0; i < maturities.length; i++) {+ let yield_ = baseYields[i] + trendShift + volatility * (1 - i / maturities.length);+ yield_ += (Math.random() - 0.5) * 0.05;+ yield_ = Math.max(0.1, yield_);+ row.push(yield_);+ }+ z.push(row);+ }++ return {+ maturities,+ timePoints,+ z,+ source: 'DEMO',+ timestamp: Date.now(),+ };+}++/**+ * Generate demo PCA factor loadings+ */+export function generateDemoPCA(+ assets: string[] = ['SPY', 'QQQ', 'IWM', 'GLD', 'TLT', 'VIX', 'EEM', 'HYG']+): PCAData {+ const numFactors = Math.min(assets.length, 5);+ const factors = Array.from({ length: numFactors }, (_, i) => `PC${i + 1}`);++ // Realistic factor loadings+ // PC1: Market factor (all equities positive, bonds/gold negative)+ // PC2: Value vs Growth+ // PC3: Volatility factor+ // etc.+ const factorPatterns = [+ // PC1: Market+ { SPY: 0.95, QQQ: 0.90, IWM: 0.92, GLD: 0.15, TLT: -0.30, VIX: -0.80, EEM: 0.85, HYG: 0.60 },+ // PC2: Growth vs Value+ { SPY: 0.10, QQQ: 0.70, IWM: -0.50, GLD: -0.05, TLT: 0.05, VIX: -0.20, EEM: -0.30, HYG: -0.15 },+ // PC3: Risk-off+ { SPY: -0.15, QQQ: -0.20, IWM: -0.10, GLD: 0.65, TLT: 0.70, VIX: 0.30, EEM: -0.25, HYG: -0.35 },+ // PC4: EM specific+ { SPY: 0.05, QQQ: 0.00, IWM: 0.10, GLD: 0.20, TLT: -0.05, VIX: -0.10, EEM: 0.80, HYG: 0.25 },+ // PC5: Credit+ { SPY: 0.10, QQQ: 0.05, IWM: 0.15, GLD: -0.10, TLT: -0.25, VIX: -0.20, EEM: 0.15, HYG: 0.75 },+ ];++ const z: number[][] = [];+ for (const asset of assets) {+ const row: number[] = [];+ for (let f = 0; f < numFactors; f++) {+ const pattern = factorPatterns[f] || {};+ let loading = pattern[asset as keyof typeof pattern] ?? (Math.random() - 0.5) * 0.3;+ // Add small noise+ loading += (Math.random() - 0.5) * 0.05;+ row.push(loading);+ }+ z.push(row);+ }++ // Variance explained (typical PCA decay)+ const varianceExplained = [0.55, 0.18, 0.12, 0.08, 0.04].slice(0, numFactors);++ return {+ factors,+ assets,+ z,+ varianceExplained,+ timestamp: Date.now(),+ };+}++/**+ * Hook to generate demo data+ */+export function useDemoData() {+ const generateVolatilitySurface = useCallback((symbol: string, spotPrice: number) => {+ return generateDemoVolatilitySurface(symbol, spotPrice);+ }, []);++ const generateCorrelationMatrix = useCallback((assets: string[]) => {+ return generateDemoCorrelationMatrix(assets);+ }, []);++ const generateYieldCurve = useCallback(() => {+ return generateDemoYieldCurve();+ }, []);++ const generatePCA = useCallback((assets: string[]) => {+ return generateDemoPCA(assets);+ }, []);++ return {+ generateVolatilitySurface,+ generateCorrelationMatrix,+ generateYieldCurve,+ generatePCA,+ };+}diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useSurfaceComputation.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useSurfaceComputation.tsnew file mode 100644index 000000000..6dfe1ff02--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/hooks/useSurfaceComputation.ts@@ -0,0 +1,355 @@+/**+ * Surface Analytics - Computation Hook+ * Handles all analytics computations (IV, correlations, PCA)+ */++import { useMemo, useCallback } from 'react';+import type {+ VolatilitySurfaceData,+ CorrelationMatrixData,+ YieldCurveData,+ PCAData,+ OptionsChainRecord,+ HistoricalBar,+} from '../types';+import { RISK_FREE_RATE } from '../constants';++// Normal distribution CDF approximation+function normCdf(x: number): number {+ const a1 = 0.254829592;+ const a2 = -0.284496736;+ const a3 = 1.421413741;+ const a4 = -1.453152027;+ const a5 = 1.061405429;+ const p = 0.3275911;++ const sign = x < 0 ? -1 : 1;+ x = Math.abs(x) / Math.sqrt(2);++ const t = 1.0 / (1.0 + p * x);+ const y = 1.0 - (((((a5 * t + a4) * t) + a3) * t + a2) * t + a1) * t * Math.exp(-x * x);++ return 0.5 * (1.0 + sign * y);+}++// Normal distribution PDF+function normPdf(x: number): number {+ return Math.exp(-0.5 * x * x) / Math.sqrt(2 * Math.PI);+}++// Black-Scholes price calculation+function blackScholesPrice(+ S: number, // Spot price+ K: number, // Strike price+ T: number, // Time to expiry (years)+ r: number, // Risk-free rate+ sigma: number, // Volatility+ isCall: boolean+): number {+ if (T <= 0 || sigma <= 0) return 0;++ const d1 = (Math.log(S / K) + (r + sigma * sigma / 2) * T) / (sigma * Math.sqrt(T));+ const d2 = d1 - sigma * Math.sqrt(T);++ if (isCall) {+ return S * normCdf(d1) - K * Math.exp(-r * T) * normCdf(d2);+ } else {+ return K * Math.exp(-r * T) * normCdf(-d2) - S * normCdf(-d1);+ }+}++// Implied volatility using Newton-Raphson method+function computeImpliedVolatility(+ optionPrice: number,+ S: number,+ K: number,+ T: number,+ r: number,+ isCall: boolean,+ maxIterations: number = 100,+ tolerance: number = 1e-6+): number | null {+ if (optionPrice <= 0 || T <= 0) return null;++ // Initial guess using Brenner-Subrahmanyam approximation+ let sigma = Math.sqrt(2 * Math.PI / T) * optionPrice / S;+ sigma = Math.max(0.01, Math.min(5.0, sigma)); // Bound initial guess++ for (let i = 0; i < maxIterations; i++) {+ const price = blackScholesPrice(S, K, T, r, sigma, isCall);+ const diff = price - optionPrice;++ if (Math.abs(diff) < tolerance) {+ return sigma;+ }++ // Vega for Newton-Raphson step+ const d1 = (Math.log(S / K) + (r + sigma * sigma / 2) * T) / (sigma * Math.sqrt(T));+ const vega = S * normPdf(d1) * Math.sqrt(T);++ if (vega < 1e-10) break; // Avoid division by zero++ sigma = sigma - diff / vega;++ if (sigma <= 0.001 || sigma > 10) break; // Bounds check+ }++ return null; // Failed to converge+}++export function useSurfaceComputation() {+ /**+ * Compute volatility surface from options chain data+ */+ const computeVolatilitySurface = useCallback((+ optionsData: OptionsChainRecord[],+ spotPrice: number,+ riskFreeRate: number = RISK_FREE_RATE+ ): VolatilitySurfaceData | null => {+ if (!optionsData || optionsData.length === 0) {+ return null;+ }++ // Get unique strikes and expirations+ const strikes = [...new Set(optionsData.map(o => o.strike_price))].sort((a, b) => a - b);+ const expirations = [...new Set(optionsData.map(o => o.expiration))].sort((a, b) => a - b);++ // Convert expirations to days+ const now = Date.now();+ const expirationDays = expirations.map(exp =>+ Math.max(1, Math.round((exp - now) / (1000 * 60 * 60 * 24)))+ );++ // Build IV matrix+ const z: number[][] = [];++ for (const exp of expirations) {+ const row: number[] = [];+ const daysToExp = Math.max(1, Math.round((exp - now) / (1000 * 60 * 60 * 24)));+ const T = daysToExp / 365;++ for (const strike of strikes) {+ // Find matching option (prefer calls for IV surface)+ const option = optionsData.find(+ o => o.strike_price === strike && o.expiration === exp+ );++ if (option && option.mid_price && option.mid_price > 0) {+ const iv = computeImpliedVolatility(+ option.mid_price,+ spotPrice,+ strike,+ T,+ riskFreeRate,+ option.instrument_class === 'C'+ );+ row.push(iv !== null ? iv * 100 : 0); // Convert to percentage+ } else {+ row.push(0); // No data+ }+ }+ z.push(row);+ }++ return {+ strikes,+ expirations: expirationDays,+ z,+ underlying: optionsData[0]?.underlying || 'UNKNOWN',+ spotPrice,+ timestamp: Date.now(),+ };+ }, []);++ /**+ * Compute rolling correlation matrix from historical prices+ */+ const computeCorrelationMatrix = useCallback((+ priceData: Record<string, HistoricalBar[]>,+ window: number = 30+ ): CorrelationMatrixData | null => {+ const assets = Object.keys(priceData);+ if (assets.length < 2) return null;++ // Extract close prices and align dates+ const closePrices: Record<string, number[]> = {};+ const allDates: Set<number> = new Set();++ for (const asset of assets) {+ const bars = priceData[asset];+ closePrices[asset] = [];+ bars.forEach(bar => allDates.add(bar.ts_event));+ }++ const sortedDates = Array.from(allDates).sort((a, b) => a - b);++ // Fill price arrays+ for (const asset of assets) {+ const bars = priceData[asset];+ const priceMap = new Map(bars.map(b => [b.ts_event, b.close]));+ closePrices[asset] = sortedDates.map(d => priceMap.get(d) || NaN);+ }++ // Compute returns+ const returns: Record<string, number[]> = {};+ for (const asset of assets) {+ const prices = closePrices[asset];+ returns[asset] = [];+ for (let i = 1; i < prices.length; i++) {+ if (!isNaN(prices[i]) && !isNaN(prices[i - 1]) && prices[i - 1] > 0) {+ returns[asset].push(Math.log(prices[i] / prices[i - 1]));+ } else {+ returns[asset].push(NaN);+ }+ }+ }++ // Compute rolling correlations+ const numPeriods = Math.max(1, returns[assets[0]].length - window + 1);+ const timePoints: number[] = [];+ const z: number[][] = [];++ for (let t = 0; t < numPeriods; t += Math.max(1, Math.floor(numPeriods / 20))) {+ timePoints.push(t);+ const row: number[] = [];++ for (let i = 0; i < assets.length; i++) {+ for (let j = 0; j < assets.length; j++) {+ if (i === j) {+ row.push(1.0);+ } else {+ const ret1 = returns[assets[i]].slice(t, t + window);+ const ret2 = returns[assets[j]].slice(t, t + window);+ const corr = computeCorrelation(ret1, ret2);+ row.push(corr);+ }+ }+ }+ z.push(row);+ }++ return {+ assets,+ timePoints,+ z,+ window,+ timestamp: Date.now(),+ };+ }, []);++ /**+ * Compute PCA from returns data+ */+ const computePCA = useCallback((+ priceData: Record<string, HistoricalBar[]>+ ): PCAData | null => {+ const assets = Object.keys(priceData);+ if (assets.length < 2) return null;++ // Compute returns matrix+ const returns: number[][] = [];+ const minLength = Math.min(...assets.map(a => priceData[a].length));++ for (let i = 1; i < minLength; i++) {+ const row: number[] = [];+ for (const asset of assets) {+ const bars = priceData[asset];+ if (bars[i - 1].close > 0) {+ row.push(Math.log(bars[i].close / bars[i - 1].close));+ } else {+ row.push(0);+ }+ }+ returns.push(row);+ }++ // Compute covariance matrix+ const n = returns.length;+ const means = assets.map((_, j) =>+ returns.reduce((sum, row) => sum + row[j], 0) / n+ );++ const covMatrix: number[][] = [];+ for (let i = 0; i < assets.length; i++) {+ const row: number[] = [];+ for (let j = 0; j < assets.length; j++) {+ let cov = 0;+ for (let k = 0; k < n; k++) {+ cov += (returns[k][i] - means[i]) * (returns[k][j] - means[j]);+ }+ row.push(cov / (n - 1));+ }+ covMatrix.push(row);+ }++ // Simple power iteration for eigenvalues (simplified PCA)+ // For full implementation, use a linear algebra library+ const numFactors = Math.min(assets.length, 10);+ const factors = Array.from({ length: numFactors }, (_, i) => `PC${i + 1}`);++ // Placeholder factor loadings (simplified)+ const z: number[][] = [];+ for (let i = 0; i < assets.length; i++) {+ const row: number[] = [];+ for (let j = 0; j < numFactors; j++) {+ // Simplified: use correlation with variance+ const loading = covMatrix[i][Math.min(j, assets.length - 1)] /+ Math.sqrt(covMatrix[i][i] * covMatrix[Math.min(j, assets.length - 1)][Math.min(j, assets.length - 1)]);+ row.push(isNaN(loading) ? 0 : loading);+ }+ z.push(row);+ }++ // Variance explained (simplified)+ const totalVar = covMatrix.reduce((sum, row, i) => sum + row[i], 0);+ const varianceExplained = factors.map((_, i) =>+ (1 - i * 0.15) * 0.7 // Simplified decay+ );++ return {+ factors,+ assets,+ z,+ varianceExplained,+ timestamp: Date.now(),+ };+ }, []);++ return {+ computeVolatilitySurface,+ computeCorrelationMatrix,+ computePCA,+ blackScholesPrice,+ computeImpliedVolatility,+ };+}++// Helper: Pearson correlation coefficient+function computeCorrelation(x: number[], y: number[]): number {+ const n = Math.min(x.length, y.length);+ if (n < 2) return 0;++ let sumX = 0, sumY = 0, sumXY = 0, sumX2 = 0, sumY2 = 0;+ let count = 0;++ for (let i = 0; i < n; i++) {+ if (!isNaN(x[i]) && !isNaN(y[i])) {+ sumX += x[i];+ sumY += y[i];+ sumXY += x[i] * y[i];+ sumX2 += x[i] * x[i];+ sumY2 += y[i] * y[i];+ count++;+ }+ }++ if (count < 2) return 0;++ const numerator = count * sumXY - sumX * sumY;+ const denominator = Math.sqrt(+ (count * sumX2 - sumX * sumX) * (count * sumY2 - sumY * sumY)+ );++ if (denominator === 0) return 0;+ return numerator / denominator;+}diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/index.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/index.tsnew file mode 100644index 000000000..459623893--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/index.ts@@ -0,0 +1,5 @@+import SurfaceAnalyticsTab from './SurfaceAnalyticsTab';+export default SurfaceAnalyticsTab;+export { SurfaceAnalyticsTab };+export * from './types';+export * from './constants';diff --git a/fincept-terminal-desktop/src/components/tabs/surface-analytics/types.ts b/fincept-terminal-desktop/src/components/tabs/surface-analytics/types.tsnew file mode 100644index 000000000..7440f3fcf--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/surface-analytics/types.ts@@ -0,0 +1,138 @@+/**+ * Surface Analytics - Type Definitions+ * Professional-grade 3D financial analytics types+ */++// Chart types available+export type ChartType = 'volatility' | 'correlation' | 'yield-curve' | 'pca';++// Data source configuration+export interface DataSourceConfig {+ apiKey: string;+ dataset: string;+ schema: string;+}++// Volatility Surface Types+export interface VolatilitySurfacePoint {+ strike: number;+ expiration: number; // Days to expiry+ impliedVol: number;+ delta?: number;+ gamma?: number;+ vega?: number;+ theta?: number;+}++export interface VolatilitySurfaceData {+ strikes: number[];+ expirations: number[];+ z: number[][]; // IV matrix+ underlying: string;+ spotPrice: number;+ timestamp: number;+}++// Correlation Matrix Types+export interface CorrelationMatrixData {+ assets: string[];+ timePoints: number[];+ z: number[][]; // Correlation values over time+ window: number; // Rolling window in days+ timestamp: number;+}++// Yield Curve Types+export interface YieldCurveData {+ maturities: number[]; // In months+ timePoints: number[]; // Historical dates+ z: number[][]; // Yield values+ source: string;+ timestamp: number;+}++// PCA Types+export interface PCAData {+ factors: string[];+ assets: string[];+ z: number[][]; // Factor loadings+ varianceExplained: number[];+ timestamp: number;+}++// Options Chain from Databento+export interface OptionsChainRecord {+ ts_recv: number;+ raw_symbol: string;+ expiration: number;+ instrument_class: 'C' | 'P'; // Call or Put+ strike_price: number;+ underlying: string;+ instrument_id: number;+ bid_px?: number;+ ask_px?: number;+ mid_price?: number;+ implied_vol?: number;+}++// Historical Bar Data+export interface HistoricalBar {+ ts_event: number;+ symbol: string;+ open: number;+ high: number;+ low: number;+ close: number;+ volume: number;+}++// Chart Metrics for display panels+export interface ChartMetric {+ label: string;+ value: string;+ change: string;+ positive: boolean | null;+}++// Loading and Error States+export interface DataState<T> {+ data: T | null;+ loading: boolean;+ error: string | null;+ lastUpdate: Date | null;+}++// Available OHLCV timeframes from Databento+export type OHLCVTimeframe = 'ohlcv-1d' | 'ohlcv-1h' | 'ohlcv-1m' | 'ohlcv-1s' | 'ohlcv-eod';++// Timeframe metadata for UI display+export interface TimeframeInfo {+ value: OHLCVTimeframe;+ label: string;+ description: string;+ costLevel: 'low' | 'medium' | 'high';+ recordsPerDay: string; // Approximate for display+}++// User Configuration+export interface SurfaceAnalyticsConfig {+ selectedSymbol: string;+ correlationAssets: string[];+ dateRange: {+ start: string;+ end: string;+ };+ refreshInterval: number; // milliseconds, 0 = manual+ timeframe: OHLCVTimeframe; // OHLCV timeframe selection+ dataset: string; // Selected dataset+}++// API Response wrapper+export interface DatabentoResponse<T = any> {+ error: boolean;+ message?: string;+ data?: T;+ symbol?: string;+ records?: number;+ timestamp: number;+}diff --git a/fincept-terminal-desktop/src/components/tabs/visualization-3d/Visualization3DTab.tsx b/fincept-terminal-desktop/src/components/tabs/visualization-3d/Visualization3DTab.tsxindex 0c4b28bef..568fec7bc 100644--- a/fincept-terminal-desktop/src/components/tabs/visualization-3d/Visualization3DTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/visualization-3d/Visualization3DTab.tsx@@ -1,530 +1,113 @@-import React, { useState, useMemo, Suspense, lazy } from 'react';+/**+ * Visualization 3D Tab+ * ====================+ * This tab has been deprecated in favor of SurfaceAnalyticsTab+ * which provides real Databento integration for 3D financial visualizations.+ *+ * @deprecated Use SurfaceAnalyticsTab instead+ */++import React from 'react';+import { AlertTriangle, ArrowRight } from 'lucide-react';import { useTerminalTheme } from '@/contexts/ThemeContext';-import { TabFooter } from '@/components/common/TabFooter';-import { useTranslation } from 'react-i18next';-import { RefreshCw, TrendingUp, BarChart3, Activity, Network } from 'lucide-react';--// Lazy load Plotly to avoid production build issues-// @ts-ignore - react-plotly.js types are incomplete-const Plot = lazy(() => import('react-plotly.js'));--type ChartType = 'volatility' | 'correlation' | 'yield-curve' | 'pca';+// This tab is deprecated - redirect users to SurfaceAnalyticsTabconst Visualization3DTab: React.FC = () => {- const { t } = useTranslation();- const { colors, fontSize, fontFamily } = useTerminalTheme();- const [lastUpdate, setLastUpdate] = useState(new Date());- const [activeChart, setActiveChart] = useState<ChartType>('volatility');-- // Generate dummy volatility surface data- const volatilitySurface = useMemo(() => {- const strikes = Array.from({ length: 20 }, (_, i) => 85 + i * 1.5);- const expirations = Array.from({ length: 18 }, (_, i) => 7 + i * 21);- const z: number[][] = [];-- for (let i = 0; i < expirations.length; i++) {- const row: number[] = [];- const maturity = expirations[i];- for (let j = 0; j < strikes.length; j++) {- const strike = strikes[j];- const moneyness = strike / 100;- const baseVol = 0.22;- const skew = 0.18 * Math.exp(-moneyness);- const smile = 0.06 * Math.pow(moneyness - 1, 2);- const termStructure = 0.04 * Math.exp(-maturity / 180);- const impliedVol = (baseVol + skew + smile + termStructure) * 100;- row.push(impliedVol);- }- z.push(row);- }- return { strikes, expirations, z };- }, []);-- // Generate correlation matrix over time (3D)- const correlationMatrix = useMemo(() => {- const assets = ['SPY', 'QQQ', 'IWM', 'GLD', 'TLT', 'VIX', 'EEM', 'HYG'];- const timePoints = Array.from({ length: 20 }, (_, i) => i * 20);- const z: number[][] = [];-- for (let t = 0; t < timePoints.length; t++) {- const row: number[] = [];- for (let i = 0; i < assets.length; i++) {- for (let j = 0; j < assets.length; j++) {- if (i === j) {- row.push(1.0);- } else {- const baseCorr = 0.25 + 0.5 * Math.random();- const timeFactor = Math.sin(t / 4) * 0.25;- row.push(Math.max(-1, Math.min(1, baseCorr + timeFactor)));- }- }- }- z.push(row);- }- return { assets, timePoints, z };- }, []);-- // Generate yield curve surface- const yieldCurve = useMemo(() => {- const maturities = [1, 2, 3, 6, 12, 24, 36, 60, 84, 120, 180, 240, 360];- const timePoints = Array.from({ length: 30 }, (_, i) => i * 12);- const z: number[][] = [];-- for (let t = 0; t < timePoints.length; t++) {- const row: number[] = [];- const trend = 2.8 + Math.sin(t / 6) * 1.8;- for (let m = 0; m < maturities.length; m++) {- const maturity = maturities[m];- const yieldRate = trend + Math.log(maturity / 12 + 1) * 0.9 + (Math.random() - 0.5) * 0.4;- row.push(yieldRate);- }- z.push(row);- }- return { maturities, timePoints, z };- }, []);-- // Generate PCA variance- const pcaVariance = useMemo(() => {- const factors = Array.from({ length: 12 }, (_, i) => `PC${i + 1}`);- const assets = Array.from({ length: 10 }, (_, i) => `Asset${i + 1}`);- const z: number[][] = [];-- for (let a = 0; a < assets.length; a++) {- const row: number[] = [];- for (let f = 0; f < factors.length; f++) {- const loading = Math.exp(-f / 2.5) * (Math.random() - 0.5) * 2.5;- row.push(loading);- }- z.push(row);- }- return { factors, assets, z };- }, []);-- const handleRefresh = () => {- setLastUpdate(new Date());- };-- const chartConfig = {- displayModeBar: true,- displaylogo: false,- modeBarButtonsToRemove: ['select2d', 'lasso2d'],- responsive: true- };-- const chartMetrics = {- volatility: [- { label: 'ATM VOL', value: '22.4%', change: '+1.2%', positive: true },- { label: '30D SKEW', value: '-8.5%', change: '-0.3%', positive: false },- { label: 'TERM STRUCT', value: 'FLAT', change: 'NEUTRAL', positive: null },- { label: 'IV RANK', value: '68.2', change: '+5.1', positive: true }- ],- correlation: [- { label: 'AVG CORR', value: '0.58', change: '+0.12', positive: false },- { label: 'MAX CORR', value: '0.94', change: '+0.05', positive: false },- { label: 'MIN CORR', value: '-0.32', change: '-0.08', positive: true },- { label: 'DISPERSION', value: '0.31', change: '+0.04', positive: true }- ],- 'yield-curve': [- { label: '2Y YIELD', value: '4.12%', change: '+8bp', positive: true },- { label: '10Y YIELD', value: '4.28%', change: '+12bp', positive: true },- { label: '2-10 SPREAD', value: '16bp', change: '+4bp', positive: true },- { label: 'INVERSION', value: 'NONE', change: 'NORMAL', positive: null }- ],- pca: [- { label: 'PC1 VAR', value: '68.3%', change: '+2.1%', positive: true },- { label: 'PC2 VAR', value: '18.7%', change: '-0.5%', positive: false },- { label: 'PC3 VAR', value: '7.2%', change: '+0.3%', positive: true },- { label: 'TOTAL VAR', value: '94.2%', change: '+1.9%', positive: true }- ]- };-- const renderChart = () => {- const commonLayout = {- autosize: true,- font: { family: fontFamily, color: colors.text, size: 11 },- paper_bgcolor: 'transparent',- plot_bgcolor: 'transparent',- margin: { l: 10, r: 10, t: 10, b: 10 },- scene: {- bgcolor: '#000000',- xaxis: {- gridcolor: '#1a1a1a',- color: colors.text,- titlefont: { size: 12, color: colors.accent },- tickfont: { size: 10 },- showbackground: true,- backgroundcolor: '#0a0a0a'- },- yaxis: {- gridcolor: '#1a1a1a',- color: colors.text,- titlefont: { size: 12, color: colors.accent },- tickfont: { size: 10 },- showbackground: true,- backgroundcolor: '#0a0a0a'- },- zaxis: {- gridcolor: '#1a1a1a',- color: colors.text,- titlefont: { size: 12, color: colors.accent },- tickfont: { size: 10 },- showbackground: true,- backgroundcolor: '#0a0a0a'- },- camera: {- eye: { x: 1.6, y: 1.6, z: 1.4 },- center: { x: 0, y: 0, z: 0 }- }- },- hoverlabel: {- bgcolor: '#1a1a1a',- bordercolor: colors.accent,- font: { family: fontFamily, color: colors.text, size: 11 }- }- };-- switch (activeChart) {- case 'volatility':- return (- <Suspense fallback={<div className="flex items-center justify-center h-full"><RefreshCw className="animate-spin" /></div>}>- <Plot- data={[{- type: 'surface',- x: volatilitySurface.strikes,- y: volatilitySurface.expirations,- z: volatilitySurface.z,- colorscale: [- [0, '#1a237e'], [0.2, '#1565c0'], [0.4, '#0288d1'],- [0.6, '#26c6da'], [0.75, '#ffa726'], [0.9, '#ff7043'], [1, '#d32f2f']- ],- contours: {- z: { show: true, usecolormap: true, highlightcolor: colors.accent, project: { z: true } }- },- colorbar: {- title: { text: 'IV %', font: { size: 11, color: colors.accent } },- tickfont: { size: 10, color: colors.text },- len: 0.85,- thickness: 18,- x: 1.02,- bgcolor: '#000000',- bordercolor: colors.accent,- borderwidth: 1,- outlinecolor: colors.accent,- outlinewidth: 1- },- hovertemplate: '<b>STRIKE:</b> %{x:.1f}<br><b>DTE:</b> %{y:.0f}<br><b>IV:</b> %{z:.2f}%<extra></extra>'- }]}- layout={{- ...commonLayout,- scene: {- ...commonLayout.scene,- xaxis: { ...commonLayout.scene.xaxis, title: 'STRIKE PRICE' },- yaxis: { ...commonLayout.scene.yaxis, title: 'DAYS TO EXPIRY' },- zaxis: { ...commonLayout.scene.zaxis, title: 'IMPLIED VOL (%)' }- }- }}- config={chartConfig}- style={{ width: '100%', height: '100%' }}- useResizeHandler={true}- />- </Suspense>- );-- case 'correlation':- return (- <Suspense fallback={<div className="flex items-center justify-center h-full"><RefreshCw className="animate-spin" /></div>}>- <Plot- data={[{- type: 'surface',- z: correlationMatrix.z,- colorscale: [- [0, '#b71c1c'], [0.3, '#e53935'], [0.45, '#ff9800'],- [0.5, '#ffeb3b'], [0.65, '#7cb342'], [0.8, '#43a047'], [1, '#2e7d32']- ],- contours: {- z: { show: true, usecolormap: true, highlightcolor: colors.accent, project: { z: true } }- },- colorbar: {- title: { text: 'ρ', font: { size: 12, color: colors.accent } },- tickfont: { size: 10, color: colors.text },- len: 0.85,- thickness: 18,- x: 1.02,- bgcolor: '#000000',- bordercolor: colors.accent,- borderwidth: 1- },- hovertemplate: '<b>CORRELATION:</b> %{z:.3f}<extra></extra>'- }]}- layout={{- ...commonLayout,- scene: {- ...commonLayout.scene,- xaxis: { ...commonLayout.scene.xaxis, title: 'ASSET PAIR INDEX' },- yaxis: { ...commonLayout.scene.yaxis, title: 'TIME (DAYS)' },- zaxis: { ...commonLayout.scene.zaxis, title: 'CORRELATION COEFF' }- }- }}- config={chartConfig}- style={{ width: '100%', height: '100%' }}- useResizeHandler={true}- />- </Suspense>- );-- case 'yield-curve':- return (- <Suspense fallback={<div className="flex items-center justify-center h-full"><RefreshCw className="animate-spin" /></div>}>- <Plot- data={[{- type: 'surface',- x: yieldCurve.maturities,- y: yieldCurve.timePoints,- z: yieldCurve.z,- colorscale: [- [0, '#1a237e'], [0.25, '#283593'], [0.4, '#3949ab'],- [0.55, '#5e35b1'], [0.7, '#7e57c2'], [0.85, '#ba68c8'], [1, '#f06292']- ],- contours: {- z: { show: true, usecolormap: true, highlightcolor: colors.accent, project: { z: true } }- },- colorbar: {- title: { text: 'YIELD %', font: { size: 11, color: colors.accent } },- tickfont: { size: 10, color: colors.text },- len: 0.85,- thickness: 18,- x: 1.02,- bgcolor: '#000000',- bordercolor: colors.accent,- borderwidth: 1- },- hovertemplate: '<b>MATURITY:</b> %{x}M<br><b>YIELD:</b> %{z:.2f}%<extra></extra>'- }]}- layout={{- ...commonLayout,- scene: {- ...commonLayout.scene,- xaxis: { ...commonLayout.scene.xaxis, title: 'MATURITY (MONTHS)' },- yaxis: { ...commonLayout.scene.yaxis, title: 'HISTORICAL DAYS' },- zaxis: { ...commonLayout.scene.zaxis, title: 'YIELD (%)' }- }- }}- config={chartConfig}- style={{ width: '100%', height: '100%' }}- useResizeHandler={true}- />- </Suspense>- );-- case 'pca':- return (- <Suspense fallback={<div className="flex items-center justify-center h-full"><RefreshCw className="animate-spin" /></div>}>- <Plot- data={[{- type: 'surface',- z: pcaVariance.z,- colorscale: [- [0, '#0d47a1'], [0.2, '#1976d2'], [0.4, '#42a5f5'],- [0.5, '#e0e0e0'], [0.6, '#ef5350'], [0.8, '#e53935'], [1, '#b71c1c']- ],- contours: {- z: { show: true, usecolormap: true, highlightcolor: colors.accent, project: { z: true } }- },- colorbar: {- title: { text: 'LOADING', font: { size: 11, color: colors.accent } },- tickfont: { size: 10, color: colors.text },- len: 0.85,- thickness: 18,- x: 1.02,- bgcolor: '#000000',- bordercolor: colors.accent,- borderwidth: 1- },- hovertemplate: '<b>LOADING:</b> %{z:.3f}<extra></extra>'- }]}- layout={{- ...commonLayout,- scene: {- ...commonLayout.scene,- xaxis: { ...commonLayout.scene.xaxis, title: 'PRINCIPAL COMPONENT' },- yaxis: { ...commonLayout.scene.yaxis, title: 'ASSET INDEX' },- zaxis: { ...commonLayout.scene.zaxis, title: 'FACTOR LOADING' }- }- }}- config={chartConfig}- style={{ width: '100%', height: '100%' }}- useResizeHandler={true}- />- </Suspense>- );-- default:- return null;- }- };-- const currentMetrics = chartMetrics[activeChart];+ const { colors, fontFamily } = useTerminalTheme();return (- <div className="h-full flex flex-col" style={{ backgroundColor: '#000000', color: colors.text, fontFamily, overflow: 'hidden' }}>- {/* Top Control Bar */}- <div className="flex items-center justify-between px-3 py-1 border-b flex-shrink-0" style={{ borderColor: '#1a1a1a', backgroundColor: '#0a0a0a' }}>- <div className="flex items-center gap-4">- <div className="flex items-center gap-2">- <BarChart3 size={14} style={{ color: colors.accent }} />- <span className="text-xs font-bold" style={{ color: colors.accent }}>3D ANALYTICS</span>- </div>- <div className="h-3 w-px" style={{ backgroundColor: '#333' }} />- <div className="flex gap-1">- <button- onClick={() => setActiveChart('volatility')}- className="px-3 py-0.5 text-xs font-semibold transition-all"- style={{- backgroundColor: activeChart === 'volatility' ? colors.accent : '#1a1a1a',- color: activeChart === 'volatility' ? '#000' : colors.text,- border: `1px solid ${activeChart === 'volatility' ? colors.accent : '#333'}`- }}- >- <div className="flex items-center gap-1">- <TrendingUp size={12} />- VOL SURFACE- </div>- </button>- <button- onClick={() => setActiveChart('correlation')}- className="px-3 py-0.5 text-xs font-semibold transition-all"- style={{- backgroundColor: activeChart === 'correlation' ? colors.accent : '#1a1a1a',- color: activeChart === 'correlation' ? '#000' : colors.text,- border: `1px solid ${activeChart === 'correlation' ? colors.accent : '#333'}`- }}- >- <div className="flex items-center gap-1">- <Network size={12} />- CORRELATION- </div>- </button>- <button- onClick={() => setActiveChart('yield-curve')}- className="px-3 py-0.5 text-xs font-semibold transition-all"- style={{- backgroundColor: activeChart === 'yield-curve' ? colors.accent : '#1a1a1a',- color: activeChart === 'yield-curve' ? '#000' : colors.text,- border: `1px solid ${activeChart === 'yield-curve' ? colors.accent : '#333'}`- }}- >- <div className="flex items-center gap-1">- <Activity size={12} />- YIELD CURVE- </div>- </button>- <button- onClick={() => setActiveChart('pca')}- className="px-3 py-0.5 text-xs font-semibold transition-all"- style={{- backgroundColor: activeChart === 'pca' ? colors.accent : '#1a1a1a',- color: activeChart === 'pca' ? '#000' : colors.text,- border: `1px solid ${activeChart === 'pca' ? colors.accent : '#333'}`- }}- >- <div className="flex items-center gap-1">- <BarChart3 size={12} />- PCA FACTORS- </div>- </button>- </div>- </div>- <div className="flex items-center gap-3">- <span className="text-xs" style={{ color: '#666' }}>- LAST UPDATE: <span style={{ color: colors.text }}>{lastUpdate.toLocaleTimeString()}</span>- </span>- <button- onClick={handleRefresh}- className="flex items-center gap-1 px-2 py-0.5 text-xs font-semibold transition-all"- style={{ backgroundColor: colors.accent, color: '#000', border: `1px solid ${colors.accent}` }}- >- <RefreshCw size={12} />- REFRESH- </button>- </div>- </div>-- {/* Main Content Area */}- <div className="flex-1 flex overflow-hidden" style={{ minHeight: 0 }}>- {/* Left Metrics Panel */}- <div className="w-64 border-r flex flex-col flex-shrink-0" style={{ borderColor: '#1a1a1a', backgroundColor: '#0a0a0a' }}>- <div className="px-3 py-2 border-b" style={{ borderColor: '#1a1a1a' }}>- <div className="text-xs font-bold" style={{ color: colors.accent }}>MARKET METRICS</div>- </div>- <div className="flex-1 overflow-y-auto">- {currentMetrics.map((metric, idx) => (- <div- key={idx}- className="px-3 py-2 border-b"- style={{ borderColor: '#1a1a1a' }}- >- <div className="text-xs" style={{ color: '#666' }}>{metric.label}</div>- <div className="flex items-baseline justify-between mt-1">- <span className="text-base font-bold" style={{ color: colors.text }}>{metric.value}</span>- <span- className="text-xs font-semibold"- style={{- color: metric.positive === null ? '#666' : metric.positive ? '#22c55e' : '#ef4444'- }}- >- {metric.change}- </span>- </div>- </div>- ))}- <div className="px-3 py-2 mt-4">- <div className="text-xs font-bold mb-2" style={{ color: colors.accent }}>DATA INFO</div>- <div className="space-y-2 text-xs" style={{ color: '#666' }}>- <div className="flex justify-between">- <span>SOURCE:</span>- <span style={{ color: colors.text }}>LIVE</span>- </div>- <div className="flex justify-between">- <span>FREQUENCY:</span>- <span style={{ color: colors.text }}>1MIN</span>- </div>- <div className="flex justify-between">- <span>QUALITY:</span>- <span style={{ color: '#22c55e' }}>99.8%</span>- </div>- </div>- </div>- </div>+ <div+ style={{+ height: '100%',+ display: 'flex',+ flexDirection: 'column',+ alignItems: 'center',+ justifyContent: 'center',+ backgroundColor: '#000000',+ color: colors.text,+ fontFamily,+ padding: '48px',+ }}+ >+ <div+ style={{+ maxWidth: '480px',+ padding: '32px',+ backgroundColor: '#0F0F0F',+ border: '1px solid #2A2A2A',+ borderRadius: '2px',+ textAlign: 'center',+ }}+ >+ <div+ style={{+ width: '64px',+ height: '64px',+ margin: '0 auto 24px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ backgroundColor: '#FFD70015',+ borderRadius: '50%',+ }}+ >+ <AlertTriangle size={32} style={{ color: '#FFD700' }} /></div>- {/* 3D Chart Display */}- <div className="flex-1 flex flex-col overflow-hidden" style={{ minWidth: 0 }}>- <div className="px-3 py-1 border-b flex items-center justify-between flex-shrink-0" style={{ borderColor: '#1a1a1a', backgroundColor: '#0a0a0a' }}>- <div className="text-xs font-bold" style={{ color: colors.accent }}>- {activeChart === 'volatility' && 'S&P 500 INDEX OPTIONS - IMPLIED VOLATILITY SURFACE'}- {activeChart === 'correlation' && 'MULTI-ASSET CORRELATION MATRIX - ROLLING 30 DAY'}- {activeChart === 'yield-curve' && 'U.S. TREASURY YIELD CURVE - HISTORICAL EVOLUTION'}- {activeChart === 'pca' && 'PRINCIPAL COMPONENT ANALYSIS - FACTOR LOADINGS'}- </div>- <div className="text-xs" style={{ color: '#666' }}>- {activeChart === 'volatility' && 'SPX | CBOE'}- {activeChart === 'correlation' && 'MULTI-ASSET | LIVE'}- {activeChart === 'yield-curve' && 'UST | FEDERAL RESERVE'}- {activeChart === 'pca' && 'PORTFOLIO | COMPUTED'}- </div>- </div>- <div className="flex-1 overflow-hidden" style={{ backgroundColor: '#000000' }}>- {renderChart()}- </div>+ <h2+ style={{+ fontSize: '16px',+ fontWeight: 700,+ color: colors.text,+ marginBottom: '12px',+ letterSpacing: '0.5px',+ }}+ >+ TAB DEPRECATED+ </h2>++ <p+ style={{+ fontSize: '11px',+ color: '#787878',+ marginBottom: '24px',+ lineHeight: '1.6',+ }}+ >+ The 3D Visualization tab has been replaced with Surface Analytics,+ which provides real-time market data from Databento for professional+ financial analysis including volatility surfaces, correlation matrices,+ and PCA factor analysis.+ </p>++ <div+ style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ gap: '8px',+ padding: '12px 24px',+ backgroundColor: colors.accent,+ color: '#000000',+ borderRadius: '2px',+ fontSize: '10px',+ fontWeight: 700,+ letterSpacing: '0.5px',+ }}+ >+ <span>USE SURFACE ANALYTICS TAB</span>+ <ArrowRight size={14} /></div>- </div>- {/* Footer */}- <div className="flex-shrink-0">- <TabFooter- tabName="3D VISUALIZATION"- statusInfo={`${activeChart.toUpperCase()} | ${currentMetrics.length} Metrics | Updated: ${lastUpdate.toLocaleTimeString()}`}- />+ <p+ style={{+ marginTop: '16px',+ fontSize: '9px',+ color: '#4A4A4A',+ }}+ >+ Navigate to: Surface Analytics (in the sidebar)+ </p></div></div>);diff --git a/fincept-terminal-desktop/src/services/akshareApi.ts b/fincept-terminal-desktop/src/services/akshareApi.tsindex 51447e631..5468d454e 100644--- a/fincept-terminal-desktop/src/services/akshareApi.ts+++ b/fincept-terminal-desktop/src/services/akshareApi.ts@@ -28,93 +28,58 @@ export interface AKShareDataSource {categories: string[];}+// ALL VERIFIED WORKING FILESexport const AKSHARE_DATA_SOURCES: AKShareDataSource[] = [{id: 'data',name: 'Market Data',script: 'akshare_data.py',- description: 'Stock quotes, indices, forex, futures, ETFs - real-time and historical data',+ description: 'Stock quotes, indices, forex, futures, ETFs - 14 endpoints',icon: 'BarChart3',color: '#06B6D4',- categories: ['Stock Market', 'Forex', 'Futures', 'ETF', 'Indices', 'Macro']+ categories: ['Stocks', 'Funds', 'Macro', 'Bonds', 'Forex', 'Futures']},{id: 'index',name: 'Index Data',script: 'akshare_index.py',- description: 'Index constituents, weights, historical data, global indices, Shenwan, CNI',+ description: 'Index constituents, weights, historical - 74 endpoints',icon: 'TrendingUp',color: '#6366F1',- categories: ['Chinese Index', 'Shenwan Index', 'CNI Index', 'Global Index', 'Option QVIX', 'Economic Index', 'Commodity Index']+ categories: ['Chinese Index', 'Shenwan Index', 'CNI Index', 'Global Index']},{id: 'futures',name: 'Futures',script: 'akshare_futures.py',- description: 'Futures contracts, warehouse receipts, positions, spot prices, delivery',+ description: 'Futures contracts, positions, spot prices - 59 endpoints',icon: 'Activity',color: '#F97316',- categories: ['Contract Info', 'Realtime', 'Historical', 'Global', 'Warehouse', 'Positions', 'Delivery', 'Spot', 'Inventory', 'Hog']+ categories: ['Contract Info', 'Realtime', 'Historical', 'Global', 'Warehouse', 'Positions']},{id: 'bonds',name: 'Bonds',script: 'akshare_bonds.py',- description: 'Chinese & International bond markets, yield curves, government & corporate bonds',+ description: 'Bond markets, yield curves, government & corporate - 28 endpoints',icon: 'Landmark',color: '#3B82F6',- categories: ['Chinese Bond Market', 'Yield Curves', 'Government Bonds', 'Corporate Bonds', 'Convertible Bonds', 'International Bonds', 'Bond Indices', 'Ratings']- },- {- id: 'derivatives',- name: 'Derivatives',- script: 'akshare_derivatives.py',- description: 'Options, futures, Greeks, volatility, spreads from Chinese exchanges',- icon: 'LineChart',- color: '#8B5CF6',- categories: ['Options', 'Futures', 'Greeks', 'Volatility', 'Spreads', 'Inventory']+ categories: ['Chinese Bond Market', 'Yield Curves', 'Government Bonds', 'Corporate Bonds', 'Convertible Bonds']},{id: 'currency',name: 'Currency/Forex',script: 'akshare_currency.py',- description: 'Exchange rates, currency pairs, historical forex data, currency converter',+ description: 'Exchange rates, currency pairs - 8 endpoints',icon: 'DollarSign',color: '#22C55E',categories: ['Exchange Rates', 'Currency Data']},- {- id: 'china_economics',- name: 'China Economics',- script: 'akshare_economics_china.py',- description: 'Chinese macro indicators: GDP, CPI, PPI, PMI, money supply, trade data',- icon: 'TrendingUp',- color: '#EF4444',- categories: ['GDP', 'Inflation', 'PMI', 'Money Supply', 'Trade', 'Industrial', 'Consumer', 'Fiscal', 'Banking', 'Real Estate']- },- {- id: 'global_economics',- name: 'Global Economics',- script: 'akshare_economics_global.py',- description: 'US, Eurozone, UK, Japan, Australia, Canada macro data & global indicators',- icon: 'Globe',- color: '#10B981',- categories: ['US', 'Eurozone', 'UK', 'Japan', 'Australia', 'Canada', 'Switzerland', 'Global Indices', 'Commodities']- },- {- id: 'funds',- name: 'Funds',- script: 'akshare_funds_expanded.py',- description: 'ETF analytics, mutual funds, fund ratings, risk metrics, flows',- icon: 'PieChart',- color: '#F59E0B',- categories: ['ETF', 'Mutual Funds', 'Fund Rankings', 'Risk Metrics', 'Fund Flows', 'Private Equity']- },{id: 'energy',name: 'Energy',script: 'akshare_energy.py',- description: 'Carbon trading markets, oil prices, energy data from China and EU',+ description: 'Carbon trading, oil prices - 8 endpoints',icon: 'Zap',color: '#FBBF24',categories: ['Carbon Trading', 'Oil']@@ -123,7 +88,7 @@ export const AKSHARE_DATA_SOURCES: AKShareDataSource[] = [id: 'crypto',name: 'Crypto',script: 'akshare_crypto.py',- description: 'Bitcoin CME futures, holding reports, crypto spot prices',+ description: 'Bitcoin CME futures, crypto spot - 3 endpoints',icon: 'Bitcoin',color: '#F7931A',categories: ['Bitcoin', 'Spot']@@ -132,7 +97,7 @@ export const AKSHARE_DATA_SOURCES: AKShareDataSource[] = [id: 'news',name: 'News',script: 'akshare_news.py',- description: 'CCTV news, Baidu economic news, trade notifications, dividends',+ description: 'CCTV news, economic news - 5 endpoints',icon: 'Newspaper',color: '#64748B',categories: ['News Feeds', 'Trade Notifications']@@ -141,130 +106,164 @@ export const AKSHARE_DATA_SOURCES: AKShareDataSource[] = [id: 'reits',name: 'REITs',script: 'akshare_reits.py',- description: 'Real Estate Investment Trusts - realtime, historical, minute data',+ description: 'Real Estate Investment Trusts - 3 endpoints',icon: 'Building',color: '#0EA5E9',categories: ['REITs']},- {- id: 'alternative',- name: 'Alternative Data',- script: 'akshare_alternative.py',- description: 'Air quality, carbon trading, energy, real estate, auto sales, sentiment',- icon: 'Layers',- color: '#EC4899',- categories: ['Air Quality', 'Carbon Trading', 'Energy', 'Real Estate', 'Auto Sales', 'Movies', 'Demographics', 'Sentiment', 'Rankings']- },- {- id: 'analysis',- name: 'Market Analysis',- script: 'akshare_analysis.py',- description: 'Technical analysis, market breadth, sector rotation, smart money',- icon: 'BarChart3',- color: '#14B8A6',- categories: ['Technical', 'Breadth', 'Sectors', 'Smart Money']- },- {- id: 'company',- name: 'Company Info',- script: 'akshare_company_info.py',- description: 'Company profiles, basic info, financial data for CN, HK, US stocks',- icon: 'Building2',- color: '#8B5CF6',- categories: ['CN Stocks', 'HK Stocks', 'US Stocks', 'Company Profiles']- },- // ==================== STOCK DATA (8 Batches - 398 endpoints) ===================={id: 'stocks_realtime',name: 'Stocks: Realtime',script: 'akshare_stocks_realtime.py',- description: 'Realtime stock data: A-shares, B-shares, HK, US, indices, info',+ description: 'Realtime A-shares, B-shares, HK, US - 49 endpoints',icon: 'Activity',color: '#10B981',- categories: ['A-Shares Realtime', 'B-Shares', 'HK Stocks', 'US Stocks', 'A+H Shares', 'Index Realtime', 'STAR Market', 'Stock Info', 'Global Info', 'Individual Info']+ categories: ['A-Shares Realtime', 'B-Shares', 'HK Stocks', 'US Stocks']},{id: 'stocks_historical',name: 'Stocks: Historical',script: 'akshare_stocks_historical.py',- description: 'Historical price data: daily, minute, intraday, tick, sector',+ description: 'Historical daily/minute/tick data - 52 endpoints',icon: 'Clock',color: '#3B82F6',- categories: ['A-Shares Historical', 'B-Shares Historical', 'HK Historical', 'US Historical', 'A+H Historical', 'Index Historical', 'STAR Market Historical', 'Intraday', 'Tick Data', 'Price Data', 'Bid-Ask', 'Sector Data', 'Classification', 'Exchange Summary', 'Valuation', 'Comparison']+ categories: ['A-Shares Historical', 'HK Historical', 'US Historical', 'Intraday']},{id: 'stocks_financial',name: 'Stocks: Financial',script: 'akshare_stocks_financial.py',- description: 'Financial statements, analysis, earnings, dividends, profiles',+ description: 'Financial statements, earnings - 45 endpoints',icon: 'FileText',color: '#8B5CF6',- categories: ['Balance Sheet', 'Income Statement', 'Cash Flow', 'Financial Analysis', 'HK Financial', 'US Financial', 'THS Financial', 'Earnings', 'Profit Forecast', 'Dividend', 'Company Profile']+ categories: ['Balance Sheet', 'Income Statement', 'Cash Flow', 'Earnings']},{id: 'stocks_holders',name: 'Stocks: Shareholders',script: 'akshare_stocks_holders.py',- description: 'Shareholder data, holdings, institutional ownership, pledge',+ description: 'Shareholder data, holdings - 49 endpoints',icon: 'Users',color: '#F59E0B',- categories: ['Major Shareholders', 'Shareholder Analysis', 'Shareholder Changes', 'Fund Holdings', 'Institutional Holdings', 'Management Holdings', 'Share Changes', 'Executive Holdings', 'Restricted Shares', 'Equity Pledge', 'CNINFO Holdings']+ categories: ['Major Shareholders', 'Fund Holdings', 'Institutional']},{id: 'stocks_funds',name: 'Stocks: Fund Flows',script: 'akshare_stocks_funds.py',- description: 'Fund flows, capital movement, block trades, LHB, IPO',+ description: 'Fund flows, block trades, IPO - 56 endpoints',icon: 'ArrowRightLeft',color: '#EF4444',- categories: ['Individual Fund Flow', 'Market Fund Flow', 'Fund Flow Types', 'Block Trade', 'LHB', 'LHB Broker', 'Repurchase', 'Allotment', 'IPO', 'New Issues']+ categories: ['Fund Flow', 'Block Trade', 'LHB', 'IPO']},{id: 'stocks_board',name: 'Stocks: Boards',script: 'akshare_stocks_board.py',- description: 'Industry boards, concept boards, ZT pool, analyst, rankings',+ description: 'Industry/concept boards - 49 endpoints',icon: 'LayoutGrid',color: '#6366F1',- categories: ['Concept Board', 'Industry Board', 'Board Changes', 'Industry Category', 'ZT Pool', 'Analyst', 'Research', 'Rankings']+ categories: ['Concept Board', 'Industry Board', 'Rankings']},{id: 'stocks_margin',name: 'Stocks: Margin & HSGT',script: 'akshare_stocks_margin.py',- description: 'Margin trading, HSGT (Stock Connect), registration, PE/PB',+ description: 'Margin trading, HSGT - 46 endpoints',icon: 'Percent',color: '#EC4899',- categories: ['Margin Trading', 'HSGT', 'Exchange Rate', 'Registration', 'HK Indicator', 'PE/PB Data', 'Market Indicators', 'A-Share Utils', 'Market Activity', 'CYQ', 'STAQ']+ categories: ['Margin Trading', 'HSGT', 'PE/PB']},{id: 'stocks_hot',name: 'Stocks: Hot & News',script: 'akshare_stocks_hot.py',- description: 'Hot stocks, news, comments, ESG, sentiment, special data',+ description: 'Hot stocks, news, sentiment - 55 endpoints',icon: 'Flame',color: '#F97316',- categories: ['Hot Stocks', 'HK Hot Stocks', 'XueQiu Hot', 'News', 'Comments', 'Weibo Sentiment', 'ESG', 'Investor Relations', 'SNS Info', 'Disclosure', 'Special Data', 'Vote', 'Management']+ categories: ['Hot Stocks', 'News', 'ESG', 'Sentiment']+ },+ {+ id: 'alternative',+ name: 'Alternative Data',+ script: 'akshare_alternative.py',+ description: 'Air quality, carbon, real estate - 14 endpoints',+ icon: 'Layers',+ color: '#EC4899',+ categories: ['Air Quality', 'Carbon', 'Energy', 'Movies']+ },+ {+ id: 'analysis',+ name: 'Market Analysis',+ script: 'akshare_analysis.py',+ description: 'Technical analysis, market breadth',+ icon: 'BarChart3',+ color: '#14B8A6',+ categories: ['Technical', 'Breadth', 'Fund Flow']+ },+ {+ id: 'derivatives',+ name: 'Derivatives',+ script: 'akshare_derivatives.py',+ description: 'Options and derivatives data - 46 endpoints',+ icon: 'TrendingUp',+ color: '#8B5CF6',+ categories: ['CFFEX Options', 'SSE Options', 'Commodity Options', 'Historical']+ },+ {+ id: 'economics_china',+ name: 'China Economics',+ script: 'akshare_economics_china.py',+ description: 'Chinese economic indicators - 85 endpoints',+ icon: 'LineChart',+ color: '#DC2626',+ categories: ['Core Indicators', 'Monetary', 'Trade', 'Industry', 'Real Estate']+ },+ {+ id: 'economics_global',+ name: 'Global Economics',+ script: 'akshare_economics_global.py',+ description: 'International economic indicators - 35 endpoints',+ icon: 'Globe',+ color: '#059669',+ categories: ['USA', 'Eurozone', 'UK', 'Japan', 'Canada', 'Australia']+ },+ {+ id: 'funds_expanded',+ name: 'Funds Expanded',+ script: 'akshare_funds_expanded.py',+ description: 'Comprehensive fund data - 70 endpoints',+ icon: 'Wallet',+ color: '#7C3AED',+ categories: ['Fund Rankings', 'Fund Info', 'Holdings', 'Managers', 'Flows']+ },+ {+ id: 'company_info',+ name: 'Company Info',+ script: 'akshare_company_info.py',+ description: 'Company profiles and details',+ icon: 'Building2',+ color: '#0891B2',+ categories: ['CN Stocks', 'HK Stocks', 'US Stocks']},- // ==================== NEW WRAPPERS (225 functions) ===================={id: 'macro',- name: 'Macro Economics',+ name: 'Macro Global',script: 'akshare_macro.py',- description: 'Global macroeconomic data: 96 indicators from Australia, Brazil, Canada, China, Euro, Germany, India, Japan, Russia, Switzerland, UK, USA',- icon: 'Globe',- color: '#14B8A6',- categories: ['Australia', 'Brazil/India/Russia/NZ', 'Canada', 'China', 'Commodities', 'Euro Zone', 'Germany', 'Global', 'Japan', 'China Financial', 'Shipping', 'Switzerland', 'UK', 'USA']+ description: 'Global macro economic data - 96 endpoints',+ icon: 'TrendingUp',+ color: '#C026D3',+ categories: ['Australia', 'Brazil', 'India', 'Russia', 'Canada', 'Euro', 'Germany', 'Japan', 'Switzerland', 'UK', 'USA']},{id: 'misc',name: 'Miscellaneous',script: 'akshare_misc.py',- description: 'Additional data sources: futures get functions, spot markets, AMAC, stock analytics, articles, FX, air quality, cars, SW index, QDII, FRED, migration, NLP, and more',- icon: 'Layers',- color: '#A855F7',- categories: ['Get Functions', 'Spot Markets', 'AMAC', 'Stock Functions', 'Academic Articles', 'FX', 'Air Quality', 'Car Market', 'SW Index', 'Fund Announcements', 'Movie Box Office', 'QDII', 'FRED', 'Migration', 'NLP', 'QHKC Tools', 'Repo', 'Realized Volatility', 'Sunrise', 'Video', 'Others']- }+ description: 'Misc data sources - 129 endpoints',+ icon: 'Package',+ color: '#EA580C',+ categories: ['AMAC', 'Air Quality', 'Car Sales', 'Movies', 'FRED', 'Migration']+ },];export class AKShareAPI {diff --git a/fincept-terminal-desktop/src/services/core/sqliteService.ts b/fincept-terminal-desktop/src/services/core/sqliteService.tsindex 967f58e1d..527796955 100644--- a/fincept-terminal-desktop/src/services/core/sqliteService.ts+++ b/fincept-terminal-desktop/src/services/core/sqliteService.ts@@ -34,6 +34,7 @@ export interface ApiKeys {NASDAQ_API_KEY?: string;FINANCIAL_MODELING_PREP_API_KEY?: string;OPENROUTER_API_KEY?: string;+ DATABENTO_API_KEY?: string;[key: string]: string | undefined;}@@ -44,6 +45,7 @@ export const PREDEFINED_API_KEYS = [{ key: 'COINGECKO_API_KEY', label: 'CoinGecko API Key', description: 'Cryptocurrency data' },{ key: 'NASDAQ_API_KEY', label: 'NASDAQ API Key', description: 'NASDAQ market data' },{ key: 'FINANCIAL_MODELING_PREP_API_KEY', label: 'Financial Modeling Prep', description: 'Financial statements & ratios' },+ { key: 'DATABENTO_API_KEY', label: 'Databento API Key', description: 'Institutional-grade market data (Options, Equities, Futures)' },{ key: 'OPENROUTER_API_KEY', label: 'OpenRouter API Key', description: 'Access 400+ AI models from all providers (Model Library)' },] as const;diff --git a/fincept-terminal-desktop/src/services/portfolio/customIndexService.ts b/fincept-terminal-desktop/src/services/portfolio/customIndexService.tsnew file mode 100644index 000000000..6c8bdfa78--- /dev/null+++ b/fincept-terminal-desktop/src/services/portfolio/customIndexService.ts@@ -0,0 +1,633 @@+/**+ * Custom Index Service - Fincept Terminal+ * Handles aggregate index creation, calculation, and management+ */++import { invoke } from '@tauri-apps/api/core';+import { marketDataService, QuoteData } from '../markets/marketDataService';+import {+ CustomIndex,+ IndexConstituent,+ IndexConstituentConfig,+ IndexSnapshot,+ IndexSummary,+ IndexCalculationMethod,+ INDEX_METHOD_INFO,+} from '../../components/tabs/portfolio-tab/custom-index/types';++// ==================== INDEX SERVICE CLASS ====================++class CustomIndexService {+ private isInitialized = false;++ /**+ * Initialize the service+ */+ async initialize(): Promise<void> {+ if (this.isInitialized) return;+ this.isInitialized = true;+ console.log('[CustomIndexService] Initialized');+ }++ // ==================== INDEX CRUD ====================++ /**+ * Create a new custom index+ */+ async createIndex(+ name: string,+ description: string | undefined,+ calculationMethod: IndexCalculationMethod,+ baseValue: number = 100,+ capWeight: number | undefined,+ currency: string = 'USD',+ portfolioId?: string+ ): Promise<CustomIndex> {+ console.log(`[CustomIndexService] Creating index: ${name}`);++ const index = await invoke<CustomIndex>('custom_index_create', {+ name,+ description,+ calculationMethod,+ baseValue,+ capWeight: capWeight && capWeight > 0 ? capWeight : null,+ currency,+ portfolioId,+ });++ return index;+ }++ /**+ * Get all active custom indices+ */+ async getAllIndices(): Promise<CustomIndex[]> {+ console.log('[CustomIndexService] Fetching all indices');+ return invoke<CustomIndex[]>('custom_index_get_all');+ }++ /**+ * Get a specific index by ID+ */+ async getIndex(indexId: string): Promise<CustomIndex | null> {+ console.log(`[CustomIndexService] Fetching index: ${indexId}`);+ return invoke<CustomIndex | null>('custom_index_get_by_id', { indexId });+ }++ /**+ * Update index values (after recalculation)+ */+ async updateIndexValues(+ indexId: string,+ currentValue: number,+ previousClose: number,+ divisor: number+ ): Promise<void> {+ await invoke('custom_index_update', {+ indexId,+ currentValue,+ previousClose,+ divisor,+ });+ }++ /**+ * Delete an index (soft delete)+ */+ async deleteIndex(indexId: string): Promise<void> {+ console.log(`[CustomIndexService] Deleting index: ${indexId}`);+ await invoke('custom_index_delete', { indexId });+ }++ /**+ * Permanently delete an index+ */+ async hardDeleteIndex(indexId: string): Promise<void> {+ await invoke('custom_index_hard_delete', { indexId });+ }++ // ==================== CONSTITUENT MANAGEMENT ====================++ /**+ * Add a constituent to an index+ */+ async addConstituent(+ indexId: string,+ config: IndexConstituentConfig+ ): Promise<IndexConstituent> {+ console.log(`[CustomIndexService] Adding constituent ${config.symbol} to index ${indexId}`);++ return invoke<IndexConstituent>('index_constituent_add', {+ indexId,+ symbol: config.symbol.toUpperCase(),+ shares: config.shares,+ weight: config.weight,+ marketCap: config.marketCap,+ fundamentalScore: config.fundamentalScore,+ customPrice: config.customPrice,+ priceDate: config.priceDate,+ });+ }++ /**+ * Get all constituents for an index+ */+ async getConstituents(indexId: string): Promise<IndexConstituent[]> {+ return invoke<IndexConstituent[]>('index_constituent_get_all', { indexId });+ }++ /**+ * Update a constituent+ */+ async updateConstituent(+ constituentId: string,+ shares?: number,+ weight?: number,+ marketCap?: number,+ fundamentalScore?: number,+ customPrice?: number,+ priceDate?: string+ ): Promise<void> {+ await invoke('index_constituent_update', {+ constituentId,+ shares,+ weight,+ marketCap,+ fundamentalScore,+ customPrice,+ priceDate,+ });+ }++ /**+ * Get historical price for a symbol on a specific date+ */+ async getHistoricalPrice(symbol: string, date: string): Promise<number | null> {+ try {+ // Try to fetch via yfinance command+ const result = await invoke<{ close: number } | null>('get_historical_price', {+ symbol: symbol.toUpperCase(),+ date,+ });+ return result?.close || null;+ } catch {+ // Fallback: return null, user can enter manually+ return null;+ }+ }++ /**+ * Remove a constituent from an index+ */+ async removeConstituent(indexId: string, symbol: string): Promise<void> {+ await invoke('index_constituent_remove', { indexId, symbol: symbol.toUpperCase() });+ }++ // ==================== SNAPSHOT MANAGEMENT ====================++ /**+ * Save an index snapshot+ */+ async saveSnapshot(+ indexId: string,+ indexValue: number,+ dayChange: number,+ dayChangePercent: number,+ totalMarketValue: number,+ divisor: number,+ constituentsData: object,+ snapshotDate: string+ ): Promise<IndexSnapshot> {+ return invoke<IndexSnapshot>('index_snapshot_save', {+ indexId,+ indexValue,+ dayChange,+ dayChangePercent,+ totalMarketValue,+ divisor,+ constituentsData: JSON.stringify(constituentsData),+ snapshotDate,+ });+ }++ /**+ * Get snapshots for an index+ */+ async getSnapshots(indexId: string, limit?: number): Promise<IndexSnapshot[]> {+ return invoke<IndexSnapshot[]>('index_snapshot_get_all', { indexId, limit });+ }++ /**+ * Get the latest snapshot+ */+ async getLatestSnapshot(indexId: string): Promise<IndexSnapshot | null> {+ return invoke<IndexSnapshot | null>('index_snapshot_get_latest', { indexId });+ }++ /**+ * Cleanup old snapshots+ */+ async cleanupSnapshots(indexId: string, daysToKeep: number): Promise<number> {+ return invoke<number>('index_snapshot_cleanup', { indexId, days: daysToKeep });+ }++ // ==================== INDEX CALCULATION ====================++ /**+ * Calculate the current index value and summary+ */+ async calculateIndexSummary(indexId: string): Promise<IndexSummary> {+ console.log(`[CustomIndexService] Calculating summary for index: ${indexId}`);++ const index = await this.getIndex(indexId);+ if (!index) {+ throw new Error('Index not found');+ }++ const constituentsRaw = await this.getConstituents(indexId);+ if (constituentsRaw.length === 0) {+ return {+ index,+ constituents: [],+ total_market_value: 0,+ index_value: index.base_value,+ day_change: 0,+ day_change_percent: 0,+ last_updated: new Date().toISOString(),+ };+ }++ // Fetch current prices for all symbols+ const symbols = constituentsRaw.map(c => c.symbol);+ const quotes = await marketDataService.getQuotes(symbols);++ // Calculate constituent values with current prices+ const constituents = this.enrichConstituents(constituentsRaw, quotes, index);++ // Calculate index value based on method+ const { indexValue, totalMarketValue, divisor } = this.calculateIndexValue(+ index,+ constituents+ );++ // Calculate changes+ const dayChange = indexValue - index.previous_close;+ const dayChangePercent = index.previous_close > 0+ ? (dayChange / index.previous_close) * 100+ : 0;++ // Update index in database+ await this.updateIndexValues(indexId, indexValue, index.previous_close, divisor);++ return {+ index: { ...index, current_value: indexValue, divisor },+ constituents,+ total_market_value: totalMarketValue,+ index_value: indexValue,+ day_change: dayChange,+ day_change_percent: dayChangePercent,+ last_updated: new Date().toISOString(),+ };+ }++ /**+ * Enrich constituents with current market data+ */+ private enrichConstituents(+ constituents: IndexConstituent[],+ quotes: QuoteData[],+ index: CustomIndex+ ): IndexConstituent[] {+ const quoteMap = new Map(quotes.map(q => [q.symbol, q]));+ let totalMarketValue = 0;++ // First pass: calculate market values+ const enriched = constituents.map(c => {+ const quote = quoteMap.get(c.symbol);+ const currentPrice = quote?.price || 0;+ const previousClose = quote?.previous_close || currentPrice;+ const shares = c.shares || 1;+ const marketValue = currentPrice * shares;++ totalMarketValue += marketValue;++ return {+ ...c,+ current_price: currentPrice,+ previous_close: previousClose,+ market_value: marketValue,+ effective_weight: 0, // Will be calculated+ day_change: currentPrice - previousClose,+ day_change_percent: previousClose > 0 ? ((currentPrice - previousClose) / previousClose) * 100 : 0,+ contribution: 0, // Will be calculated+ } as IndexConstituent;+ });++ // Second pass: calculate weights and contributions+ return enriched.map(c => {+ const effectiveWeight = this.calculateEffectiveWeight(+ c,+ totalMarketValue,+ index.calculation_method,+ index.cap_weight,+ enriched+ );++ return {+ ...c,+ effective_weight: effectiveWeight,+ contribution: effectiveWeight * (c.day_change_percent / 100),+ };+ });+ }++ /**+ * Calculate effective weight based on method+ */+ private calculateEffectiveWeight(+ constituent: IndexConstituent,+ totalMarketValue: number,+ method: string,+ capWeight: number | undefined,+ allConstituents: IndexConstituent[]+ ): number {+ let weight = 0;+ const n = allConstituents.length;++ switch (method) {+ case 'price_weighted':+ const totalPrices = allConstituents.reduce((sum, c) => sum + c.current_price, 0);+ weight = totalPrices > 0 ? (constituent.current_price / totalPrices) * 100 : 0;+ break;++ case 'market_cap_weighted':+ case 'float_adjusted':+ weight = totalMarketValue > 0 ? (constituent.market_value / totalMarketValue) * 100 : 0;+ break;++ case 'equal_weighted':+ weight = n > 0 ? 100 / n : 0;+ break;++ case 'fundamental_weighted':+ const totalScore = allConstituents.reduce((sum, c) => sum + (c.fundamentalScore || 0), 0);+ weight = totalScore > 0 ? ((constituent.fundamentalScore || 0) / totalScore) * 100 : 100 / n;+ break;++ case 'capped_weighted':+ // First calculate market cap weight+ weight = totalMarketValue > 0 ? (constituent.market_value / totalMarketValue) * 100 : 0;+ // Then apply cap+ if (capWeight && capWeight > 0 && weight > capWeight) {+ weight = capWeight;+ }+ break;++ case 'risk_parity':+ // Using day change volatility as proxy for volatility+ const volatilities = allConstituents.map(c => Math.abs(c.day_change_percent) || 1);+ const inverseVols = volatilities.map(v => 1 / v);+ const totalInverseVol = inverseVols.reduce((sum, iv) => sum + iv, 0);+ const myInverseVol = 1 / (Math.abs(constituent.day_change_percent) || 1);+ weight = totalInverseVol > 0 ? (myInverseVol / totalInverseVol) * 100 : 100 / n;+ break;++ default:+ // Custom weight if provided, else equal weight+ weight = constituent.weight || (100 / n);+ }++ return weight;+ }++ /**+ * Calculate the index value based on the calculation method+ */+ private calculateIndexValue(+ index: CustomIndex,+ constituents: IndexConstituent[]+ ): { indexValue: number; totalMarketValue: number; divisor: number } {+ const method = index.calculation_method;+ const baseValue = index.base_value;+ let divisor = index.divisor;+ let indexValue = baseValue;+ let totalMarketValue = 0;++ if (constituents.length === 0) {+ return { indexValue: baseValue, totalMarketValue: 0, divisor };+ }++ switch (method) {+ case 'price_weighted': {+ // Dow Jones style: Sum of prices / divisor+ const sumPrices = constituents.reduce((sum, c) => sum + c.current_price, 0);++ // If this is the first calculation, set divisor to make index = base value+ if (divisor === 1 && sumPrices > 0) {+ divisor = sumPrices / baseValue;+ }++ indexValue = sumPrices / divisor;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ break;+ }++ case 'market_cap_weighted':+ case 'float_adjusted':+ case 'capped_weighted':+ case 'modified_market_cap': {+ // S&P 500 style: Total market cap relative to base+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);++ // If this is the first calculation, set divisor to make index = base value+ if (divisor === 1 && totalMarketValue > 0) {+ divisor = totalMarketValue / baseValue;+ }++ indexValue = totalMarketValue / divisor;+ break;+ }++ case 'equal_weighted': {+ // Average of individual returns, then apply to base+ const avgReturn = constituents.reduce((sum, c) => sum + (c.day_change_percent / 100), 0) / constituents.length;++ // For first calculation, use price sum approach+ const sumPrices = constituents.reduce((sum, c) => sum + c.current_price, 0);+ if (divisor === 1 && sumPrices > 0) {+ divisor = sumPrices / baseValue;+ }++ indexValue = sumPrices / divisor;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ break;+ }++ case 'geometric_mean': {+ // Geometric average of price relatives+ const priceRelatives = constituents.map(c =>+ c.previous_close > 0 ? c.current_price / c.previous_close : 1+ );+ const geometricMean = Math.pow(+ priceRelatives.reduce((prod, pr) => prod * pr, 1),+ 1 / priceRelatives.length+ );++ indexValue = index.previous_close * geometricMean;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ break;+ }++ case 'fundamental_weighted':+ case 'factor_weighted': {+ // Weighted by scores+ const totalScore = constituents.reduce((sum, c) => sum + (c.fundamentalScore || 1), 0);+ let weightedSum = 0;++ constituents.forEach(c => {+ const weight = (c.fundamentalScore || 1) / totalScore;+ weightedSum += weight * c.current_price;+ });++ if (divisor === 1 && weightedSum > 0) {+ divisor = weightedSum / baseValue;+ }++ indexValue = weightedSum / divisor;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ break;+ }++ case 'risk_parity': {+ // Inverse volatility weighted+ const volatilities = constituents.map(c => Math.abs(c.day_change_percent) || 1);+ const inverseVols = volatilities.map(v => 1 / v);+ const totalInverseVol = inverseVols.reduce((sum, iv) => sum + iv, 0);++ let weightedSum = 0;+ constituents.forEach((c, i) => {+ const weight = inverseVols[i] / totalInverseVol;+ weightedSum += weight * c.current_price;+ });++ if (divisor === 1 && weightedSum > 0) {+ divisor = weightedSum / baseValue;+ }++ indexValue = weightedSum / divisor;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ break;+ }++ default:+ // Default to price-weighted+ const sumPrices = constituents.reduce((sum, c) => sum + c.current_price, 0);+ if (divisor === 1 && sumPrices > 0) {+ divisor = sumPrices / baseValue;+ }+ indexValue = sumPrices / divisor;+ totalMarketValue = constituents.reduce((sum, c) => sum + c.market_value, 0);+ }++ return { indexValue, totalMarketValue, divisor };+ }++ // ==================== UTILITIES ====================++ /**+ * Get information about a calculation method+ */+ getMethodInfo(method: IndexCalculationMethod) {+ return INDEX_METHOD_INFO[method];+ }++ /**+ * Get all available calculation methods+ */+ getAllMethods(): { method: IndexCalculationMethod; info: typeof INDEX_METHOD_INFO[IndexCalculationMethod] }[] {+ return (Object.keys(INDEX_METHOD_INFO) as IndexCalculationMethod[]).map(method => ({+ method,+ info: INDEX_METHOD_INFO[method],+ }));+ }++ /**+ * Create index from portfolio holdings+ */+ async createIndexFromPortfolio(+ portfolioId: string,+ name: string,+ calculationMethod: IndexCalculationMethod,+ baseValue: number = 100,+ selectedSymbols?: string[]+ ): Promise<CustomIndex> {+ // Get portfolio assets+ const assets = await invoke<any[]>('portfolio_get_assets', { portfolioId });++ // Filter if specific symbols selected+ const filteredAssets = selectedSymbols+ ? assets.filter(a => selectedSymbols.includes(a.symbol))+ : assets;++ // Create the index+ const index = await this.createIndex(+ name,+ `Index created from portfolio`,+ calculationMethod,+ baseValue,+ undefined,+ 'USD',+ portfolioId+ );++ // Add constituents+ for (const asset of filteredAssets) {+ await this.addConstituent(index.id, {+ symbol: asset.symbol,+ shares: asset.quantity,+ weight: undefined,+ });+ }++ return index;+ }++ /**+ * Save daily snapshot (call this at end of trading day)+ */+ async saveDailySnapshot(indexId: string): Promise<IndexSnapshot> {+ const summary = await this.calculateIndexSummary(indexId);++ const today = new Date().toISOString().split('T')[0];++ return this.saveSnapshot(+ indexId,+ summary.index_value,+ summary.day_change,+ summary.day_change_percent,+ summary.total_market_value,+ summary.index.divisor,+ summary.constituents,+ today+ );+ }++ /**+ * Rebase index (reset to new base value)+ */+ async rebaseIndex(indexId: string, newBaseValue: number): Promise<void> {+ const summary = await this.calculateIndexSummary(indexId);++ // Calculate new divisor to make current index = new base value+ const { totalMarketValue } = this.calculateIndexValue(+ summary.index,+ summary.constituents+ );++ const newDivisor = totalMarketValue / newBaseValue;++ await this.updateIndexValues(indexId, newBaseValue, newBaseValue, newDivisor);+ }+}++export const customIndexService = new CustomIndexService();diff --git a/fincept-terminal-desktop/src/services/visualization3d/databentoViz3DService.ts b/fincept-terminal-desktop/src/services/visualization3d/databentoViz3DService.tsnew file mode 100644index 000000000..4045a7dac--- /dev/null+++ b/fincept-terminal-desktop/src/services/visualization3d/databentoViz3DService.ts@@ -0,0 +1,175 @@+/**+ * Databento 3D Visualization Service+ *+ * Provides data fetching for real-time 3D financial visualizations:+ * - Volatility surfaces (options IV)+ * - Correlation matrices (multi-asset)+ * - Yield curve evolution (treasury data via Fed integration)+ * - PCA factor analysis (portfolio decomposition)+ */++import { invoke } from '@tauri-apps/api/core';++export interface DatabentoOptions {+ symbol: string;+ date?: string;+}++export interface DatabentoMultiAsset {+ symbols: string[];+ days?: number;+}++export interface DatabentoResponse<T = any> {+ error: boolean;+ message?: string;+ data?: T;+ timestamp: number;+}++/**+ * Fetch options chain data for volatility surface construction+ */+export async function fetchOptionsVolatilitySurface(+ apiKey: string,+ symbol: string = 'SPY',+ date?: string+): Promise<DatabentoResponse> {+ try {+ const result = await invoke<string>('databento_get_options_chain', {+ apiKey: apiKey,+ symbol,+ date: date || null,+ });++ return JSON.parse(result);+ } catch (error) {+ console.error('Failed to fetch options chain:', error);+ return {+ error: true,+ message: `Failed to fetch options data: ${error}`,+ timestamp: Date.now(),+ };+ }+}++/**+ * Fetch multi-asset historical data for correlation matrix+ */+export async function fetchMultiAssetCorrelation(+ apiKey: string,+ symbols: string[] = ['SPY', 'QQQ', 'IWM', 'GLD', 'TLT', 'VIX'],+ days: number = 60+): Promise<DatabentoResponse> {+ try {+ const result = await invoke<string>('databento_get_multi_asset_data', {+ apiKey: apiKey,+ symbols,+ days,+ });++ return JSON.parse(result);+ } catch (error) {+ console.error('Failed to fetch multi-asset data:', error);+ return {+ error: true,+ message: `Failed to fetch correlation data: ${error}`,+ timestamp: Date.now(),+ };+ }+}++/**+ * Resolve symbol mappings using Databento symbology API+ */+export async function resolveSymbols(+ apiKey: string,+ symbols: string[]+): Promise<DatabentoResponse> {+ try {+ const result = await invoke<string>('databento_resolve_symbols', {+ apiKey: apiKey,+ symbols,+ });++ return JSON.parse(result);+ } catch (error) {+ console.error('Failed to resolve symbols:', error);+ return {+ error: true,+ message: `Failed to resolve symbols: ${error}`,+ timestamp: Date.now(),+ };+ }+}++/**+ * Compute volatility surface from options data+ * Transforms raw options chain into 3D surface format+ */+export function computeVolatilitySurface(optionsData: any) {+ // TODO: Implement IV surface computation+ // Input: Options chain with strikes, expirations, prices+ // Output: { strikes: number[], expirations: number[], z: number[][] }+ // Need to compute IV using Black-Scholes for each option++ console.warn('Volatility surface computation not yet implemented');+ return {+ strikes: [],+ expirations: [],+ z: [],+ };+}++/**+ * Compute rolling correlation matrix from price data+ *+ * @param priceData - Historical OHLCV data for multiple assets+ * @param window - Rolling window size in days (default: 30)+ * @returns 3D correlation matrix over time+ */+export function computeCorrelationMatrix(priceData: any, window: number = 30) {+ // TODO: Implement correlation matrix computation+ // Input: Multi-asset price data+ // Output: { assets: string[], timePoints: number[], z: number[][] }+ // Compute rolling correlations between all asset pairs++ console.warn('Correlation matrix computation not yet implemented');+ return {+ assets: [],+ timePoints: [],+ z: [],+ };+}++/**+ * Default asset universe for correlation analysis+ */+export const DEFAULT_CORRELATION_ASSETS = [+ 'SPY', // S&P 500+ 'QQQ', // NASDAQ 100+ 'IWM', // Russell 2000+ 'GLD', // Gold+ 'TLT', // 20+ Year Treasury+ 'VIX', // Volatility Index+ 'EEM', // Emerging Markets+ 'HYG', // High Yield Bonds+];++/**+ * Default symbols for volatility surface+ */+export const DEFAULT_VOL_SURFACE_SYMBOLS = [+ 'SPY', // Most liquid ETF+ 'SPX', // S&P 500 Index+ 'QQQ', // NASDAQ+ 'IWM', // Russell 2000+];++export const databentoViz3DService = {+ fetchOptionsVolatilitySurface,+ fetchMultiAssetCorrelation,+ resolveSymbols,+ computeVolatilitySurface,+ computeCorrelationMatrix,+};diff --git a/fincept-terminal-desktop/src/types/react-plotly.d.ts b/fincept-terminal-desktop/src/types/react-plotly.d.tsnew file mode 100644index 000000000..ad8e7bd8e--- /dev/null+++ b/fincept-terminal-desktop/src/types/react-plotly.d.ts@@ -0,0 +1,52 @@+declare module 'react-plotly.js' {+ import * as Plotly from 'plotly.js';+ import * as React from 'react';++ interface PlotParams {+ data: Plotly.Data[];+ layout?: Partial<Plotly.Layout>;+ frames?: Plotly.Frame[];+ config?: Partial<Plotly.Config>;+ style?: React.CSSProperties;+ className?: string;+ useResizeHandler?: boolean;+ divId?: string;+ onInitialized?: (figure: Readonly<Plotly.Figure>, graphDiv: Readonly<HTMLDivElement>) => void;+ onUpdate?: (figure: Readonly<Plotly.Figure>, graphDiv: Readonly<HTMLDivElement>) => void;+ onPurge?: (figure: Readonly<Plotly.Figure>, graphDiv: Readonly<HTMLDivElement>) => void;+ onError?: (err: Error) => void;+ onAfterExport?: () => void;+ onAfterPlot?: () => void;+ onAnimated?: () => void;+ onAnimatingFrame?: (event: Plotly.FrameAnimationEvent) => void;+ onAnimationInterrupted?: () => void;+ onAutoSize?: () => void;+ onBeforeExport?: () => void;+ onBeforeHover?: (event: Plotly.PlotMouseEvent) => boolean;+ onButtonClicked?: (event: Plotly.ButtonClickedEvent) => void;+ onClick?: (event: Plotly.PlotMouseEvent) => void;+ onClickAnnotation?: (event: Plotly.ClickAnnotationEvent) => void;+ onDeselect?: () => void;+ onDoubleClick?: () => void;+ onFramework?: () => void;+ onHover?: (event: Plotly.PlotHoverEvent) => void;+ onLegendClick?: (event: Plotly.LegendClickEvent) => boolean;+ onLegendDoubleClick?: (event: Plotly.LegendClickEvent) => boolean;+ onRelayout?: (event: Plotly.PlotRelayoutEvent) => void;+ onRestyle?: (event: Plotly.PlotRestyleEvent) => void;+ onRedraw?: () => void;+ onSelected?: (event: Plotly.PlotSelectionEvent) => void;+ onSelecting?: (event: Plotly.PlotSelectionEvent) => void;+ onSliderChange?: (event: Plotly.SliderChangeEvent) => void;+ onSliderEnd?: (event: Plotly.SliderEndEvent) => void;+ onSliderStart?: (event: Plotly.SliderStartEvent) => void;+ onTransitioning?: () => void;+ onTransitionInterrupted?: () => void;+ onUnhover?: (event: Plotly.PlotMouseEvent) => void;+ onWebGLContextLost?: () => void;+ }++ class Plot extends React.Component<PlotParams> {}++ export default Plot;+}diff --git a/openapi.json b/openapi.jsondeleted file mode 100644index bedf9fb8c..000000000--- a/openapi.json+++ /dev/null@@ -1 +0,0 @@-{"openapi":"3.1.0","info":{"title":"Fincept API","description":"Modular Financial Data API","version":"3.0.0"},"paths":{"/auth/user/verify-simulate":{"post":{"tags":["authentication"],"summary":"Simulate User Verification","description":"Simulate OTP verification for testing purposes","operationId":"simulate_user_verification_auth_user_verify_simulate_post","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/register":{"post":{"tags":["users"],"summary":"Register User","description":"Register new user account","operationId":"register_user_user_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegistration"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/verify-otp":{"post":{"tags":["users"],"summary":"Verify Otp","description":"Verify OTP and activate account","operationId":"verify_otp_user_verify_otp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPVerification"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/login":{"post":{"tags":["users"],"summary":"Login User","description":"User login with history tracking","operationId":"login_user_user_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserLogin"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/verify-mfa":{"post":{"tags":["users"],"summary":"Verify Mfa Login","description":"Verify MFA code and complete login","operationId":"verify_mfa_login_user_verify_mfa_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OTPVerification"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/forgot-password":{"post":{"tags":["users"],"summary":"Forgot Password","description":"Request password reset","operationId":"forgot_password_user_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordReset"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/reset-password":{"post":{"tags":["users"],"summary":"Reset Password","description":"Reset password with OTP","operationId":"reset_password_user_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetConfirm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/profile":{"get":{"tags":["users"],"summary":"Get User Profile","description":"Get user profile information","operationId":"get_user_profile_user_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]},"put":{"tags":["users"],"summary":"Update User Profile","description":"Update user profile information","operationId":"update_user_profile_user_profile_put","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Profile Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/regenerate-api-key":{"post":{"tags":["users"],"summary":"Regenerate Api Key","description":"Regenerate user API key","operationId":"regenerate_api_key_user_regenerate_api_key_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/usage":{"get":{"tags":["users"],"summary":"Get User Usage","description":"Get user's API usage statistics","operationId":"get_user_usage_user_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/login-history":{"get":{"tags":["users"],"summary":"Get My Login History","description":"Get current user's login history","operationId":"get_my_login_history_user_login_history_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/subscribe":{"post":{"tags":["users"],"summary":"Subscribe To Database","description":"Subscribe to a database","operationId":"subscribe_to_database_user_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseSubscriptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/subscriptions":{"get":{"tags":["users"],"summary":"Get User Subscriptions","description":"Get user's database subscriptions","operationId":"get_user_subscriptions_user_subscriptions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/transactions":{"get":{"tags":["users"],"summary":"Get User Transactions","description":"Get user's transaction history","operationId":"get_user_transactions_user_transactions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/mfa/enable":{"post":{"tags":["users"],"summary":"Enable Mfa","description":"Enable MFA (Multi-Factor Authentication) - Email-based","operationId":"enable_mfa_user_mfa_enable_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/mfa/disable":{"post":{"tags":["users"],"summary":"Disable Mfa","description":"Disable MFA (requires password confirmation)","operationId":"disable_mfa_user_mfa_disable_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Password Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/account":{"delete":{"tags":["users"],"summary":"Delete User Account","description":"Delete user account","operationId":"delete_user_account_user_account_delete","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Confirmation Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/admin/users":{"get":{"tags":["users"],"summary":"List All Users","description":"List all users (admin only)","operationId":"list_all_users_user_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/user/admin/user/{user_id}":{"get":{"tags":["users"],"summary":"Get User Details","description":"Get detailed user information (admin only)","operationId":"get_user_details_user_admin_user__user_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/admin/user/{user_id}/credits":{"post":{"tags":["users"],"summary":"Manage User Credits","description":"Manage user credits (admin only)","operationId":"manage_user_credits_user_admin_user__user_id__credits_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Credits Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/user/admin/stats":{"get":{"tags":["users"],"summary":"Get Admin Statistics","description":"Get system statistics (admin only)","operationId":"get_admin_statistics_user_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/register":{"post":{"tags":["guests"],"summary":"Register Device","description":"Register device and create guest user with temporary API key (50 credits one-time per IP)","operationId":"register_device_guest_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceRegistration"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/guest/status":{"get":{"tags":["guests"],"summary":"Guest Status","description":"Get guest user status and usage","operationId":"guest_status_guest_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/extend":{"post":{"tags":["guests"],"summary":"Extend Guest Session","description":"Extend guest session if near expiry","operationId":"extend_guest_session_guest_extend_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/usage":{"get":{"tags":["guests"],"summary":"Get Guest Usage","description":"Get guest user's API usage statistics","operationId":"get_guest_usage_guest_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/session":{"delete":{"tags":["guests"],"summary":"Delete Guest Session","description":"Delete guest session and all associated data","operationId":"delete_guest_session_guest_session_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/databases":{"get":{"tags":["guests"],"summary":"List Public Databases","description":"List public databases available to guests","operationId":"list_public_databases_guest_databases_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/guest/database/{database_name}/tables":{"get":{"tags":["guests"],"summary":"Get Database Tables Guest","description":"Get tables in database for guests","operationId":"get_database_tables_guest_guest_database__database_name__tables_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"database_name","in":"path","required":true,"schema":{"type":"string","title":"Database Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/guest/database/{database_name}/{table_name}/data":{"get":{"tags":["guests"],"summary":"Get Table Data Guest","description":"Get data from table for guests (limited)","operationId":"get_table_data_guest_guest_database__database_name___table_name__data_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"database_name","in":"path","required":true,"schema":{"type":"string","title":"Database Name"}},{"name":"table_name","in":"path","required":true,"schema":{"type":"string","title":"Table Name"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/guest/admin/guests":{"get":{"tags":["guests"],"summary":"Get All Guests","description":"Get all guest users (admin only - would need admin auth in production)","operationId":"get_all_guests_guest_admin_guests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/guest/admin/cleanup":{"post":{"tags":["guests"],"summary":"Manual Cleanup Expired Guests","description":"Manually trigger cleanup of expired guests (admin only)","operationId":"manual_cleanup_expired_guests_guest_admin_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/guest/admin/stats":{"get":{"tags":["guests"],"summary":"Get Guest Statistics","description":"Get guest user statistics (admin only)","operationId":"get_guest_statistics_guest_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/system/config":{"get":{"tags":["admin"],"summary":"Get System Config","description":"Get all system configurations","operationId":"get_system_config_admin_system_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]},"post":{"tags":["admin"],"summary":"Create System Config","description":"Create system configuration","operationId":"create_system_config_admin_system_config_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/system/config/{config_id}":{"put":{"tags":["admin"],"summary":"Update System Config","description":"Update system configuration","operationId":"update_system_config_admin_system_config__config_id__put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"integer","title":"Config Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Config Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete System Config","description":"Delete system configuration","operationId":"delete_system_config_admin_system_config__config_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"config_id","in":"path","required":true,"schema":{"type":"integer","title":"Config Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/usage":{"get":{"tags":["admin"],"summary":"Get Usage Analytics","description":"Get detailed API usage analytics","operationId":"get_usage_analytics_admin_analytics_usage_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/analytics/performance":{"get":{"tags":["admin"],"summary":"Get Performance Analytics","description":"Get performance analytics","operationId":"get_performance_analytics_admin_analytics_performance_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/login-audit":{"get":{"tags":["admin"],"summary":"Get Login Audit","description":"Get login audit log for all users","operationId":"get_login_audit_admin_login_audit_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"ip_address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"}},{"name":"success_only","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Success Only"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/login-stats":{"get":{"tags":["admin"],"summary":"Get Login Stats","description":"Get login statistics","operationId":"get_login_stats_admin_login_stats_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/broadcast":{"post":{"tags":["admin"],"summary":"Broadcast Message","description":"Send broadcast message to users","operationId":"broadcast_message_admin_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/maintenance/cleanup":{"post":{"tags":["admin"],"summary":"Run Maintenance Cleanup","description":"Run system maintenance and cleanup","operationId":"run_maintenance_cleanup_admin_maintenance_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/logs":{"get":{"tags":["admin"],"summary":"Get System Logs","description":"Get system logs (mock implementation)","operationId":"get_system_logs_admin_logs_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"lines","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Lines"}},{"name":"level","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/export/users":{"get":{"tags":["admin"],"summary":"Export Users Data","description":"Export users data","operationId":"export_users_data_admin_export_users_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/export/usage":{"get":{"tags":["admin"],"summary":"Export Usage Data","description":"Export API usage data","operationId":"export_usage_data_admin_export_usage_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/health":{"get":{"tags":["admin"],"summary":"Admin System Health","description":"Check admin system health","operationId":"admin_system_health_admin_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/users/simple":{"get":{"tags":["admin"],"summary":"Get All Users Simple","description":"Get all users' names and emails (simple list)","operationId":"get_all_users_simple_admin_users_simple_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/users":{"get":{"tags":["admin"],"summary":"List All Users","description":"List all users with filtering and pagination","operationId":"list_all_users_admin_users_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"account_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"}},{"name":"is_verified","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Verified"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Create User","description":"Create new user (admin only)","operationId":"create_user_admin_users_post","security":[{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"Get User Details","description":"Get detailed user information","operationId":"get_user_details_admin_users__user_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["admin"],"summary":"Update User","description":"Update user information","operationId":"update_user_admin_users__user_id__put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete User","description":"Delete user account","operationId":"delete_user_admin_users__user_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/credits":{"post":{"tags":["admin"],"summary":"Adjust User Credits","description":"Adjust user credit balance","operationId":"adjust_user_credits_admin_users__user_id__credits_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditAdjustmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}/reset-password":{"post":{"tags":["admin"],"summary":"Reset User Password","description":"Reset user password","operationId":"reset_user_password_admin_users__user_id__reset_password_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Password Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guests":{"get":{"tags":["admin"],"summary":"List Guest Users","description":"List all guest users","operationId":"list_guest_users_admin_guests_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"platform","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/guests/cleanup":{"post":{"tags":["admin"],"summary":"Cleanup Expired Guests Endpoint","description":"Manually cleanup expired guests","operationId":"cleanup_expired_guests_endpoint_admin_guests_cleanup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/guests/{guest_id}":{"delete":{"tags":["admin"],"summary":"Delete Guest User","description":"Delete specific guest user","operationId":"delete_guest_user_admin_guests__guest_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"guest_id","in":"path","required":true,"schema":{"type":"integer","title":"Guest Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/databases":{"get":{"tags":["admin"],"summary":"List Databases","description":"List all databases in registry","operationId":"list_databases_admin_databases_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]},"post":{"tags":["admin"],"summary":"Create Database","description":"Create new database registry entry","operationId":"create_database_admin_databases_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseCreateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/admin/databases/{database_id}":{"put":{"tags":["admin"],"summary":"Update Database","description":"Update database registry entry","operationId":"update_database_admin_databases__database_id__put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"database_id","in":"path","required":true,"schema":{"type":"integer","title":"Database Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Db Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/system/stats":{"get":{"tags":["admin"],"summary":"Get System Statistics","description":"Get comprehensive system statistics","operationId":"get_system_statistics_admin_system_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/cashfree/plans":{"get":{"tags":["payments"],"summary":"Get Plans","description":"Get all available subscription plans (USD only)\nPublic endpoint - no authentication required","operationId":"get_plans_cashfree_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cashfree/config":{"get":{"tags":["payments"],"summary":"Get Config","description":"Get Cashfree configuration and supported currencies","operationId":"get_config_cashfree_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/cashfree/create-order":{"post":{"tags":["payments"],"summary":"Create Order","description":"Create Cashfree payment order for subscription\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/orders/create","operationId":"create_order_cashfree_create_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/cashfree/order/{order_id}":{"get":{"tags":["payments"],"summary":"Get Order Status","description":"Get Cashfree order status\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/orders/get","operationId":"get_order_status_cashfree_order__order_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cashfree/payments/{order_id}":{"get":{"tags":["payments"],"summary":"Get Order Payments","description":"Get all payment attempts for an order\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/payments/get-payments-for-order","operationId":"get_order_payments_cashfree_payments__order_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cashfree/subscription":{"get":{"tags":["payments"],"summary":"Get User Subscription","description":"Get user's current subscription details","operationId":"get_user_subscription_cashfree_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/cashfree/payments":{"get":{"tags":["payments"],"summary":"Get User Payments","description":"Get user's payment history with pagination","operationId":"get_user_payments_cashfree_payments_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cashfree/usage":{"get":{"tags":["payments"],"summary":"Get Credit Usage","description":"Get user's credit usage statistics","operationId":"get_credit_usage_cashfree_usage_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cashfree/webhook":{"post":{"tags":["payments"],"summary":"Handle Webhook","description":"Handle Cashfree payment webhook events\n\nReference: https://www.cashfree.com/docs/payments/online/webhooks\n\nEvents:\n- PAYMENT_SUCCESS_WEBHOOK\n- PAYMENT_FAILED_WEBHOOK\n- PAYMENT_USER_DROPPED_WEBHOOK","operationId":"handle_webhook_cashfree_webhook_post","parameters":[{"name":"x-webhook-timestamp","in":"header","required":false,"schema":{"type":"string","title":"X-Webhook-Timestamp"}},{"name":"x-webhook-signature","in":"header","required":false,"schema":{"type":"string","title":"X-Webhook-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/plans":{"get":{"tags":["payments"],"summary":"Get Plans","description":"Get all available subscription plans (USD only)\nPublic endpoint - no authentication required","operationId":"get_plans_payment_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/payment/config":{"get":{"tags":["payments"],"summary":"Get Config","description":"Get Cashfree configuration and supported currencies","operationId":"get_config_payment_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/payment/create-order":{"post":{"tags":["payments"],"summary":"Create Order","description":"Create Cashfree payment order for subscription\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/orders/create","operationId":"create_order_payment_create_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/payment/order/{order_id}":{"get":{"tags":["payments"],"summary":"Get Order Status","description":"Get Cashfree order status\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/orders/get","operationId":"get_order_status_payment_order__order_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/payments/{order_id}":{"get":{"tags":["payments"],"summary":"Get Order Payments","description":"Get all payment attempts for an order\n\nReference: https://www.cashfree.com/docs/api-reference/payments/latest/payments/get-payments-for-order","operationId":"get_order_payments_payment_payments__order_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/subscription":{"get":{"tags":["payments"],"summary":"Get User Subscription","description":"Get user's current subscription details","operationId":"get_user_subscription_payment_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/payment/payments":{"get":{"tags":["payments"],"summary":"Get User Payments","description":"Get user's payment history with pagination","operationId":"get_user_payments_payment_payments_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/usage":{"get":{"tags":["payments"],"summary":"Get Credit Usage","description":"Get user's credit usage statistics","operationId":"get_credit_usage_payment_usage_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/payment/webhook":{"post":{"tags":["payments"],"summary":"Handle Webhook","description":"Handle Cashfree payment webhook events\n\nReference: https://www.cashfree.com/docs/payments/online/webhooks\n\nEvents:\n- PAYMENT_SUCCESS_WEBHOOK\n- PAYMENT_FAILED_WEBHOOK\n- PAYMENT_USER_DROPPED_WEBHOOK","operationId":"handle_webhook_payment_webhook_post","parameters":[{"name":"x-webhook-timestamp","in":"header","required":false,"schema":{"type":"string","title":"X-Webhook-Timestamp"}},{"name":"x-webhook-signature","in":"header","required":false,"schema":{"type":"string","title":"X-Webhook-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/news/single-domain/{domain}":{"get":{"tags":["news"],"summary":"Get News From Single Domain","description":"Get news from a single domain with 0.10 credit cost","operationId":"get_news_from_single_domain_news_single_domain__domain__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"domain","in":"path","required":true,"schema":{"type":"string","title":"Domain"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/NewsCategory"},{"type":"null"}],"title":"Category"}},{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/news/multiple-domains":{"post":{"tags":["news"],"summary":"Get News From Multiple Domains","description":"Get news from multiple domains with 0.25 credit cost","operationId":"get_news_from_multiple_domains_news_multiple_domains_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/news/date-range":{"post":{"tags":["news"],"summary":"Get News By Date Range","description":"Get news within a specific date range with 0.15 credit cost","operationId":"get_news_by_date_range_news_date_range_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateRangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/news/country/{country_code}":{"get":{"tags":["news"],"summary":"Get News By Country","description":"Get news from a specific country with 0.12 credit cost","operationId":"get_news_by_country_news_country__country_code__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_code","in":"path","required":true,"schema":{"type":"string","title":"Country Code"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/NewsCategory"},{"type":"null"}],"title":"Category"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":10,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/news/topic-search":{"post":{"tags":["news"],"summary":"Search News By Topic","description":"Search news by keywords/topics with 0.12 credit cost","operationId":"search_news_by_topic_news_topic_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopicSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/news/categories":{"get":{"tags":["news"],"summary":"Get Available Categories","description":"Get list of available news categories (free endpoint)","operationId":"get_available_categories_news_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/news/pricing":{"get":{"tags":["news"],"summary":"Get News Pricing","description":"Get credit costs for different news operations (free endpoint)","operationId":"get_news_pricing_news_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/news/stats":{"get":{"tags":["news"],"summary":"Get News Usage Stats","description":"Get user's news API usage statistics","operationId":"get_news_usage_stats_news_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/news/analyze":{"post":{"tags":["news"],"summary":"Analyze News Article","description":"AI-powered news article analysis\nExtracts article content and performs comprehensive financial analysis\nCost: 10 credits","operationId":"analyze_news_article_news_analyze_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsAnalysisRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/support/tickets":{"get":{"tags":["support"],"summary":"Get User Tickets","description":"Get user's support tickets","operationId":"get_user_tickets_support_tickets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]},"post":{"tags":["support"],"summary":"Create Ticket","description":"Create new support ticket (requires authentication)","operationId":"create_ticket_support_tickets_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/support/tickets/{ticket_id}":{"get":{"tags":["support"],"summary":"Get Ticket Details","description":"Get detailed ticket information with messages","operationId":"get_ticket_details_support_tickets__ticket_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["support"],"summary":"Update Ticket","description":"Update ticket status (user can only close/reopen)","operationId":"update_ticket_support_tickets__ticket_id__put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TicketUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/tickets/{ticket_id}/messages":{"post":{"tags":["support"],"summary":"Add Ticket Message","description":"Add message to support ticket","operationId":"add_ticket_message_support_tickets__ticket_id__messages_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/contact":{"post":{"tags":["support"],"summary":"Submit Contact Form","description":"Submit contact form (public endpoint)","operationId":"submit_contact_form_support_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactFormCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/feedback":{"post":{"tags":["support"],"summary":"Submit Feedback","description":"Submit feedback (public endpoint)","operationId":"submit_feedback_support_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/categories":{"get":{"tags":["support"],"summary":"Get Support Categories","description":"Get available support categories (public endpoint)","operationId":"get_support_categories_support_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/support/stats":{"get":{"tags":["support"],"summary":"Get Support Stats","description":"Get user's support statistics","operationId":"get_support_stats_support_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/support/newsletter/subscribe":{"post":{"tags":["support"],"summary":"Subscribe To Newsletter","description":"Subscribe to Fincept newsletter (public endpoint - no authentication required)","operationId":"subscribe_to_newsletter_support_newsletter_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsletterSubscribe"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/newsletter/unsubscribe":{"post":{"tags":["support"],"summary":"Unsubscribe From Newsletter","description":"Unsubscribe from newsletter (public endpoint)","operationId":"unsubscribe_from_newsletter_support_newsletter_unsubscribe_post","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email","title":"Email"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/newsletter/status":{"get":{"tags":["support"],"summary":"Check Newsletter Status","description":"Check newsletter subscription status (public endpoint)","operationId":"check_newsletter_status_support_newsletter_status_get","parameters":[{"name":"email","in":"query","required":true,"schema":{"type":"string","format":"email","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions":{"get":{"tags":["chat"],"summary":"Get Chat Sessions","description":"Get user's chat sessions (both registered and guest users)","operationId":"get_chat_sessions_chat_sessions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["chat"],"summary":"Create Chat Session","description":"Create new chat session","operationId":"create_chat_session_chat_sessions_post","security":[{"APIKeyHeader":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatSessionCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/bulk-delete":{"delete":{"tags":["chat"],"summary":"Bulk Delete Sessions","description":"Bulk delete chat sessions (registered users only)","operationId":"bulk_delete_sessions_chat_sessions_bulk_delete_delete","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Session Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/sessions/{session_uuid}":{"get":{"tags":["chat"],"summary":"Get Chat Session","description":"Get specific chat session with messages","operationId":"get_chat_session_chat_sessions__session_uuid__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_uuid","in":"path","required":true,"schema":{"type":"string","title":"Session Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["chat"],"summary":"Delete Chat Session","description":"Delete chat session and all messages","operationId":"delete_chat_session_chat_sessions__session_uuid__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_uuid","in":"path","required":true,"schema":{"type":"string","title":"Session Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_uuid}/messages":{"post":{"tags":["chat"],"summary":"Send Chat Message","description":"Send message to chat session and get AI response","operationId":"send_chat_message_chat_sessions__session_uuid__messages_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_uuid","in":"path","required":true,"schema":{"type":"string","title":"Session Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_uuid}/activate":{"put":{"tags":["chat"],"summary":"Activate Chat Session","description":"Activate a chat session (deactivates others)","operationId":"activate_chat_session_chat_sessions__session_uuid__activate_put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_uuid","in":"path","required":true,"schema":{"type":"string","title":"Session Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/sessions/{session_uuid}/title":{"put":{"tags":["chat"],"summary":"Update Chat Title","description":"Update chat session title","operationId":"update_chat_title_chat_sessions__session_uuid__title_put","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"session_uuid","in":"path","required":true,"schema":{"type":"string","title":"Session Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Title Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/stats":{"get":{"tags":["chat"],"summary":"Get Chat Statistics","description":"Get chat statistics for current user","operationId":"get_chat_statistics_chat_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/export":{"post":{"tags":["chat"],"summary":"Export Chat Sessions","description":"Export chat sessions to JSON (registered users only)","operationId":"export_chat_sessions_chat_export_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Export Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/admin/statistics":{"get":{"tags":["chat"],"summary":"Get Admin Chat Statistics","description":"Get system-wide chat statistics (admin only)","operationId":"get_admin_chat_statistics_chat_admin_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/admin/sessions":{"get":{"tags":["chat"],"summary":"Get Admin Chat Sessions","description":"Get all chat sessions with pagination (admin only)","operationId":"get_admin_chat_sessions_chat_admin_sessions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"user_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/quick-chat":{"post":{"tags":["chat"],"summary":"Quick Chat","description":"Quick chat without session management (for testing)","operationId":"quick_chat_chat_quick_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatMessageCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/search":{"get":{"tags":["chat"],"summary":"Search Chat Messages","description":"Search chat messages","operationId":"search_chat_messages_chat_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/chat/templates":{"get":{"tags":["chat"],"summary":"Get Chat Templates","description":"Get predefined chat templates (registered users only)","operationId":"get_chat_templates_chat_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/chat/templates/{template_id}/start":{"post":{"tags":["chat"],"summary":"Start Template Session","description":"Start a chat session from template (registered users only)","operationId":"start_template_session_chat_templates__template_id__start_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/categories":{"get":{"tags":["forum"],"summary":"Get Forum Categories","description":"Get all forum categories (accessible to both users and guests)","operationId":"get_forum_categories_forum_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forum/categories/{category_id}/posts":{"get":{"tags":["forum"],"summary":"Get Category Posts","description":"Get posts in a specific category","operationId":"get_category_posts_forum_categories__category_id__posts_get","parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","pattern":"^(latest|popular|views|replies)$","default":"latest","title":"Sort By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["forum"],"summary":"Create Forum Post","description":"Create new forum post (registered users only)","operationId":"create_forum_post_forum_categories__category_id__posts_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"category_id","in":"path","required":true,"schema":{"type":"integer","title":"Category Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumPostCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/posts/trending":{"get":{"tags":["forum"],"summary":"Get Trending Posts","description":"Get trending forum posts","operationId":"get_trending_posts_forum_posts_trending_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"timeframe","in":"query","required":false,"schema":{"type":"string","pattern":"^(day|week|month)$","default":"week","title":"Timeframe"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/posts/{post_uuid}":{"get":{"tags":["forum"],"summary":"Get Forum Post","description":"Get specific forum post with comments","operationId":"get_forum_post_forum_posts__post_uuid__get","parameters":[{"name":"post_uuid","in":"path","required":true,"schema":{"type":"string","title":"Post Uuid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/posts/{post_uuid}/comments":{"post":{"tags":["forum"],"summary":"Create Forum Comment","description":"Create comment on forum post (registered users only)","operationId":"create_forum_comment_forum_posts__post_uuid__comments_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"post_uuid","in":"path","required":true,"schema":{"type":"string","title":"Post Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumCommentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/posts/{post_uuid}/vote":{"post":{"tags":["forum"],"summary":"Vote On Post","description":"Vote on forum post (registered users only)","operationId":"vote_on_post_forum_posts__post_uuid__vote_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"post_uuid","in":"path","required":true,"schema":{"type":"string","title":"Post Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumVoteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/comments/{comment_uuid}/vote":{"post":{"tags":["forum"],"summary":"Vote On Comment","description":"Vote on forum comment (registered users only)","operationId":"vote_on_comment_forum_comments__comment_uuid__vote_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"comment_uuid","in":"path","required":true,"schema":{"type":"string","title":"Comment Uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumVoteCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/search":{"get":{"tags":["forum"],"summary":"Search Forum","description":"Search forum posts and comments","operationId":"search_forum_forum_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":2,"maxLength":100,"title":"Q"}},{"name":"category_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Category Id"}},{"name":"post_type","in":"query","required":false,"schema":{"type":"string","pattern":"^(all|posts|comments)$","default":"all","title":"Post Type"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/stats":{"get":{"tags":["forum"],"summary":"Get Forum Statistics","description":"Get forum statistics","operationId":"get_forum_statistics_forum_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forum/profile/{username}":{"get":{"tags":["forum"],"summary":"Get Forum User Profile","description":"Get forum user profile (registered users only)","operationId":"get_forum_user_profile_forum_profile__username__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"username","in":"path","required":true,"schema":{"type":"string","title":"Username"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forum/profile":{"get":{"tags":["forum"],"summary":"Get My Forum Profile","description":"Get current user's forum profile","operationId":"get_my_forum_profile_forum_profile_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]},"put":{"tags":["forum"],"summary":"Update Forum Profile","description":"Update current user's forum profile","operationId":"update_forum_profile_forum_profile_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForumProfileUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/forum/admin/categories":{"post":{"tags":["forum"],"summary":"Create Forum Category","description":"Create new forum category (admin only)","operationId":"create_forum_category_forum_admin_categories_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Category Data"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/forum/admin/statistics":{"get":{"tags":["forum"],"summary":"Get Admin Forum Statistics","description":"Get detailed forum statistics (admin only)","operationId":"get_admin_forum_statistics_forum_admin_statistics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/marketplace/upload":{"post":{"tags":["marketplace"],"summary":"Upload Dataset","description":"Upload dataset to marketplace with pricing options","operationId":"upload_dataset_marketplace_upload_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"metadata","in":"query","required":true,"schema":{"type":"string","title":"Metadata"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_dataset_marketplace_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/datasets":{"get":{"tags":["marketplace"],"summary":"Browse Datasets","description":"Browse marketplace datasets (registered users only)","operationId":"browse_datasets_marketplace_datasets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"type":"string","default":"uploaded_at","title":"Sort By"}},{"name":"sort_order","in":"query","required":false,"schema":{"type":"string","default":"desc","title":"Sort Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/my-purchases":{"get":{"tags":["marketplace"],"summary":"Get User Purchases","description":"Get user's dataset purchases","operationId":"get_user_purchases_marketplace_my_purchases_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/my-datasets":{"get":{"tags":["marketplace"],"summary":"Get My Datasets","description":"Get user's uploaded datasets with status filtering","operationId":"get_my_datasets_marketplace_my_datasets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/datasets/{dataset_id}":{"patch":{"tags":["marketplace"],"summary":"Update Dataset","description":"Update dataset metadata (only owner can update, only if pending/rejected)","operationId":"update_dataset_marketplace_datasets__dataset_id__patch","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Update Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["marketplace"],"summary":"Delete Dataset","description":"Delete dataset (only owner can delete, only if not purchased by others)","operationId":"delete_dataset_marketplace_datasets__dataset_id__delete","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["marketplace"],"summary":"Get Dataset Details","description":"Get detailed dataset information","operationId":"get_dataset_details_marketplace_datasets__dataset_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/datasets/{dataset_id}/purchase":{"post":{"tags":["marketplace"],"summary":"Purchase Dataset","description":"Purchase dataset (free - just registers access)","operationId":"purchase_dataset_marketplace_datasets__dataset_id__purchase_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/datasets/{dataset_id}/download":{"post":{"tags":["marketplace"],"summary":"Download Dataset","description":"Download dataset file (free for all registered users)","operationId":"download_dataset_marketplace_datasets__dataset_id__download_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/my-datasets/analytics":{"get":{"tags":["marketplace"],"summary":"Get Dataset Analytics","description":"Get analytics for user's uploaded datasets","operationId":"get_dataset_analytics_marketplace_my_datasets_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/marketplace/admin/stats":{"get":{"tags":["marketplace"],"summary":"Get Marketplace Stats","description":"Get comprehensive marketplace statistics","operationId":"get_marketplace_stats_marketplace_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/marketplace/admin/pending-datasets":{"get":{"tags":["marketplace"],"summary":"Get Pending Datasets","description":"Get all pending datasets for approval","operationId":"get_pending_datasets_marketplace_admin_pending_datasets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/marketplace/admin/datasets/{dataset_id}/approve":{"post":{"tags":["marketplace"],"summary":"Approve Dataset","description":"Approve a pending dataset","operationId":"approve_dataset_marketplace_admin_datasets__dataset_id__approve_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marketplace/admin/datasets/{dataset_id}/reject":{"post":{"tags":["marketplace"],"summary":"Reject Dataset","description":"Reject a pending dataset","operationId":"reject_dataset_marketplace_admin_datasets__dataset_id__reject_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"integer","title":"Dataset Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Rejection Data"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/research/papers/search":{"get":{"tags":["research","research"],"summary":"Search Papers","description":"Search academic papers from arXiv with pagination\nCost: 1 credit per 10 papers (per page)\nRate limit: 1 request per second\n\nReturns 10 papers per page. Each page costs 1 credit.\nExample: page=1 returns papers 1-10, page=2 returns papers 11-20","operationId":"search_papers_research_papers_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","description":"Search query (keywords separated by space)","title":"Query"},"description":"Search query (keywords separated by space)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (1-indexed)","default":1,"title":"Page"},"description":"Page number (1-indexed)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/research/papers/trending":{"get":{"tags":["research","research"],"summary":"Get Trending Papers","description":"Get trending recent papers by topic with pagination\nCost: 1 credit per 10 papers (per page)\nRate limit: 1 request per second","operationId":"get_trending_papers_research_papers_trending_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"topic","in":"query","required":true,"schema":{"type":"string","description":"Research topic","title":"Topic"},"description":"Research topic"},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":7,"description":"Days to look back","default":30,"title":"Days"},"description":"Days to look back"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/research/content-reader":{"post":{"tags":["research","research"],"summary":"Content Reader","description":"Extract and read content from web documents\nCost: 0.25 credits per request\nRate limit: 1 request per second","operationId":"content_reader_research_content_reader_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentReaderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/web-search":{"post":{"tags":["research","research"],"summary":"Web Search","description":"Search the web for financial and market intelligence","operationId":"web_search_research_web_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/chat":{"post":{"tags":["research","research"],"summary":"Fincept Chat","description":"Official Fincept AI Chat","operationId":"fincept_chat_research_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/grokipedia":{"post":{"tags":["research","research"],"summary":"Grokipedia Fetch","description":"Fetch knowledge articles from Grokipedia (xAI's knowledge base)\n\nThis endpoint retrieves comprehensive articles from Grokipedia, covering various topics\nwith detailed content, references, and citations.\n\nCost: 0.25 credits per request\nRate limit: 1 request per second\n\nParameters:\n- slug: Article slug/identifier (e.g., \"artificial-intelligence\", \"climate-change\")\n- extract_refs: Extract and include references (default: true)\n- truncate: Limit content to N characters (optional)\n- citations: Include citation formatting (default: false)\n\nExample slugs:\n- \"bitcoin\"\n- \"machine-learning\"\n- \"quantum-computing\"\n- \"financial-markets\"","operationId":"grokipedia_fetch_research_grokipedia_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrokipediaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/pdf/extract":{"post":{"tags":["research","research"],"summary":"Extract Pdf Text","description":"Extract text from uploaded PDF file\nDynamic Pricing:\n- 1-10 pages: 1 credit\n- 11-50 pages: 2 credits\n- 51-100 pages: 3 credits\n- 101-200 pages: 5 credits\n- 201+ pages: 10 credits\nRate limit: 1 request per second\nMax file size: 10MB","operationId":"extract_pdf_text_research_pdf_extract_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_pdf_text_research_pdf_extract_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/health":{"get":{"tags":["research","research"],"summary":"Research Health","description":"Health check for Fincept research module","operationId":"research_health_research_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/research/llm":{"post":{"tags":["research","research"],"summary":"General Llm Inference","description":"General-purpose LLM endpoint for running agents, processing data, and AI tasks.\n\nThis endpoint allows you to use Fincept API as your LLM provider for:\n- Running AI agents\n- Data processing and analysis\n- Code generation\n- Text summarization\n- Question answering\n- Any other LLM-based tasks\n\nCost: 5 credits per successful response\nNote: Credits are ONLY deducted on successful LLM response. If the LLM fails, no credits are charged.\n\nRate limit: 1 request per second","operationId":"general_llm_inference_research_llm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LLMRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/visual-analysis":{"post":{"tags":["research","research"],"summary":"Satellite Visual Analysis","description":"Multimodal Visual Analysis using Fincept Vision AI for satellite imagery and visual understanding.\n\nThis endpoint enables advanced visual analysis capabilities including:\n- Satellite image analysis and interpretation\n- Geographic feature detection and classification\n- Land use and land cover analysis\n- Urban planning and infrastructure mapping\n- Environmental monitoring\n- Agricultural assessment\n- Disaster response and damage assessment\n- Object detection and counting in images\n- Visual question answering\n- Image description and captioning\n\nModel: Fincept Vision AI (Multimodal Vision-Language Model)\n- Native multimodal understanding\n- 128K context window\n- Advanced visual reasoning\n- Function calling capabilities\n- High-resolution image processing\n\nCost: 10 credits per successful response\nNote: Credits are ONLY deducted on successful analysis. If the model fails, no credits are charged.\n\nRate limit: 1 request per second\n\nExample Use Cases:\n- \"Identify all buildings in this satellite image\"\n- \"What type of land use is shown in this area?\"\n- \"Detect any changes or anomalies in this image\"\n- \"Count the number of vehicles in this parking lot\"\n- \"Analyze the vegetation health in this agricultural field\"","operationId":"satellite_visual_analysis_research_visual_analysis_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisualAnalysisRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/research/news-events":{"get":{"tags":["research","research"],"summary":"Get News Events","description":"Highly configurable news events endpoint with independent filter parameters\n\n**Cost:** 3 credits per request\n\n**Features:**\n- Filter by country, city/cities, and/or event category (all work independently)\n- Get unique lists: cities, countries, or categories\n- All filters work in any combination\n- Pagination support (30 events per page by default)\n- Returns all 10 columns of data\n\n**Filter Parameters (all optional and independent):**\n- country: Filter by country name (e.g., \"India\")\n- city: Single city filter (e.g., \"Mumbai\")\n- cities: Multiple cities filter (comma-separated, e.g., \"Mumbai,Delhi,Bangalore\")\n- event_category: Filter by category\n\n**Unique List Parameters (mutually exclusive):**\n- get_unique_cities: Return unique cities list (default: false)\n- get_unique_countries: Return unique countries list (default: false)\n- get_unique_categories: Return unique event categories list (default: false)\n\n**Pagination Parameters:**\n- page: Page number (default: 1)\n- limit: Events per page (default: 30, max: 100)\n\n**Examples:**\n- Get events: No unique parameters\n- Get all cities in India: country=India&get_unique_cities=true\n- Get all countries with protests: event_category=protests&get_unique_countries=true\n- Get categories for Mumbai: city=Mumbai&get_unique_categories=true\n\n**Returns:** Events with pagination OR unique list (cities/countries/categories)","operationId":"get_news_events_research_news_events_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by country (e.g., 'India', 'USA')","title":"Country"},"description":"Filter by country (e.g., 'India', 'USA')"},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by single city (e.g., 'Mumbai')","title":"City"},"description":"Filter by single city (e.g., 'Mumbai')"},{"name":"cities","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by multiple cities (comma-separated, e.g., 'Mumbai,Delhi,Bangalore')","title":"Cities"},"description":"Filter by multiple cities (comma-separated, e.g., 'Mumbai,Delhi,Bangalore')"},{"name":"event_category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by event category","title":"Event Category"},"description":"Filter by event category"},{"name":"get_unique_cities","in":"query","required":false,"schema":{"type":"boolean","description":"Return list of unique cities instead of events","default":false,"title":"Get Unique Cities"},"description":"Return list of unique cities instead of events"},{"name":"get_unique_countries","in":"query","required":false,"schema":{"type":"boolean","description":"Return list of unique countries instead of events","default":false,"title":"Get Unique Countries"},"description":"Return list of unique countries instead of events"},{"name":"get_unique_categories","in":"query","required":false,"schema":{"type":"boolean","description":"Return list of unique event categories instead of events","default":false,"title":"Get Unique Categories"},"description":"Return list of unique event categories instead of events"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number (starts from 1)","default":1,"title":"Page"},"description":"Page number (starts from 1)"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Events per page (max 100)","default":30,"title":"Limit"},"description":"Events per page (max 100)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/marine/vessel/position":{"post":{"tags":["marine","marine"],"summary":"Get Vessel Position","description":"Get last known position of a vessel by IMO\nCost: 1 credit per request","operationId":"get_vessel_position_marine_vessel_position_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VesselPositionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/marine/vessel/history":{"post":{"tags":["marine","marine"],"summary":"Get Vessel History","description":"Get complete historical location data for a vessel\nCost: 5 credits per request","operationId":"get_vessel_history_marine_vessel_history_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VesselPositionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/marine/vessel/multi":{"post":{"tags":["marine","marine"],"summary":"Get Multi Vessel Positions","description":"Get last known positions for multiple vessels (max 50)\nCost: 3 credits per request","operationId":"get_multi_vessel_positions_marine_vessel_multi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiVesselRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/marine/vessel/area-search":{"post":{"tags":["marine","marine"],"summary":"Search Vessels In Area","description":"Search for all vessels in a defined geographic area\nCost: 8 credits per request\n\nParameters:\n- min_lat, max_lat, min_lng, max_lng: Geographic boundary\n- days_ago (optional): Get historical data from N days ago (0-365)\n If not provided or 0, returns current/latest positions","operationId":"search_vessels_in_area_marine_vessel_area_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaSearchRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/marine/health":{"get":{"tags":["marine","marine"],"summary":"Marine Health","description":"Health check for marine module","operationId":"marine_health_marine_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/aircraft/health":{"get":{"tags":["aircraft","aircraft"],"summary":"Aircraft Health","description":"Health check for aircraft tracking module","operationId":"aircraft_health_aircraft_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/aircraft/track":{"post":{"tags":["aircraft","aircraft"],"summary":"Track Aircraft","description":"Track aircraft by ID using PlaneFinder API with Selenium\nCost: 0.25 credits per successful request\nRate limit: 1 request per second","operationId":"track_aircraft_aircraft_track_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AircraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/aircraft/{aircraft_id}":{"get":{"tags":["aircraft","aircraft"],"summary":"Get Aircraft Endpoint","description":"Get aircraft data by ID (raw format)\nSimple endpoint without authentication for testing","operationId":"get_aircraft_endpoint_aircraft__aircraft_id__get","parameters":[{"name":"aircraft_id","in":"path","required":true,"schema":{"type":"string","title":"Aircraft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/aircraft/{aircraft_id}/raw":{"get":{"tags":["aircraft","aircraft"],"summary":"Get Aircraft Raw","description":"Get raw aircraft data by ID\nSimple endpoint without authentication for testing","operationId":"get_aircraft_raw_aircraft__aircraft_id__raw_get","parameters":[{"name":"aircraft_id","in":"path","required":true,"schema":{"type":"string","title":"Aircraft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/health":{"get":{"tags":["twitter","twitter"],"summary":"Twitter Health","description":"Health check for Twitter integration module","operationId":"twitter_health_twitter_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twitter/countries":{"get":{"tags":["twitter","twitter"],"summary":"Get Available Countries","description":"Get list of all available countries for Twitter trends\nNo authentication required","operationId":"get_available_countries_twitter_countries_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/twitter/trends":{"get":{"tags":["twitter","twitter"],"summary":"Get Twitter Trends","description":"Get current Twitter trending topics for a country\n\nParameters:\n- country: Country name (optional, default: \"worldwide\")\n Examples: \"india\", \"usa\", \"uk\", \"japan\", \"brazil\", \"france\", etc.\n Use /twitter/countries to see all available countries\n\nCost: 0.5 credits per request\nRate limit: 1 request per 2 seconds","operationId":"get_twitter_trends_twitter_trends_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/user/tweets":{"get":{"tags":["twitter","twitter"],"summary":"Get User Tweets","description":"Get user's latest tweets (up to 20 per request)\n\nParameters:\n- username: Twitter screen name (e.g., \"elonmusk\")\n- user_id: Twitter user ID (recommended, more stable than username)\n- cursor: Pagination cursor for next page\n\nNote: Either username OR user_id is required. If both provided, user_id takes priority.\n\nCost: 1.0 credit per request (returns up to 20 tweets)\nRate limit: 1 request per 2 seconds\n\nReturns tweets sorted by created_at with pagination support.","operationId":"get_user_tweets_twitter_user_tweets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"username","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"}},{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweets":{"get":{"tags":["twitter","twitter"],"summary":"Get Tweets By Ids","description":"Get tweets by their IDs\n\nParameters:\n- tweet_ids: Comma-separated tweet IDs (e.g., \"1846987139428634858,1866332309399781537\")\n\nCost: 0.5 credits per request\nRate limit: 1 request per 2 seconds\n\nReturns tweet data for the specified IDs.","operationId":"get_tweets_by_ids_twitter_tweets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_ids","in":"query","required":true,"schema":{"type":"string","title":"Tweet Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweet/replies":{"get":{"tags":["twitter","twitter"],"summary":"Get Tweet Replies","description":"Get replies to a tweet (up to 20 per request)\n\nParameters:\n- tweet_id: The tweet ID to get replies for (required)\n- since_time: On or after specified unix timestamp in seconds (optional)\n- until_time: Before specified unix timestamp in seconds (optional)\n- cursor: Pagination cursor for next page (optional)\n\nNote: tweet_id must be an original tweet (not a reply to another tweet)\n and should be the first tweet in a thread.\n\nCost: 1.0 credit per request (returns up to 20 replies)\nRate limit: 1 request per 2 seconds\n\nReturns replies sorted by reply time (descending) with pagination support.","operationId":"get_tweet_replies_twitter_tweet_replies_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_id","in":"query","required":true,"schema":{"type":"string","title":"Tweet Id"}},{"name":"since_time","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since Time"}},{"name":"until_time","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Until Time"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweet/quotes":{"get":{"tags":["twitter","twitter"],"summary":"Get Tweet Quotes","description":"Get quote tweets of a tweet (20 quotes per request)\n\nParameters:\n- tweet_id: The tweet ID to get quotes for (required)\n- since_time: On or after specified unix timestamp in seconds (optional)\n- until_time: Before specified unix timestamp in seconds (optional)\n- include_replies: Include replies in results (default: true)\n- cursor: Pagination cursor for next page (optional)\n\nCost: 1.0 credit per request (returns 20 quotes)\nRate limit: 1 request per 2 seconds\n\nReturns quote tweets sorted by quote time (descending) with pagination support.","operationId":"get_tweet_quotes_twitter_tweet_quotes_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_id","in":"query","required":true,"schema":{"type":"string","title":"Tweet Id"}},{"name":"since_time","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Since Time"}},{"name":"until_time","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Until Time"}},{"name":"include_replies","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Include Replies"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweet/retweeters":{"get":{"tags":["twitter","twitter"],"summary":"Get Tweet Retweeters","description":"Get users who retweeted a tweet (~100 users per request)\n\nParameters:\n- tweet_id: The tweet ID to get retweeters for (required)\n- cursor: Pagination cursor for next page (optional)\n\nCost: 1.5 credits per request (returns ~100 users)\nRate limit: 1 request per 2 seconds\n\nReturns users who retweeted the tweet, sorted by retweet time (descending) with pagination support.","operationId":"get_tweet_retweeters_twitter_tweet_retweeters_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_id","in":"query","required":true,"schema":{"type":"string","title":"Tweet Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/article":{"get":{"tags":["twitter","twitter"],"summary":"Get Twitter Article","description":"Get full article content from a Twitter article tweet\n\n PREMIUM ENDPOINT - Costs 100 credits per article!\n\nParameters:\n- tweet_id: The tweet ID of the article (required)\n\nCost: 100 credits per article (PREMIUM)\nRate limit: 1 request per 2 seconds\n\nReturns full article content including title, preview, cover image, and full text.\nThis is a premium endpoint due to the comprehensive article data provided.","operationId":"get_twitter_article_twitter_article_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_id","in":"query","required":true,"schema":{"type":"string","title":"Tweet Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweet/thread_context":{"get":{"tags":["twitter","twitter"],"summary":"Get Tweet Thread Context","description":"Get the full thread context of a tweet\n\nThis endpoint retrieves the entire conversation thread containing the specified tweet.\nFor example, if a thread has tweets t1 -> t2 -> t3 -> t4, t5, t6 (all replying to t3),\nproviding t3 will return the entire thread: t1, t2, t3, t4, t5, t6.\n\nParameters:\n- tweet_id: The tweet ID (can be a reply or original tweet)\n- cursor: Pagination cursor for next page (optional)\n\nNote: Pagination size varies due to Twitter API limitations.\nThe number of tweets per page is not fixed.\n\nCost: 2.0 credits per request (variable tweets per page)\nRate limit: 1 request per 2 seconds\n\nReturns the full thread context with pagination support.","operationId":"get_tweet_thread_context_twitter_tweet_thread_context_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"tweet_id","in":"query","required":true,"schema":{"type":"string","title":"Tweet Id"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/tweet/advanced_search":{"get":{"tags":["twitter","twitter"],"summary":"Advanced Tweet Search","description":"Advanced search for tweets with powerful query syntax\n\nSupports advanced Twitter search operators for precise tweet discovery.\n\nParameters:\n- query: Search query with advanced operators (required)\n Examples:\n - \"AI\" OR \"Twitter\" from:elonmusk since:2021-12-31_23:59:59_UTC\n - \"#bitcoin\" min_faves:100\n - \"python\" filter:verified\n See: https://github.com/igorbrigadir/twitter-advanced-search\n\n- query_type: \"Latest\" (chronological) or \"Top\" (most relevant)\n- cursor: Pagination cursor for next page (optional)\n\nCost: 2.5 credits per request (up to 20 tweets)\nRate limit: 1 request per 2 seconds\n\nReturns search results with pagination support.","operationId":"advanced_tweet_search_twitter_tweet_advanced_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"query_type","in":"query","required":false,"schema":{"type":"string","default":"Latest","title":"Query Type"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/user/search":{"get":{"tags":["twitter","twitter"],"summary":"Search Users","description":"Search for Twitter users by keyword\n\nParameters:\n- query: Search keyword (required)\n- cursor: Pagination cursor for next page (optional)\n\nCost: 1.5 credits per request\nRate limit: 1 request per 2 seconds\n\nReturns matching users with pagination support.","operationId":"search_users_twitter_user_search_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"query","in":"query","required":true,"schema":{"type":"string","title":"Query"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/twitter/user/mentions":{"get":{"tags":["twitter","twitter"],"summary":"Get User Mentions","description":"Get tweet mentions by user screen name\nEach page returns exactly 20 mentions\nOrder by mention time descending\nCost: 1.0 credit per request\nRate limit: 1 request per 2 seconds","operationId":"get_user_mentions_twitter_user_mentions_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"userName","in":"query","required":true,"schema":{"type":"string","title":"Username"}},{"name":"sinceTime","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Sincetime"}},{"name":"untilTime","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Untiltime"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/my-login-history":{"get":{"tags":["analytics"],"summary":"Get My Login History","description":"Get current user's login history (User only sees their own)","operationId":"get_my_login_history_analytics_my_login_history_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/admin/dashboard":{"get":{"tags":["analytics"],"summary":"Get Admin Dashboard","description":"Get comprehensive dashboard statistics (Admin only)","operationId":"get_admin_dashboard_analytics_admin_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/analytics/admin/users/growth":{"get":{"tags":["analytics"],"summary":"Get User Growth","description":"Get user growth analytics (Admin only)","operationId":"get_user_growth_analytics_admin_users_growth_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/analytics/admin/engagement":{"get":{"tags":["analytics"],"summary":"Get Engagement Metrics","description":"Get user engagement metrics (Admin only)","operationId":"get_engagement_metrics_analytics_admin_engagement_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/analytics/admin/api-stats":{"get":{"tags":["analytics"],"summary":"Get Api Statistics","description":"Get API usage statistics (Admin only)","operationId":"get_api_statistics_analytics_admin_api_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/analytics/admin/usage":{"get":{"tags":["analytics"],"summary":"Get Usage Analytics","description":"Get detailed API usage analytics (Admin only)","operationId":"get_usage_analytics_analytics_admin_usage_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/admin/performance":{"get":{"tags":["analytics"],"summary":"Get Performance Analytics","description":"Get performance analytics (Admin only)","operationId":"get_performance_analytics_analytics_admin_performance_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/admin/login-audit":{"get":{"tags":["analytics"],"summary":"Get Login Audit","description":"Get login audit log for all users (Admin only)","operationId":"get_login_audit_analytics_admin_login_audit_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"User Id"}},{"name":"ip_address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"}},{"name":"success_only","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Success Only"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/analytics/admin/revenue-analytics":{"get":{"tags":["analytics"],"summary":"Get Admin Revenue Analytics","description":"Get marketplace revenue analytics (Admin only)","operationId":"get_admin_revenue_analytics_analytics_admin_revenue_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/analytics/admin/subscription-analytics":{"get":{"tags":["analytics"],"summary":"Get Subscription Analytics","description":"Get subscription analytics (Admin only) - DISABLED - Payment system to be reimplemented","operationId":"get_subscription_analytics_analytics_admin_subscription_analytics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/speech/decompose":{"post":{"tags":["speech"],"summary":"Decompose Speech","description":"Decompose financial/political speech into structured components.\n\n- Requires API key authentication\n- Costs 2-10 credits based on text size\n- Maximum text length: 500,000 characters\n- Processing is done asynchronously for long texts (>10K chars)\n\nCredit tiers:\n- <5K chars: 2 credits\n- <15K chars: 3 credits\n- <30K chars: 4 credits\n- <50K chars: 5 credits\n- <100K chars: 6 credits\n- <200K chars: 8 credits\n- 200K+ chars: 10 credits","operationId":"decompose_speech_speech_decompose_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpeechInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/speech/status/{analysis_id}":{"get":{"tags":["speech"],"summary":"Get Analysis Status","description":"Get status of a speech analysis (user can only access their own)","operationId":"get_analysis_status_speech_status__analysis_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/speech/history":{"get":{"tags":["speech"],"summary":"Get Analysis History","description":"Get user's speech analysis history","operationId":"get_analysis_history_speech_history_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/speech/result/{analysis_id}":{"get":{"tags":["speech"],"summary":"Get Full Result","description":"Get full decomposition result including raw passes (user's own only)","operationId":"get_full_result_speech_result__analysis_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"analysis_id","in":"path","required":true,"schema":{"type":"string","title":"Analysis Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/countries":{"get":{"tags":["trade"],"summary":"Get Countries","description":"Get list of countries with optional filtering\n\n- continent: Filter by continent ID (af, as, eu, na, sa, oc)\n- search: Search country name","operationId":"get_countries_trade_countries_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"continent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Continent"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/continents":{"get":{"tags":["trade"],"summary":"Get Continents","description":"Get list of all continents","operationId":"get_continents_trade_continents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/trade/products":{"get":{"tags":["trade"],"summary":"Get Products","description":"Get product hierarchy\n\n- level: Filter by level (Section, HS2, HS4, HS6)\n- parent: Get children of parent HS code","operationId":"get_products_trade_products_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"level","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Level"}},{"name":"parent","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Parent"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/bilateral":{"get":{"tags":["trade"],"summary":"Get Bilateral Trade","description":"Get bilateral trade data between countries\n\nReturns trade flows between exporters and importers for a specific product and year","operationId":"get_bilateral_trade_trade_bilateral_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hs_code","in":"query","required":true,"schema":{"type":"string","description":"HS product code","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":true,"schema":{"type":"integer","description":"Year (1995-2023)","title":"Year"},"description":"Year (1995-2023)"},{"name":"exporter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Exporter country ID","title":"Exporter"},"description":"Exporter country ID"},{"name":"importer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Importer country ID","title":"Importer"},"description":"Importer country ID"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/country-partners/{country_id}":{"get":{"tags":["trade"],"summary":"Get Country Trade Partners","description":"Get top trading partners for a country (for Chord Diagram)\n\nReturns ranked list of trading partners with trade values","operationId":"get_country_trade_partners_trade_country_partners__country_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_id","in":"path","required":true,"schema":{"type":"string","title":"Country Id"}},{"name":"year","in":"query","required":true,"schema":{"type":"integer","description":"Year (1995-2023)","title":"Year"},"description":"Year (1995-2023)"},{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"flow_type","in":"query","required":false,"schema":{"type":"string","description":"export, import, or total","default":"total","title":"Flow Type"},"description":"export, import, or total"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/chord-data/{country_id}":{"get":{"tags":["trade"],"summary":"Get Chord Diagram Data","description":"Get data formatted for Chord Diagram visualization (like Bloomberg Terminal)\n\nReturns:\n- nodes: List of countries (source + top partners)\n- flows: Trade flows between countries\n- rankings: Ranked list of partners with total trade","operationId":"get_chord_diagram_data_trade_chord_data__country_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_id","in":"path","required":true,"schema":{"type":"string","title":"Country Id"}},{"name":"year","in":"query","required":false,"schema":{"type":"integer","description":"Year (1995-2023)","default":2017,"title":"Year"},"description":"Year (1995-2023)"},{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"top_n","in":"query","required":false,"schema":{"type":"integer","maximum":50,"description":"Number of top partners","default":15,"title":"Top N"},"description":"Number of top partners"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/time-series/{country_id}":{"get":{"tags":["trade"],"summary":"Get Trade Time Series","description":"Get time series trade data for a country\n\nReturns trade values over time for trend analysis","operationId":"get_trade_time_series_trade_time_series__country_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_id","in":"path","required":true,"schema":{"type":"string","title":"Country Id"}},{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"start_year","in":"query","required":false,"schema":{"type":"integer","default":1995,"title":"Start Year"}},{"name":"end_year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"End Year"}},{"name":"flow","in":"query","required":false,"schema":{"type":"string","description":"export, import, or both","default":"both","title":"Flow"},"description":"export, import, or both"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/growth/{country_id}":{"get":{"tags":["trade"],"summary":"Get Trade Growth","description":"Get trade growth rates for a country","operationId":"get_trade_growth_trade_growth__country_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_id","in":"path","required":true,"schema":{"type":"string","title":"Country Id"}},{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"Year"}},{"name":"flow","in":"query","required":false,"schema":{"type":"string","description":"export or import","default":"export","title":"Flow"},"description":"export or import"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/balance/{country_id}":{"get":{"tags":["trade"],"summary":"Get Trade Balance","description":"Get trade balance (surplus/deficit) for a country","operationId":"get_trade_balance_trade_balance__country_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"country_id","in":"path","required":true,"schema":{"type":"string","title":"Country Id"}},{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"Year"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/top-exporters":{"get":{"tags":["trade"],"summary":"Get Top Exporters","description":"Get top exporting countries for a product","operationId":"get_top_exporters_trade_top_exporters_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"Year"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/top-importers":{"get":{"tags":["trade"],"summary":"Get Top Importers","description":"Get top importing countries for a product","operationId":"get_top_importers_trade_top_importers_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"Year"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/continent-trade":{"get":{"tags":["trade"],"summary":"Get Continent Trade","description":"Get trade by continent","operationId":"get_continent_trade_trade_continent_trade_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"hs_code","in":"query","required":false,"schema":{"type":"string","description":"HS product code","default":"1","title":"Hs Code"},"description":"HS product code"},{"name":"year","in":"query","required":false,"schema":{"type":"integer","default":2023,"title":"Year"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/trade/health":{"get":{"tags":["trade"],"summary":"Health Check","description":"Health check for trade analytics API","operationId":"health_check_trade_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/data/info":{"get":{"tags":["quantlib-free"],"summary":"Data Module Info","description":"Data module information","operationId":"data_module_info_quantlib_data_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/data/get-index":{"post":{"tags":["quantlib-free"],"summary":"Get Index Endpoint","operationId":"get_index_endpoint_quantlib_data_get_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-ibor-index":{"post":{"tags":["quantlib-free"],"summary":"Create Ibor Index","operationId":"create_ibor_index_quantlib_data_create_ibor_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBORIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-rfr-index":{"post":{"tags":["quantlib-free"],"summary":"Create Rfr Index","operationId":"create_rfr_index_quantlib_data_create_rfr_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RFRIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-fx-index":{"post":{"tags":["quantlib-free"],"summary":"Create Fx Index","operationId":"create_fx_index_quantlib_data_create_fx_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-inflation-index":{"post":{"tags":["quantlib-free"],"summary":"Create Inflation Index","operationId":"create_inflation_index_quantlib_data_create_inflation_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/sofr":{"get":{"tags":["quantlib-free"],"summary":"Get Sofr Index","operationId":"get_sofr_index_quantlib_data_sofr_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/sonia":{"get":{"tags":["quantlib-free"],"summary":"Get Sonia Index","operationId":"get_sonia_index_quantlib_data_sonia_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/estr":{"get":{"tags":["quantlib-free"],"summary":"Get Estr Index","operationId":"get_estr_index_quantlib_data_estr_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/tonar":{"get":{"tags":["quantlib-free"],"summary":"Get Tonar Index","operationId":"get_tonar_index_quantlib_data_tonar_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/term-sofr":{"get":{"tags":["quantlib-free"],"summary":"Get Term Sofr Index","operationId":"get_term_sofr_index_quantlib_data_term_sofr_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/euribor":{"get":{"tags":["quantlib-free"],"summary":"Get Euribor Index","operationId":"get_euribor_index_quantlib_data_euribor_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-ibor-fixing":{"post":{"tags":["quantlib-free"],"summary":"Create Ibor Fixing","operationId":"create_ibor_fixing_quantlib_data_create_ibor_fixing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IBORFixingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-rfr-fixing":{"post":{"tags":["quantlib-free"],"summary":"Create Rfr Fixing","operationId":"create_rfr_fixing_quantlib_data_create_rfr_fixing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RFRFixingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-fx-fixing":{"post":{"tags":["quantlib-free"],"summary":"Create Fx Fixing","operationId":"create_fx_fixing_quantlib_data_create_fx_fixing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXFixingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-inflation-fixing":{"post":{"tags":["quantlib-free"],"summary":"Create Inflation Fixing","operationId":"create_inflation_fixing_quantlib_data_create_inflation_fixing_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationFixingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/create-fixing-store":{"post":{"tags":["quantlib-free"],"summary":"Create Fixing Store","operationId":"create_fixing_store_quantlib_data_create_fixing_store_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/fixing-error-types":{"get":{"tags":["quantlib-free"],"summary":"Get Fixing Error Types","operationId":"get_fixing_error_types_quantlib_data_fixing_error_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/fixing-types":{"get":{"tags":["quantlib-free"],"summary":"Get Fixing Types","operationId":"get_fixing_types_quantlib_data_fixing_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/fixings-module":{"get":{"tags":["quantlib-free"],"summary":"Get Fixings Module","operationId":"get_fixings_module_quantlib_data_fixings_module_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/data/indices-module":{"get":{"tags":["quantlib-free"],"summary":"Get Indices Module","operationId":"get_indices_module_quantlib_data_indices_module_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/info":{"get":{"tags":["quantlib-free"],"summary":"Scheduling Module Info","description":"Scheduling module information","operationId":"scheduling_module_info_quantlib_scheduling_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/scheduling/actual360":{"post":{"tags":["quantlib-free"],"summary":"Actual360","operationId":"actual360_quantlib_scheduling_actual360_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/actual365fixed":{"post":{"tags":["quantlib-free"],"summary":"Actual365Fixed","operationId":"actual365fixed_quantlib_scheduling_actual365fixed_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/actual365actual":{"post":{"tags":["quantlib-free"],"summary":"Actual365Actual","operationId":"actual365actual_quantlib_scheduling_actual365actual_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/actualactualisda":{"post":{"tags":["quantlib-free"],"summary":"Actualactualisda","operationId":"actualactualisda_quantlib_scheduling_actualactualisda_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirty360":{"post":{"tags":["quantlib-free"],"summary":"Thirty360","operationId":"thirty360_quantlib_scheduling_thirty360_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirty360european":{"post":{"tags":["quantlib-free"],"summary":"Thirty360European","operationId":"thirty360european_quantlib_scheduling_thirty360european_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirtye360":{"post":{"tags":["quantlib-free"],"summary":"Thirtye360","operationId":"thirtye360_quantlib_scheduling_thirtye360_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirtye360isda":{"post":{"tags":["quantlib-free"],"summary":"Thirtye360Isda","operationId":"thirtye360isda_quantlib_scheduling_thirtye360isda_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/business252":{"post":{"tags":["quantlib-free"],"summary":"Business252","operationId":"business252_quantlib_scheduling_business252_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/year-fraction":{"post":{"tags":["quantlib-free"],"summary":"Year Fraction Endpoint","operationId":"year_fraction_endpoint_quantlib_scheduling_year_fraction_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YearFractionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/target-calendar":{"post":{"tags":["quantlib-free"],"summary":"Target Calendar","operationId":"target_calendar_quantlib_scheduling_target_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/us-calendar":{"post":{"tags":["quantlib-free"],"summary":"Us Calendar","operationId":"us_calendar_quantlib_scheduling_us_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/uk-calendar":{"post":{"tags":["quantlib-free"],"summary":"Uk Calendar","operationId":"uk_calendar_quantlib_scheduling_uk_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/japan-calendar":{"post":{"tags":["quantlib-free"],"summary":"Japan Calendar","operationId":"japan_calendar_quantlib_scheduling_japan_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/get-calendar":{"post":{"tags":["quantlib-free"],"summary":"Get Calendar Endpoint","operationId":"get_calendar_endpoint_quantlib_scheduling_get_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/combined-calendar":{"post":{"tags":["quantlib-free"],"summary":"Combined Calendar","operationId":"combined_calendar_quantlib_scheduling_combined_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CombinedCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/weekend-calendar":{"post":{"tags":["quantlib-free"],"summary":"Weekend Calendar","operationId":"weekend_calendar_quantlib_scheduling_weekend_calendar_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/following":{"post":{"tags":["quantlib-free"],"summary":"Following","operationId":"following_quantlib_scheduling_following_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/modified-following":{"post":{"tags":["quantlib-free"],"summary":"Modified Following","operationId":"modified_following_quantlib_scheduling_modified_following_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/preceding":{"post":{"tags":["quantlib-free"],"summary":"Preceding","operationId":"preceding_quantlib_scheduling_preceding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/modified-preceding":{"post":{"tags":["quantlib-free"],"summary":"Modified Preceding","operationId":"modified_preceding_quantlib_scheduling_modified_preceding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/unadjusted":{"post":{"tags":["quantlib-free"],"summary":"Unadjusted","operationId":"unadjusted_quantlib_scheduling_unadjusted_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnadjustedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/business-day-adjustment":{"post":{"tags":["quantlib-free"],"summary":"Business Day Adjustment Endpoint","operationId":"business_day_adjustment_endpoint_quantlib_scheduling_business_day_adjustment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessDayAdjustmentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/generate-schedule":{"post":{"tags":["quantlib-free"],"summary":"Generate Schedule","operationId":"generate_schedule_quantlib_scheduling_generate_schedule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-annual":{"get":{"tags":["quantlib-free"],"summary":"Frequency Annual","operationId":"frequency_annual_quantlib_scheduling_frequency_annual_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-semiannual":{"get":{"tags":["quantlib-free"],"summary":"Frequency Semiannual","operationId":"frequency_semiannual_quantlib_scheduling_frequency_semiannual_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-quarterly":{"get":{"tags":["quantlib-free"],"summary":"Frequency Quarterly","operationId":"frequency_quarterly_quantlib_scheduling_frequency_quarterly_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-monthly":{"get":{"tags":["quantlib-free"],"summary":"Frequency Monthly","operationId":"frequency_monthly_quantlib_scheduling_frequency_monthly_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-weekly":{"get":{"tags":["quantlib-free"],"summary":"Frequency Weekly","operationId":"frequency_weekly_quantlib_scheduling_frequency_weekly_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-daily":{"get":{"tags":["quantlib-free"],"summary":"Frequency Daily","operationId":"frequency_daily_quantlib_scheduling_frequency_daily_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/frequency-once":{"get":{"tags":["quantlib-free"],"summary":"Frequency Once","operationId":"frequency_once_quantlib_scheduling_frequency_once_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/stub-types":{"get":{"tags":["quantlib-free"],"summary":"Stub Types","operationId":"stub_types_quantlib_scheduling_stub_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/adjustment-types":{"get":{"tags":["quantlib-free"],"summary":"Adjustment Types","operationId":"adjustment_types_quantlib_scheduling_adjustment_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/adjust-date":{"post":{"tags":["quantlib-free"],"summary":"Adjust Date Endpoint","description":"Adjust a date according to business day convention","operationId":"adjust_date_endpoint_quantlib_scheduling_adjust_date_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/day-count-convention-info":{"get":{"tags":["quantlib-free"],"summary":"Get Day Count Convention Info","description":"Get documentation for DayCountConvention base class","operationId":"get_day_count_convention_info_quantlib_scheduling_day_count_convention_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/utils/info":{"get":{"tags":["quantlib-free"],"summary":"Utils Module Info","description":"Utils module information","operationId":"utils_module_info_quantlib_utils_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/utils/add-business-days":{"post":{"tags":["quantlib-free"],"summary":"Add Business Days Util","operationId":"add_business_days_util_quantlib_utils_add_business_days_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AddBusinessDaysRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/imm-date/{year}/{month}":{"get":{"tags":["quantlib-free"],"summary":"Imm Date Util","operationId":"imm_date_util_quantlib_utils_imm_date__year___month__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","title":"Year"}},{"name":"month","in":"path","required":true,"schema":{"type":"integer","title":"Month"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quantlib/utils/easter-date/{year}":{"get":{"tags":["quantlib-free"],"summary":"Easter Date Util","operationId":"easter_date_util_quantlib_utils_easter_date__year__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","title":"Year"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quantlib/utils/cubic-spline":{"post":{"tags":["quantlib-free"],"summary":"Cubic Spline Util","operationId":"cubic_spline_util_quantlib_utils_cubic_spline_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterpolationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/brent":{"post":{"tags":["quantlib-free"],"summary":"Brent Util","operationId":"brent_util_quantlib_utils_brent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolverUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/bisection":{"post":{"tags":["quantlib-free"],"summary":"Bisection Util","operationId":"bisection_util_quantlib_utils_bisection_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SolverUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/cholesky":{"post":{"tags":["quantlib-free"],"summary":"Cholesky Util","operationId":"cholesky_util_quantlib_utils_cholesky_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/eigenvalues":{"post":{"tags":["quantlib-free"],"summary":"Eigenvalues Util","operationId":"eigenvalues_util_quantlib_utils_eigenvalues_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/svd":{"post":{"tags":["quantlib-free"],"summary":"Svd Util","operationId":"svd_util_quantlib_utils_svd_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SVDRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/inverse-matrix":{"post":{"tags":["quantlib-free"],"summary":"Inverse Matrix Util","operationId":"inverse_matrix_util_quantlib_utils_inverse_matrix_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InverseMatrixRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/determinant":{"post":{"tags":["quantlib-free"],"summary":"Determinant Util","operationId":"determinant_util_quantlib_utils_determinant_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeterminantRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/newton-raphson":{"post":{"tags":["quantlib-free"],"summary":"Newton Raphson Util","operationId":"newton_raphson_util_quantlib_utils_newton_raphson_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__NewtonRaphsonRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/secant-method":{"post":{"tags":["quantlib-free"],"summary":"Secant Method Util","operationId":"secant_method_util_quantlib_utils_secant_method_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecantMethodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/linear-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Linear Interpolation Util","operationId":"linear_interpolation_util_quantlib_utils_linear_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinearInterpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/log-linear-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Log Linear Interpolation Util","operationId":"log_linear_interpolation_util_quantlib_utils_log_linear_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogLinearInterpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/hermite-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Hermite Interpolation Util","operationId":"hermite_interpolation_util_quantlib_utils_hermite_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HermiteInterpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/dot-product":{"post":{"tags":["quantlib-free"],"summary":"Dot Product Util","operationId":"dot_product_util_quantlib_utils_dot_product_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorDotProductRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/cross-product":{"post":{"tags":["quantlib-free"],"summary":"Cross Product Util","operationId":"cross_product_util_quantlib_utils_cross_product_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorCrossProductRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/vector-norm":{"post":{"tags":["quantlib-free"],"summary":"Vector Norm Util","operationId":"vector_norm_util_quantlib_utils_vector_norm_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorNormRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-end-of-month":{"post":{"tags":["quantlib-free"],"summary":"Is End Of Month Util","operationId":"is_end_of_month_util_quantlib_utils_is_end_of_month_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-quarter-end":{"post":{"tags":["quantlib-free"],"summary":"Is Quarter End Util","operationId":"is_quarter_end_util_quantlib_utils_is_quarter_end_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-year-end":{"post":{"tags":["quantlib-free"],"summary":"Is Year End Util","operationId":"is_year_end_util_quantlib_utils_is_year_end_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/australia-calendar":{"post":{"tags":["quantlib-free"],"summary":"Australia Calendar Util","operationId":"australia_calendar_util_quantlib_utils_australia_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AustraliaCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/brazil-calendar":{"post":{"tags":["quantlib-free"],"summary":"Brazil Calendar Util","operationId":"brazil_calendar_util_quantlib_utils_brazil_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrazilCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/china-calendar":{"post":{"tags":["quantlib-free"],"summary":"China Calendar Util","operationId":"china_calendar_util_quantlib_utils_china_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChinaCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/india-calendar":{"post":{"tags":["quantlib-free"],"summary":"India Calendar Util","operationId":"india_calendar_util_quantlib_utils_india_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndiaCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/switzerland-calendar":{"post":{"tags":["quantlib-free"],"summary":"Switzerland Calendar Util","operationId":"switzerland_calendar_util_quantlib_utils_switzerland_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwitzerlandCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/canada-calendar":{"post":{"tags":["quantlib-free"],"summary":"Canada Calendar Util","operationId":"canada_calendar_util_quantlib_utils_canada_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanadaCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/germany-calendar":{"post":{"tags":["quantlib-free"],"summary":"Germany Calendar Util","operationId":"germany_calendar_util_quantlib_utils_germany_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GermanyCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/france-calendar":{"post":{"tags":["quantlib-free"],"summary":"France Calendar Util","operationId":"france_calendar_util_quantlib_utils_france_calendar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FranceCalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/adjust-date":{"post":{"tags":["quantlib-free"],"summary":"Adjust Date Util","operationId":"adjust_date_util_quantlib_utils_adjust_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdjustDateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/advance-date":{"post":{"tags":["quantlib-free"],"summary":"Advance Date Util","operationId":"advance_date_util_quantlib_utils_advance_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvanceDateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/business-days-between":{"post":{"tags":["quantlib-free"],"summary":"Business Days Between Util","operationId":"business_days_between_util_quantlib_utils_business_days_between_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessDaysBetweenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/mean":{"post":{"tags":["quantlib-free"],"summary":"Mean Util","operationId":"mean_util_quantlib_utils_mean_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/variance":{"post":{"tags":["quantlib-free"],"summary":"Variance Util","operationId":"variance_util_quantlib_utils_variance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VarianceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/standard-deviation":{"post":{"tags":["quantlib-free"],"summary":"Standard Deviation Util","operationId":"standard_deviation_util_quantlib_utils_standard_deviation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StandardDeviationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/correlation":{"post":{"tags":["quantlib-free"],"summary":"Correlation Util","operationId":"correlation_util_quantlib_utils_correlation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CorrelationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/backward-flat-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Backward Flat Interpolation Util","operationId":"backward_flat_interpolation_util_quantlib_utils_backward_flat_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackwardFlatInterpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/forward-flat-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Forward Flat Interpolation Util","operationId":"forward_flat_interpolation_util_quantlib_utils_forward_flat_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardFlatInterpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/uniform-random":{"post":{"tags":["quantlib-free"],"summary":"Uniform Random Util","operationId":"uniform_random_util_quantlib_utils_uniform_random_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UniformRandomRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/normal-random":{"post":{"tags":["quantlib-free"],"summary":"Normal Random Util","operationId":"normal_random_util_quantlib_utils_normal_random_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NormalRandomRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/create-currency":{"post":{"tags":["quantlib-free"],"summary":"Create Currency Util","operationId":"create_currency_util_quantlib_utils_create_currency_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrencyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/create-money":{"post":{"tags":["quantlib-free"],"summary":"Create Money Util","operationId":"create_money_util_quantlib_utils_create_money_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MoneyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/forward-difference":{"post":{"tags":["quantlib-free"],"summary":"Forward Difference Util","operationId":"forward_difference_util_quantlib_utils_forward_difference_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumericalDerivativeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/backward-difference":{"post":{"tags":["quantlib-free"],"summary":"Backward Difference Util","operationId":"backward_difference_util_quantlib_utils_backward_difference_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumericalDerivativeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/central-difference":{"post":{"tags":["quantlib-free"],"summary":"Central Difference Util","operationId":"central_difference_util_quantlib_utils_central_difference_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NumericalDerivativeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/finite-difference":{"post":{"tags":["quantlib-free"],"summary":"Finite Difference Util","operationId":"finite_difference_util_quantlib_utils_finite_difference_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FiniteDifferenceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/trapezoid-rule":{"post":{"tags":["quantlib-free"],"summary":"Trapezoid Rule Util","operationId":"trapezoid_rule_util_quantlib_utils_trapezoid_rule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/simpson-rule":{"post":{"tags":["quantlib-free"],"summary":"Simpson Rule Util","operationId":"simpson_rule_util_quantlib_utils_simpson_rule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/gaussian-quadrature":{"post":{"tags":["quantlib-free"],"summary":"Gaussian Quadrature Util","operationId":"gaussian_quadrature_util_quantlib_utils_gaussian_quadrature_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/matrix-multiply":{"post":{"tags":["quantlib-free"],"summary":"Matrix Multiply Util","operationId":"matrix_multiply_util_quantlib_utils_matrix_multiply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixMultiplyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/matrix-transpose":{"post":{"tags":["quantlib-free"],"summary":"Matrix Transpose Util","operationId":"matrix_transpose_util_quantlib_utils_matrix_transpose_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/lu-decomposition":{"post":{"tags":["quantlib-free"],"summary":"Lu Decomposition Util","operationId":"lu_decomposition_util_quantlib_utils_lu_decomposition_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/qr-decomposition":{"post":{"tags":["quantlib-free"],"summary":"Qr Decomposition Util","operationId":"qr_decomposition_util_quantlib_utils_qr_decomposition_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/nelder-mead":{"post":{"tags":["quantlib-free"],"summary":"Nelder Mead Util","operationId":"nelder_mead_util_quantlib_utils_nelder_mead_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/powell-method":{"post":{"tags":["quantlib-free"],"summary":"Powell Method Util","operationId":"powell_method_util_quantlib_utils_powell_method_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/golden-section-search":{"post":{"tags":["quantlib-free"],"summary":"Golden Section Search Util","operationId":"golden_section_search_util_quantlib_utils_golden_section_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoldenSectionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/monotone-convex-interpolation":{"post":{"tags":["quantlib-free"],"summary":"Monotone Convex Interpolation Util","operationId":"monotone_convex_interpolation_util_quantlib_utils_monotone_convex_interpolation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterpolationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/extrapolate-flat":{"post":{"tags":["quantlib-free"],"summary":"Extrapolate Flat Util","operationId":"extrapolate_flat_util_quantlib_utils_extrapolate_flat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtrapolationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/eigenvectors":{"post":{"tags":["quantlib-free"],"summary":"Eigenvectors Util","operationId":"eigenvectors_util_quantlib_utils_eigenvectors_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatrixUtilRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/normalize-vector":{"post":{"tags":["quantlib-free"],"summary":"Normalize Vector Util","operationId":"normalize_vector_util_quantlib_utils_normalize_vector_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorNormRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/solve-linear-system":{"post":{"tags":["quantlib-free"],"summary":"Solve Linear System Util","operationId":"solve_linear_system_util_quantlib_utils_solve_linear_system_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LinearSystemRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/nth-weekday":{"post":{"tags":["quantlib-free"],"summary":"Nth Weekday Util","operationId":"nth_weekday_util_quantlib_utils_nth_weekday_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NthWeekdayRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-weekend":{"post":{"tags":["quantlib-free"],"summary":"Is Weekend Util","operationId":"is_weekend_util_quantlib_utils_is_weekend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-month-end":{"post":{"tags":["quantlib-free"],"summary":"Is Month End Util","operationId":"is_month_end_util_quantlib_utils_is_month_end_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-imm-date":{"post":{"tags":["quantlib-free"],"summary":"Is Imm Date Util","operationId":"is_imm_date_util_quantlib_utils_is_imm_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IMMDateCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/next-imm-date":{"post":{"tags":["quantlib-free"],"summary":"Next Imm Date Util","operationId":"next_imm_date_util_quantlib_utils_next_imm_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NextIMMDateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/extrapolate-linear":{"post":{"tags":["quantlib-free"],"summary":"Extrapolate Linear Util","operationId":"extrapolate_linear_util_quantlib_utils_extrapolate_linear_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtrapolateLinearRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/find-interval":{"post":{"tags":["quantlib-free"],"summary":"Find Interval Util","operationId":"find_interval_util_quantlib_utils_find_interval_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindIntervalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-currency":{"post":{"tags":["quantlib-free"],"summary":"Validate Currency Util","operationId":"validate_currency_util_quantlib_utils_validate_currency_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateCurrencyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-date-order":{"post":{"tags":["quantlib-free"],"summary":"Validate Date Order Util","operationId":"validate_date_order_util_quantlib_utils_validate_date_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_core__ValidateDateOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-positive":{"post":{"tags":["quantlib-free"],"summary":"Validate Positive Util","operationId":"validate_positive_util_quantlib_utils_validate_positive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidatePositiveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-probability":{"post":{"tags":["quantlib-free"],"summary":"Validate Probability Util","operationId":"validate_probability_util_quantlib_utils_validate_probability_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateProbabilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-rate":{"post":{"tags":["quantlib-free"],"summary":"Validate Rate Util","operationId":"validate_rate_util_quantlib_utils_validate_rate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/validate-tenor":{"post":{"tags":["quantlib-free"],"summary":"Validate Tenor Util","operationId":"validate_tenor_util_quantlib_utils_validate_tenor_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateTenorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-scalar":{"post":{"tags":["quantlib-free"],"summary":"Is Scalar Util","operationId":"is_scalar_util_quantlib_utils_is_scalar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypeCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-vector":{"post":{"tags":["quantlib-free"],"summary":"Is Vector Util","operationId":"is_vector_util_quantlib_utils_is_vector_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypeCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/is-matrix":{"post":{"tags":["quantlib-free"],"summary":"Is Matrix Util","operationId":"is_matrix_util_quantlib_utils_is_matrix_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TypeCheckRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/coerce-to-float":{"post":{"tags":["quantlib-free"],"summary":"Coerce To Float Util","operationId":"coerce_to_float_util_quantlib_utils_coerce_to_float_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoerceFloatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirty360-european":{"post":{"tags":["quantlib-free"],"summary":"Thirty360 European Daycount","operationId":"thirty360_european_daycount_quantlib_scheduling_thirty360_european_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/scheduling/thirtye360-daycount":{"post":{"tags":["quantlib-free"],"summary":"Thirtye360 Daycount","operationId":"thirtye360_daycount_quantlib_scheduling_thirtye360_daycount_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__DayCountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/canada-calendar-check":{"post":{"tags":["quantlib-free"],"summary":"Canada Calendar Check","operationId":"canada_calendar_check_quantlib_utils_canada_calendar_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/japan-calendar-check":{"post":{"tags":["quantlib-free"],"summary":"Japan Calendar Check","operationId":"japan_calendar_check_quantlib_utils_japan_calendar_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/switzerland-calendar-check":{"post":{"tags":["quantlib-free"],"summary":"Switzerland Calendar Check","operationId":"switzerland_calendar_check_quantlib_utils_switzerland_calendar_check_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_utils__CalendarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/debug-print":{"post":{"tags":["quantlib-free"],"summary":"Debug Print Util","operationId":"debug_print_util_quantlib_utils_debug_print_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LogMessageRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/get-logger/{name}":{"get":{"tags":["quantlib-free"],"summary":"Get Logger Util","operationId":"get_logger_util_quantlib_utils_get_logger__name__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quantlib/utils/log-function-call":{"post":{"tags":["quantlib-free"],"summary":"Log Function Call Util","operationId":"log_function_call_util_quantlib_utils_log_function_call_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FunctionCallLogRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/log-execution-time":{"post":{"tags":["quantlib-free"],"summary":"Log Execution Time Util","operationId":"log_execution_time_util_quantlib_utils_log_execution_time_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecutionTimeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/memory-usage":{"get":{"tags":["quantlib-free"],"summary":"Memory Usage Util","operationId":"memory_usage_util_quantlib_utils_memory_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/profile-function":{"post":{"tags":["quantlib-free"],"summary":"Profile Function Util","operationId":"profile_function_util_quantlib_utils_profile_function_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileFunctionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/coerce-to-list":{"post":{"tags":["quantlib-free"],"summary":"Coerce To List Util","operationId":"coerce_to_list_util_quantlib_utils_coerce_to_list_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoerceToListRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/matrix-inverse":{"post":{"tags":["quantlib-free"],"summary":"Matrix Inverse Endpoint","description":"Calculate matrix inverse","operationId":"matrix_inverse_endpoint_quantlib_utils_matrix_inverse_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/newton-method":{"post":{"tags":["quantlib-free"],"summary":"Newton Method Endpoint","description":"Solve equation using Newton's method","operationId":"newton_method_endpoint_quantlib_utils_newton_method_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/utils/svd-decomposition":{"post":{"tags":["quantlib-free"],"summary":"Svd Decomposition Endpoint","description":"Calculate singular value decomposition","operationId":"svd_decomposition_endpoint_quantlib_utils_svd_decomposition_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/info":{"get":{"tags":["quantlib-starter"],"summary":"Curves Module Info","description":"Curves module information","operationId":"curves_module_info_quantlib_curves_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/curves/create-discount-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Discount Curve","operationId":"create_discount_curve_quantlib_curves_create_discount_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-forward-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Forward Curve","operationId":"create_forward_curve_quantlib_curves_create_forward_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-zero-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Zero Curve","operationId":"create_zero_curve_quantlib_curves_create_zero_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-inflation-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Inflation Curve","operationId":"create_inflation_curve_quantlib_curves_create_inflation_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-real-rate-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Real Rate Curve","operationId":"create_real_rate_curve_quantlib_curves_create_real_rate_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-ois-discount-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Ois Discount Curve","operationId":"create_ois_discount_curve_quantlib_curves_create_ois_discount_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-ibor-projection-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Ibor Projection Curve","operationId":"create_ibor_projection_curve_quantlib_curves_create_ibor_projection_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-cross-currency-basis-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Cross Currency Basis Curve","operationId":"create_cross_currency_basis_curve_quantlib_curves_create_cross_currency_basis_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-composite-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Composite Curve","operationId":"create_composite_curve_quantlib_curves_create_composite_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-proxy-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Proxy Curve","operationId":"create_proxy_curve_quantlib_curves_create_proxy_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-scaled-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Scaled Curve","operationId":"create_scaled_curve_quantlib_curves_create_scaled_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/linear":{"post":{"tags":["quantlib-starter"],"summary":"Create Linear Interpolator","operationId":"create_linear_interpolator_quantlib_curves_interpolator_linear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/log-linear":{"post":{"tags":["quantlib-starter"],"summary":"Create Log Linear Interpolator","operationId":"create_log_linear_interpolator_quantlib_curves_interpolator_log_linear_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/cubic-spline":{"post":{"tags":["quantlib-starter"],"summary":"Create Cubic Spline Interpolator","operationId":"create_cubic_spline_interpolator_quantlib_curves_interpolator_cubic_spline_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/monotone-convex":{"post":{"tags":["quantlib-starter"],"summary":"Create Monotone Convex Interpolator","operationId":"create_monotone_convex_interpolator_quantlib_curves_interpolator_monotone_convex_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/flat-forward":{"post":{"tags":["quantlib-starter"],"summary":"Create Flat Forward Interpolator","operationId":"create_flat_forward_interpolator_quantlib_curves_interpolator_flat_forward_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/interpolator/flat-backward":{"post":{"tags":["quantlib-starter"],"summary":"Create Flat Backward Interpolator","operationId":"create_flat_backward_interpolator_quantlib_curves_interpolator_flat_backward_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-nelson-siegel":{"post":{"tags":["quantlib-starter"],"summary":"Create Nelson Siegel Curve","operationId":"create_nelson_siegel_curve_quantlib_curves_create_nelson_siegel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NelsonSiegelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-nelson-siegel-svensson":{"post":{"tags":["quantlib-starter"],"summary":"Create Nelson Siegel Svensson Curve","operationId":"create_nelson_siegel_svensson_curve_quantlib_curves_create_nelson_siegel_svensson_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NelsonSiegelSvenssonRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/operations/parallel-shift":{"post":{"tags":["quantlib-starter"],"summary":"Parallel Shift Curve","operationId":"parallel_shift_curve_quantlib_curves_operations_parallel_shift_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/operations/twist":{"post":{"tags":["quantlib-starter"],"summary":"Twist Curve Endpoint","operationId":"twist_curve_endpoint_quantlib_curves_operations_twist_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwistCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/operations/butterfly-shift":{"post":{"tags":["quantlib-starter"],"summary":"Butterfly Shift Endpoint","operationId":"butterfly_shift_endpoint_quantlib_curves_operations_butterfly_shift_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/operations/key-rate-shift":{"post":{"tags":["quantlib-starter"],"summary":"Key Rate Shift Endpoint","operationId":"key_rate_shift_endpoint_quantlib_curves_operations_key_rate_shift_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRateShiftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/operations/roll":{"post":{"tags":["quantlib-starter"],"summary":"Roll Curve Endpoint","operationId":"roll_curve_endpoint_quantlib_curves_operations_roll_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-shifted-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Shifted Curve","operationId":"create_shifted_curve_quantlib_curves_create_shifted_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-twisted-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Twisted Curve","operationId":"create_twisted_curve_quantlib_curves_create_twisted_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwistCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-butterfly-shifted-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Butterfly Shifted Curve","operationId":"create_butterfly_shifted_curve_quantlib_curves_create_butterfly_shifted_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShiftCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-key-rate-shifted-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Key Rate Shifted Curve","operationId":"create_key_rate_shifted_curve_quantlib_curves_create_key_rate_shifted_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRateShiftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-time-shifted-curve":{"post":{"tags":["quantlib-starter"],"summary":"Create Time Shifted Curve","operationId":"create_time_shifted_curve_quantlib_curves_create_time_shifted_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-multicurve-framework":{"post":{"tags":["quantlib-starter"],"summary":"Create Multicurve Framework","operationId":"create_multicurve_framework_quantlib_curves_create_multicurve_framework_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MulticurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/bootstrap-inflation":{"post":{"tags":["quantlib-starter"],"summary":"Bootstrap Inflation Curve Endpoint","operationId":"bootstrap_inflation_curve_endpoint_quantlib_curves_bootstrap_inflation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapInflationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/calibrate-multicurve":{"post":{"tags":["quantlib-starter"],"summary":"Calibrate Multicurve Endpoint","operationId":"calibrate_multicurve_endpoint_quantlib_curves_calibrate_multicurve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrateMulticurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-curve-database":{"post":{"tags":["quantlib-starter"],"summary":"Create Curve Database","operationId":"create_curve_database_quantlib_curves_create_curve_database_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-curve-set":{"post":{"tags":["quantlib-starter"],"summary":"Create Curve Set","operationId":"create_curve_set_quantlib_curves_create_curve_set_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-curve-version":{"post":{"tags":["quantlib-starter"],"summary":"Create Curve Version","operationId":"create_curve_version_quantlib_curves_create_curve_version_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-curve-wrapper":{"post":{"tags":["quantlib-starter"],"summary":"Create Curve Wrapper","operationId":"create_curve_wrapper_quantlib_curves_create_curve_wrapper_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-incremental-updater":{"post":{"tags":["quantlib-starter"],"summary":"Create Incremental Updater","operationId":"create_incremental_updater_quantlib_curves_create_incremental_updater_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-curve-constraints":{"post":{"tags":["quantlib-starter"],"summary":"Create Curve Constraints","operationId":"create_curve_constraints_quantlib_curves_create_curve_constraints_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-monotonicity-constraint":{"post":{"tags":["quantlib-starter"],"summary":"Create Monotonicity Constraint","operationId":"create_monotonicity_constraint_quantlib_curves_create_monotonicity_constraint_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-smoothness-constraint":{"post":{"tags":["quantlib-starter"],"summary":"Create Smoothness Constraint","operationId":"create_smoothness_constraint_quantlib_curves_create_smoothness_constraint_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-constrained-fitter":{"post":{"tags":["quantlib-starter"],"summary":"Create Constrained Fitter","operationId":"create_constrained_fitter_quantlib_curves_create_constrained_fitter_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-inflation-seasonality":{"post":{"tags":["quantlib-starter"],"summary":"Create Inflation Seasonality","operationId":"create_inflation_seasonality_quantlib_curves_create_inflation_seasonality_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/create-seasonality-model":{"post":{"tags":["quantlib-starter"],"summary":"Create Seasonality Model","operationId":"create_seasonality_model_quantlib_curves_create_seasonality_model_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/base/curve":{"get":{"tags":["quantlib-starter"],"summary":"Get Curve Base Class","operationId":"get_curve_base_class_quantlib_curves_base_curve_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/base/interpolator":{"get":{"tags":["quantlib-starter"],"summary":"Get Interpolator Base Class","operationId":"get_interpolator_base_class_quantlib_curves_base_interpolator_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/enums/shift-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Shift Types","operationId":"get_shift_types_quantlib_curves_enums_shift_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/enums/shift-spaces":{"get":{"tags":["quantlib-starter"],"summary":"Get Shift Spaces","operationId":"get_shift_spaces_quantlib_curves_enums_shift_spaces_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/curve":{"get":{"tags":["quantlib-starter"],"summary":"Get Curve Module","operationId":"get_curve_module_quantlib_curves_submodules_curve_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/interpolation":{"get":{"tags":["quantlib-starter"],"summary":"Get Interpolation Module","operationId":"get_interpolation_module_quantlib_curves_submodules_interpolation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/operations":{"get":{"tags":["quantlib-starter"],"summary":"Get Operations Module","operationId":"get_operations_module_quantlib_curves_submodules_operations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/inflation":{"get":{"tags":["quantlib-starter"],"summary":"Get Inflation Module","operationId":"get_inflation_module_quantlib_curves_submodules_inflation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/multicurve":{"get":{"tags":["quantlib-starter"],"summary":"Get Multicurve Module","operationId":"get_multicurve_module_quantlib_curves_submodules_multicurve_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/parametric":{"get":{"tags":["quantlib-starter"],"summary":"Get Parametric Module","operationId":"get_parametric_module_quantlib_curves_submodules_parametric_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/curves/submodules/advanced":{"get":{"tags":["quantlib-starter"],"summary":"Get Advanced Module","operationId":"get_advanced_module_quantlib_curves_submodules_advanced_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/info":{"get":{"tags":["quantlib-starter"],"summary":"Core Module Info","description":"Core module information","operationId":"core_module_info_quantlib_core_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/create-currency":{"post":{"tags":["quantlib-starter"],"summary":"Create Currency","operationId":"create_currency_quantlib_core_create_currency_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCurrencyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-money":{"post":{"tags":["quantlib-starter"],"summary":"Create Money","operationId":"create_money_quantlib_core_create_money_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMoneyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-rate":{"post":{"tags":["quantlib-starter"],"summary":"Create Rate","operationId":"create_rate_quantlib_core_create_rate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-spread":{"post":{"tags":["quantlib-starter"],"summary":"Create Spread","operationId":"create_spread_quantlib_core_create_spread_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSpreadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/currency-decimals/{code}":{"get":{"tags":["quantlib-starter"],"summary":"Get Currency Decimals","operationId":"get_currency_decimals_quantlib_core_currency_decimals__code__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/quantlib/core/create-tenor":{"post":{"tags":["quantlib-starter"],"summary":"Create Tenor","operationId":"create_tenor_quantlib_core_create_tenor_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/date-to-excel":{"post":{"tags":["quantlib-starter"],"summary":"Date To Excel","operationId":"date_to_excel_quantlib_core_date_to_excel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DateToExcelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/to-date":{"post":{"tags":["quantlib-starter"],"summary":"To Date Endpoint","operationId":"to_date_endpoint_quantlib_core_to_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToDateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/as-currency":{"post":{"tags":["quantlib-starter"],"summary":"As Currency","operationId":"as_currency_quantlib_core_as_currency_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsCurrencyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/as-money":{"post":{"tags":["quantlib-starter"],"summary":"As Money","operationId":"as_money_quantlib_core_as_money_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMoneyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/as-rate":{"post":{"tags":["quantlib-starter"],"summary":"As Rate","operationId":"as_rate_quantlib_core_as_rate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/as-tenor":{"post":{"tags":["quantlib-starter"],"summary":"As Tenor","operationId":"as_tenor_quantlib_core_as_tenor_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTenorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/as-date":{"post":{"tags":["quantlib-starter"],"summary":"As Date","operationId":"as_date_quantlib_core_as_date_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToDateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/exp":{"post":{"tags":["quantlib-starter"],"summary":"Math Exp","operationId":"math_exp_quantlib_core_math_exp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/log":{"post":{"tags":["quantlib-starter"],"summary":"Math Log","operationId":"math_log_quantlib_core_math_log_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/sqrt":{"post":{"tags":["quantlib-starter"],"summary":"Math Sqrt","operationId":"math_sqrt_quantlib_core_math_sqrt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/sin":{"post":{"tags":["quantlib-starter"],"summary":"Math Sin","operationId":"math_sin_quantlib_core_math_sin_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/cos":{"post":{"tags":["quantlib-starter"],"summary":"Math Cos","operationId":"math_cos_quantlib_core_math_cos_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/tan":{"post":{"tags":["quantlib-starter"],"summary":"Math Tan","operationId":"math_tan_quantlib_core_math_tan_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/sinh":{"post":{"tags":["quantlib-starter"],"summary":"Math Sinh","operationId":"math_sinh_quantlib_core_math_sinh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/cosh":{"post":{"tags":["quantlib-starter"],"summary":"Math Cosh","operationId":"math_cosh_quantlib_core_math_cosh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/tanh":{"post":{"tags":["quantlib-starter"],"summary":"Math Tanh","operationId":"math_tanh_quantlib_core_math_tanh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MathRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/power":{"post":{"tags":["quantlib-starter"],"summary":"Math Power","operationId":"math_power_quantlib_core_math_power_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PowerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/math/taylor-expand":{"post":{"tags":["quantlib-starter"],"summary":"Taylor Expand","operationId":"taylor_expand_quantlib_core_math_taylor_expand_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaylorExpandRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/autodiff/create-dual":{"post":{"tags":["quantlib-starter"],"summary":"Create Dual","operationId":"create_dual_quantlib_core_autodiff_create_dual_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDualRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/autodiff/create-hyperdual":{"post":{"tags":["quantlib-starter"],"summary":"Create Hyperdual","operationId":"create_hyperdual_quantlib_core_autodiff_create_hyperdual_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateHyperDualRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/autodiff/gradient":{"post":{"tags":["quantlib-starter"],"summary":"Compute Gradient","operationId":"compute_gradient_quantlib_core_autodiff_gradient_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradientRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/autodiff/hessian":{"post":{"tags":["quantlib-starter"],"summary":"Compute Hessian","operationId":"compute_hessian_quantlib_core_autodiff_hessian_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradientRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/autodiff/jacobian":{"post":{"tags":["quantlib-starter"],"summary":"Compute Jacobian","operationId":"compute_jacobian_quantlib_core_autodiff_jacobian_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GradientRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/validate-date-order":{"post":{"tags":["quantlib-starter"],"summary":"Validate Date Order","operationId":"validate_date_order_quantlib_core_validate_date_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_core__ValidateDateOrderRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/validate-positive":{"post":{"tags":["quantlib-starter"],"summary":"Validate Positive","operationId":"validate_positive_quantlib_core_validate_positive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateValueRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/validate-non-negative":{"post":{"tags":["quantlib-starter"],"summary":"Validate Non Negative","operationId":"validate_non_negative_quantlib_core_validate_non_negative_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateValueRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/validate-in-range":{"post":{"tags":["quantlib-starter"],"summary":"Validate In Range","operationId":"validate_in_range_quantlib_core_validate_in_range_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateRangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-fixed-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Fixed Leg","operationId":"create_fixed_leg_quantlib_core_create_fixed_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-float-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Float Leg","operationId":"create_float_leg_quantlib_core_create_float_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-zero-coupon-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Zero Coupon Leg","operationId":"create_zero_coupon_leg_quantlib_core_create_zero_coupon_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-amortizing-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Amortizing Leg","operationId":"create_amortizing_leg_quantlib_core_create_amortizing_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-compounding-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Compounding Leg","operationId":"create_compounding_leg_quantlib_core_create_compounding_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-inflation-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Inflation Leg","operationId":"create_inflation_leg_quantlib_core_create_inflation_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-custom-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Custom Leg","operationId":"create_custom_leg_quantlib_core_create_custom_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-credit-premium-leg":{"post":{"tags":["quantlib-starter"],"summary":"Create Credit Premium Leg","operationId":"create_credit_premium_leg_quantlib_core_create_credit_premium_leg_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedLegRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-fixed-period":{"post":{"tags":["quantlib-starter"],"summary":"Create Fixed Period","operationId":"create_fixed_period_quantlib_core_create_fixed_period_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedPeriodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-float-period":{"post":{"tags":["quantlib-starter"],"summary":"Create Float Period","operationId":"create_float_period_quantlib_core_create_float_period_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedPeriodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-inflation-period":{"post":{"tags":["quantlib-starter"],"summary":"Create Inflation Period","operationId":"create_inflation_period_quantlib_core_create_inflation_period_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedPeriodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-compounded-rfr-period":{"post":{"tags":["quantlib-starter"],"summary":"Create Compounded Rfr Period","operationId":"create_compounded_rfr_period_quantlib_core_create_compounded_rfr_period_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedPeriodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-credit-protection-period":{"post":{"tags":["quantlib-starter"],"summary":"Create Credit Protection Period","operationId":"create_credit_protection_period_quantlib_core_create_credit_protection_period_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFixedPeriodRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-notional-schedule":{"post":{"tags":["quantlib-starter"],"summary":"Create Notional Schedule","operationId":"create_notional_schedule_quantlib_core_create_notional_schedule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateNotionalScheduleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-fee-payment":{"post":{"tags":["quantlib-starter"],"summary":"Create Fee Payment","operationId":"create_fee_payment_quantlib_core_create_fee_payment_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateFeePaymentRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/create-principal-exchange":{"post":{"tags":["quantlib-starter"],"summary":"Create Principal Exchange","operationId":"create_principal_exchange_quantlib_core_create_principal_exchange_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePrincipalExchangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/total-cashflows":{"post":{"tags":["quantlib-starter"],"summary":"Total Cashflows Endpoint","operationId":"total_cashflows_endpoint_quantlib_core_total_cashflows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashflowsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/total-npv":{"post":{"tags":["quantlib-starter"],"summary":"Total Npv Endpoint","operationId":"total_npv_endpoint_quantlib_core_total_npv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CashflowsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/to-datetime":{"post":{"tags":["quantlib-starter"],"summary":"To Datetime Endpoint","operationId":"to_datetime_endpoint_quantlib_core_to_datetime_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToDateTimeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/rate-units":{"get":{"tags":["quantlib-starter"],"summary":"Get Rate Units","operationId":"get_rate_units_quantlib_core_enums_rate_units_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/compounding-methods":{"get":{"tags":["quantlib-starter"],"summary":"Get Compounding Methods","operationId":"get_compounding_methods_quantlib_core_enums_compounding_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/notional-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Notional Types","operationId":"get_notional_types_quantlib_core_enums_notional_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/observation-methods":{"get":{"tags":["quantlib-starter"],"summary":"Get Observation Methods","operationId":"get_observation_methods_quantlib_core_enums_observation_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/exchange-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Exchange Types","operationId":"get_exchange_types_quantlib_core_enums_exchange_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/stub-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Stub Types","operationId":"get_stub_types_quantlib_core_enums_stub_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/enums/fixing-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Fixing Types","operationId":"get_fixing_types_quantlib_core_enums_fixing_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/numba-available":{"get":{"tags":["quantlib-starter"],"summary":"Get Numba Status","operationId":"get_numba_status_quantlib_core_numba_available_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/legs":{"get":{"tags":["quantlib-starter"],"summary":"Get Legs Module","operationId":"get_legs_module_quantlib_core_submodules_legs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/periods":{"get":{"tags":["quantlib-starter"],"summary":"Get Periods Module","operationId":"get_periods_module_quantlib_core_submodules_periods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/types":{"get":{"tags":["quantlib-starter"],"summary":"Get Types Module","operationId":"get_types_module_quantlib_core_submodules_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/autodiff":{"get":{"tags":["quantlib-starter"],"summary":"Get Autodiff Module","operationId":"get_autodiff_module_quantlib_core_submodules_autodiff_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/math-utils":{"get":{"tags":["quantlib-starter"],"summary":"Get Math Utils Module","operationId":"get_math_utils_module_quantlib_core_submodules_math_utils_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/submodules/numba-ops":{"get":{"tags":["quantlib-starter"],"summary":"Get Numba Ops Module","operationId":"get_numba_ops_module_quantlib_core_submodules_numba_ops_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/core/compounding-methods":{"get":{"tags":["quantlib-starter"],"summary":"Get Compounding Methods","description":"Get available compounding method values","operationId":"get_compounding_methods_quantlib_core_compounding_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/exchange-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Exchange Types","description":"Get available exchange type values","operationId":"get_exchange_types_quantlib_core_exchange_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/fixing-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Fixing Types","description":"Get available fixing type values","operationId":"get_fixing_types_quantlib_core_fixing_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/notional-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Notional Types","description":"Get available notional type values","operationId":"get_notional_types_quantlib_core_notional_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/observation-methods":{"get":{"tags":["quantlib-starter"],"summary":"Get Observation Methods","description":"Get available observation method values","operationId":"get_observation_methods_quantlib_core_observation_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/stub-types":{"get":{"tags":["quantlib-starter"],"summary":"Get Stub Types","description":"Get available stub type values","operationId":"get_stub_types_quantlib_core_stub_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/base-leg-info":{"get":{"tags":["quantlib-starter"],"summary":"Get Base Leg Info","description":"Get documentation for BaseLeg abstract class","operationId":"get_base_leg_info_quantlib_core_base_leg_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/core/base-period-info":{"get":{"tags":["quantlib-starter"],"summary":"Get Base Period Info","description":"Get documentation for BasePeriod abstract class","operationId":"get_base_period_info_quantlib_core_base_period_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/fx/info":{"get":{"tags":["quantlib-starter"],"summary":"Fx Module Info","description":"FX module information","operationId":"fx_module_info_quantlib_fx_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/fx/create-fx-quote":{"post":{"tags":["quantlib-starter"],"summary":"Create Fx Quote","operationId":"create_fx_quote_quantlib_fx_create_fx_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXQuoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/create-fx-forward-quote":{"post":{"tags":["quantlib-starter"],"summary":"Create Fx Forward Quote","operationId":"create_fx_forward_quote_quantlib_fx_create_fx_forward_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXForwardQuoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/enums/quote-conventions":{"get":{"tags":["quantlib-starter"],"summary":"Get Quote Conventions","operationId":"get_quote_conventions_quantlib_fx_enums_quote_conventions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/create-rate-matrix":{"post":{"tags":["quantlib-starter"],"summary":"Create Rate Matrix","operationId":"create_rate_matrix_quantlib_fx_create_rate_matrix_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXRateMatrixRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/create-forward-calculator":{"post":{"tags":["quantlib-starter"],"summary":"Create Forward Calculator","operationId":"create_forward_calculator_quantlib_fx_create_forward_calculator_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXForwardCalculatorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/calculate-forward-points":{"post":{"tags":["quantlib-starter"],"summary":"Calculate Forward Points Endpoint","operationId":"calculate_forward_points_endpoint_quantlib_fx_calculate_forward_points_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXForwardPointsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/calculate-outright-forward":{"post":{"tags":["quantlib-starter"],"summary":"Calculate Outright Forward Endpoint","operationId":"calculate_outright_forward_endpoint_quantlib_fx_calculate_outright_forward_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXOutrightForwardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/submodules/rates":{"get":{"tags":["quantlib-starter"],"summary":"Get Rates Module","operationId":"get_rates_module_quantlib_fx_submodules_rates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/submodules/forwards":{"get":{"tags":["quantlib-starter"],"summary":"Get Forwards Module","operationId":"get_forwards_module_quantlib_fx_submodules_forwards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/fx/quote-conventions":{"get":{"tags":["quantlib-starter"],"summary":"Get Quote Conventions","description":"Get available FX quote convention values","operationId":"get_quote_conventions_quantlib_fx_quote_conventions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/instruments/info":{"get":{"tags":["quantlib-professional"],"summary":"Instruments Module Info","description":"Instruments module information","operationId":"instruments_module_info_quantlib_instruments_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/instruments/create-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Bond","operationId":"create_bond_quantlib_instruments_create_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fixed-rate-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Fixed Rate Bond","operationId":"create_fixed_rate_bond_quantlib_instruments_create_fixed_rate_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixedRateBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-floating-rate-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Floating Rate Bond","operationId":"create_floating_rate_bond_quantlib_instruments_create_floating_rate_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloatingRateBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-zero-coupon-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Zero Coupon Bond","operationId":"create_zero_coupon_bond_quantlib_instruments_create_zero_coupon_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZeroCouponBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-call-provision":{"post":{"tags":["quantlib-professional"],"summary":"Create Call Provision","operationId":"create_call_provision_quantlib_instruments_create_call_provision_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallProvisionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-call-schedule":{"post":{"tags":["quantlib-professional"],"summary":"Create Call Schedule","operationId":"create_call_schedule_quantlib_instruments_create_call_schedule_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallScheduleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-callable-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Callable Bond","operationId":"create_callable_bond_quantlib_instruments_create_callable_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallableBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-callable-puttable-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Callable Puttable Bond","operationId":"create_callable_puttable_bond_quantlib_instruments_create_callable_puttable_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallablePuttableBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-bond-price-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Bond Price Result","operationId":"create_bond_price_result_quantlib_instruments_create_bond_price_result_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BondPriceResultRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-interest-rate-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Interest Rate Swap","operationId":"create_interest_rate_swap_quantlib_instruments_create_interest_rate_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterestRateSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-basis-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Basis Swap","operationId":"create_basis_swap_quantlib_instruments_create_basis_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BasisSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cross-currency-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Cross Currency Swap","operationId":"create_cross_currency_swap_quantlib_instruments_create_cross_currency_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrossCurrencySwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cross-currency-basis-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Cross Currency Basis Swap","operationId":"create_cross_currency_basis_swap_quantlib_instruments_create_cross_currency_basis_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrossCurrencyBasisSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-amortizing-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Amortizing Swap","operationId":"create_amortizing_swap_quantlib_instruments_create_amortizing_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmortizingSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-compounded-rfr-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Compounded Rfr Swap","operationId":"create_compounded_rfr_swap_quantlib_instruments_create_compounded_rfr_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompoundedRFRSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-sofr-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Sofr Swap Endpoint","operationId":"create_sofr_swap_endpoint_quantlib_instruments_create_sofr_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterestRateSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-sonia-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Sonia Swap Endpoint","operationId":"create_sonia_swap_endpoint_quantlib_instruments_create_sonia_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterestRateSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-estr-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Estr Swap Endpoint","operationId":"create_estr_swap_endpoint_quantlib_instruments_create_estr_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InterestRateSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cms-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Cms Swap","operationId":"create_cms_swap_quantlib_instruments_create_cms_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CMSSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-callable-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Callable Swap","operationId":"create_callable_swap_quantlib_instruments_create_callable_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallableSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-callable-puttable-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Callable Puttable Swap","operationId":"create_callable_puttable_swap_quantlib_instruments_create_callable_puttable_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallablePuttableSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-capped-floored-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Capped Floored Swap","operationId":"create_capped_floored_swap_quantlib_instruments_create_capped_floored_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CappedFlooredSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-vanilla-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Vanilla Option","operationId":"create_vanilla_option_quantlib_instruments_create_vanilla_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VanillaOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-barrier-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Barrier Option","operationId":"create_barrier_option_quantlib_instruments_create_barrier_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BarrierOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-discrete-barrier-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Discrete Barrier Option","operationId":"create_discrete_barrier_option_quantlib_instruments_create_discrete_barrier_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscreteBarrierOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-double-barrier-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Double Barrier Option","operationId":"create_double_barrier_option_quantlib_instruments_create_double_barrier_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DoubleBarrierOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-asian-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Asian Option","operationId":"create_asian_option_quantlib_instruments_create_asian_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AsianOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-arithmetic-asian-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Arithmetic Asian Option","operationId":"create_arithmetic_asian_option_quantlib_instruments_create_arithmetic_asian_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArithmeticAsianOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-digital-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Digital Option","operationId":"create_digital_option_quantlib_instruments_create_digital_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-lookback-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Lookback Option","operationId":"create_lookback_option_quantlib_instruments_create_lookback_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LookbackOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-chooser-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Chooser Option","operationId":"create_chooser_option_quantlib_instruments_create_chooser_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChooserOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-compound-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Compound Option","operationId":"create_compound_option_quantlib_instruments_create_compound_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompoundOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-rainbow-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Rainbow Option","operationId":"create_rainbow_option_quantlib_instruments_create_rainbow_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RainbowOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-quanto-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Quanto Option","operationId":"create_quanto_option_quantlib_instruments_create_quanto_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuantoOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cap":{"post":{"tags":["quantlib-professional"],"summary":"Create Cap","operationId":"create_cap_quantlib_instruments_create_cap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-floor":{"post":{"tags":["quantlib-professional"],"summary":"Create Floor","operationId":"create_floor_quantlib_instruments_create_floor_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-collar":{"post":{"tags":["quantlib-professional"],"summary":"Create Collar","operationId":"create_collar_quantlib_instruments_create_collar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CollarRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-swaption":{"post":{"tags":["quantlib-professional"],"summary":"Create Swaption","operationId":"create_swaption_quantlib_instruments_create_swaption_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwaptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-tarn":{"post":{"tags":["quantlib-professional"],"summary":"Create Tarn","operationId":"create_tarn_quantlib_instruments_create_tarn_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TARNRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-bond-future":{"post":{"tags":["quantlib-professional"],"summary":"Create Bond Future","operationId":"create_bond_future_quantlib_instruments_create_bond_future_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BondFutureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-commodity-future":{"post":{"tags":["quantlib-professional"],"summary":"Create Commodity Future","operationId":"create_commodity_future_quantlib_instruments_create_commodity_future_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommodityFutureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fra":{"post":{"tags":["quantlib-professional"],"summary":"Create Fra","operationId":"create_fra_quantlib_instruments_create_fra_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FRARequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-forward":{"post":{"tags":["quantlib-professional"],"summary":"Create Forward","operationId":"create_forward_quantlib_instruments_create_forward_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-futures-contract":{"post":{"tags":["quantlib-professional"],"summary":"Create Futures Contract","operationId":"create_futures_contract_quantlib_instruments_create_futures_contract_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FuturesContractRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-credit-default-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Credit Default Swap","operationId":"create_credit_default_swap_quantlib_instruments_create_credit_default_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditDefaultSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cds-bootstrap":{"post":{"tags":["quantlib-professional"],"summary":"Create Cds Bootstrap","operationId":"create_cds_bootstrap_quantlib_instruments_create_cds_bootstrap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CDSBootstrapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cds-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Cds Result","operationId":"create_cds_result_quantlib_instruments_create_cds_result_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CDSResultRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-constant-hazard-rate":{"post":{"tags":["quantlib-professional"],"summary":"Create Constant Hazard Rate","operationId":"create_constant_hazard_rate_quantlib_instruments_create_constant_hazard_rate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConstantHazardRateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-total-return-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Total Return Swap","operationId":"create_total_return_swap_quantlib_instruments_create_total_return_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TotalReturnSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-credit-linked-note":{"post":{"tags":["quantlib-professional"],"summary":"Create Credit Linked Note","operationId":"create_credit_linked_note_quantlib_instruments_create_credit_linked_note_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditLinkedNoteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-first-to-default-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create First To Default Swap","operationId":"create_first_to_default_swap_quantlib_instruments_create_first_to_default_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FirstToDefaultSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-nth-to-default-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Nth To Default Swap","operationId":"create_nth_to_default_swap_quantlib_instruments_create_nth_to_default_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NthToDefaultSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-asset-backed-security":{"post":{"tags":["quantlib-professional"],"summary":"Create Asset Backed Security","operationId":"create_asset_backed_security_quantlib_instruments_create_asset_backed_security_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssetBackedSecurityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-mortgage-backed-security":{"post":{"tags":["quantlib-professional"],"summary":"Create Mortgage Backed Security","operationId":"create_mortgage_backed_security_quantlib_instruments_create_mortgage_backed_security_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MortgageBackedSecurityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-cdo":{"post":{"tags":["quantlib-professional"],"summary":"Create Cdo","operationId":"create_cdo_quantlib_instruments_create_cdo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CDORequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-clo":{"post":{"tags":["quantlib-professional"],"summary":"Create Clo","operationId":"create_clo_quantlib_instruments_create_clo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CLORequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-tranche":{"post":{"tags":["quantlib-professional"],"summary":"Create Tranche","operationId":"create_tranche_quantlib_instruments_create_tranche_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrancheRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-convertible-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Convertible Bond","operationId":"create_convertible_bond_quantlib_instruments_create_convertible_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConvertibleBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-conversion-terms":{"post":{"tags":["quantlib-professional"],"summary":"Create Conversion Terms","operationId":"create_conversion_terms_quantlib_instruments_create_conversion_terms_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionTermsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-conversion-trigger":{"post":{"tags":["quantlib-professional"],"summary":"Create Conversion Trigger","operationId":"create_conversion_trigger_quantlib_instruments_create_conversion_trigger_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversionTriggerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-mandatory-convertible":{"post":{"tags":["quantlib-professional"],"summary":"Create Mandatory Convertible","operationId":"create_mandatory_convertible_quantlib_instruments_create_mandatory_convertible_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MandatoryConvertibleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-reverse-convertible":{"post":{"tags":["quantlib-professional"],"summary":"Create Reverse Convertible","operationId":"create_reverse_convertible_quantlib_instruments_create_reverse_convertible_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReverseConvertibleRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-commodity-index":{"post":{"tags":["quantlib-professional"],"summary":"Create Commodity Index","operationId":"create_commodity_index_quantlib_instruments_create_commodity_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommodityIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-commodity-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Commodity Option","operationId":"create_commodity_option_quantlib_instruments_create_commodity_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommodityOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-commodity-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Commodity Swap","operationId":"create_commodity_swap_quantlib_instruments_create_commodity_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommoditySwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-weather-derivative":{"post":{"tags":["quantlib-professional"],"summary":"Create Weather Derivative","operationId":"create_weather_derivative_quantlib_instruments_create_weather_derivative_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeatherDerivativeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/calculate-degree-days":{"post":{"tags":["quantlib-professional"],"summary":"Calculate Degree Days Endpoint","operationId":"calculate_degree_days_endpoint_quantlib_instruments_calculate_degree_days_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-equity-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Equity Swap","operationId":"create_equity_swap_quantlib_instruments_create_equity_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquitySwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-variance-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Variance Swap","operationId":"create_variance_swap_quantlib_instruments_create_variance_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VarianceSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-volatility-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Volatility Swap","operationId":"create_volatility_swap_quantlib_instruments_create_volatility_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolatilitySwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Option","operationId":"create_fx_option_quantlib_instruments_create_fx_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-forward":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Forward","operationId":"create_fx_forward_quantlib_instruments_create_fx_forward_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXForwardRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-deposit":{"post":{"tags":["quantlib-professional"],"summary":"Create Deposit","operationId":"create_deposit_quantlib_instruments_create_deposit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-commercial-paper":{"post":{"tags":["quantlib-professional"],"summary":"Create Commercial Paper","operationId":"create_commercial_paper_quantlib_instruments_create_commercial_paper_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommercialPaperRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-certificate-of-deposit":{"post":{"tags":["quantlib-professional"],"summary":"Create Certificate Of Deposit","operationId":"create_certificate_of_deposit_quantlib_instruments_create_certificate_of_deposit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateOfDepositRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-catastrophe-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Catastrophe Bond","operationId":"create_catastrophe_bond_quantlib_instruments_create_catastrophe_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatastropheBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-inflation-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Inflation Swap","operationId":"create_inflation_swap_quantlib_instruments_create_inflation_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-treasury-bill":{"post":{"tags":["quantlib-professional"],"summary":"Create Treasury Bill","operationId":"create_treasury_bill_quantlib_instruments_create_treasury_bill_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TreasuryBillRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-repo":{"post":{"tags":["quantlib-professional"],"summary":"Create Repo","operationId":"create_repo_quantlib_instruments_create_repo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-stir-future":{"post":{"tags":["quantlib-professional"],"summary":"Create Stir Future","operationId":"create_stir_future_quantlib_instruments_create_stir_future_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/STIRFutureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-overnight-index-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Overnight Index Swap","operationId":"create_overnight_index_swap_quantlib_instruments_create_overnight_index_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OvernightIndexSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-tenor-basis-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Tenor Basis Swap","operationId":"create_tenor_basis_swap_quantlib_instruments_create_tenor_basis_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenorBasisSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-single-currency-basis-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Single Currency Basis Swap","operationId":"create_single_currency_basis_swap_quantlib_instruments_create_single_currency_basis_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SingleCurrencyBasisSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-rfr-basis-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Rfr Basis Swap","operationId":"create_rfr_basis_swap_quantlib_instruments_create_rfr_basis_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RFRBasisSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-zero-coupon-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Zero Coupon Swap","operationId":"create_zero_coupon_swap_quantlib_instruments_create_zero_coupon_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZeroCouponSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-zero-zero-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Zero Zero Swap","operationId":"create_zero_zero_swap_quantlib_instruments_create_zero_zero_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZeroZeroSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-range-accrual-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Range Accrual Swap","operationId":"create_range_accrual_swap_quantlib_instruments_create_range_accrual_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RangeAccrualSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-mtm-cross-currency-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Mtm Cross Currency Swap","operationId":"create_mtm_cross_currency_swap_quantlib_instruments_create_mtm_cross_currency_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MTMCrossCurrencySwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-puttable-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Puttable Bond","operationId":"create_puttable_bond_quantlib_instruments_create_puttable_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PuttableBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-puttable-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Puttable Swap","operationId":"create_puttable_swap_quantlib_instruments_create_puttable_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PuttableSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-inflation-linked-bond":{"post":{"tags":["quantlib-professional"],"summary":"Create Inflation Linked Bond","operationId":"create_inflation_linked_bond_quantlib_instruments_create_inflation_linked_bond_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationLinkedBondRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-inflation-indexed-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Inflation Indexed Swap","operationId":"create_inflation_indexed_swap_quantlib_instruments_create_inflation_indexed_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InflationIndexedSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-year-on-year-inflation-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Year On Year Inflation Swap","operationId":"create_year_on_year_inflation_swap_quantlib_instruments_create_year_on_year_inflation_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/YearOnYearInflationSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-zero-coupon-inflation-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Zero Coupon Inflation Swap","operationId":"create_zero_coupon_inflation_swap_quantlib_instruments_create_zero_coupon_inflation_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZeroCouponInflationSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-forward-start-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Forward Start Option","operationId":"create_forward_start_option_quantlib_instruments_create_forward_start_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForwardStartOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-spread-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Spread Option","operationId":"create_spread_option_quantlib_instruments_create_spread_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpreadOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-exchange-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Exchange Option","operationId":"create_exchange_option_quantlib_instruments_create_exchange_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExchangeOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-swap":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Swap","operationId":"create_fx_swap_quantlib_instruments_create_fx_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXSwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-spot":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Spot","operationId":"create_fx_spot_quantlib_instruments_create_fx_spot_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FXSpotRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-option-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Option Result","operationId":"create_option_result_quantlib_instruments_create_option_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fra-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Fra Result","operationId":"create_fra_result_quantlib_instruments_create_fra_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-futures-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Futures Result","operationId":"create_futures_result_quantlib_instruments_create_futures_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-forward-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Forward Result","operationId":"create_fx_forward_result_quantlib_instruments_create_fx_forward_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fx-option-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Fx Option Result","operationId":"create_fx_option_result_quantlib_instruments_create_fx_option_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-xccy-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Xccy Result","operationId":"create_xccy_result_quantlib_instruments_create_xccy_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-xccy-swap-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Xccy Swap Result","operationId":"create_xccy_swap_result_quantlib_instruments_create_xccy_swap_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fixed-leg":{"post":{"tags":["quantlib-professional"],"summary":"Create Fixed Leg","operationId":"create_fixed_leg_quantlib_instruments_create_fixed_leg_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-floating-leg":{"post":{"tags":["quantlib-professional"],"summary":"Create Floating Leg","operationId":"create_floating_leg_quantlib_instruments_create_floating_leg_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-notional-schedule":{"post":{"tags":["quantlib-professional"],"summary":"Create Notional Schedule","operationId":"create_notional_schedule_quantlib_instruments_create_notional_schedule_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-put-provision":{"post":{"tags":["quantlib-professional"],"summary":"Create Put Provision","operationId":"create_put_provision_quantlib_instruments_create_put_provision_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-put-schedule":{"post":{"tags":["quantlib-professional"],"summary":"Create Put Schedule","operationId":"create_put_schedule_quantlib_instruments_create_put_schedule_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-fixed-strike-lookback":{"post":{"tags":["quantlib-professional"],"summary":"Create Fixed Strike Lookback","operationId":"create_fixed_strike_lookback_quantlib_instruments_create_fixed_strike_lookback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixedStrikeLookbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-floating-strike-lookback":{"post":{"tags":["quantlib-professional"],"summary":"Create Floating Strike Lookback","operationId":"create_floating_strike_lookback_quantlib_instruments_create_floating_strike_lookback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FloatingStrikeLookbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-geometric-asian-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Geometric Asian Option","operationId":"create_geometric_asian_option_quantlib_instruments_create_geometric_asian_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeometricAsianOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-hazard-rate-curve":{"post":{"tags":["quantlib-professional"],"summary":"Create Hazard Rate Curve","operationId":"create_hazard_rate_curve_quantlib_instruments_create_hazard_rate_curve_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-piecewise-hazard-rate":{"post":{"tags":["quantlib-professional"],"summary":"Create Piecewise Hazard Rate","operationId":"create_piecewise_hazard_rate_quantlib_instruments_create_piecewise_hazard_rate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-survival-curve":{"post":{"tags":["quantlib-professional"],"summary":"Create Survival Curve","operationId":"create_survival_curve_quantlib_instruments_create_survival_curve_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-forward-rate-agreement":{"post":{"tags":["quantlib-professional"],"summary":"Create Forward Rate Agreement","operationId":"create_forward_rate_agreement_quantlib_instruments_create_forward_rate_agreement_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FRARequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-mortgage-pool":{"post":{"tags":["quantlib-professional"],"summary":"Create Mortgage Pool","operationId":"create_mortgage_pool_quantlib_instruments_create_mortgage_pool_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-prepayment-model":{"post":{"tags":["quantlib-professional"],"summary":"Create Prepayment Model","operationId":"create_prepayment_model_quantlib_instruments_create_prepayment_model_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-notional-step":{"post":{"tags":["quantlib-professional"],"summary":"Create Notional Step","operationId":"create_notional_step_quantlib_instruments_create_notional_step_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-exercise-schedule":{"post":{"tags":["quantlib-professional"],"summary":"Create Exercise Schedule","operationId":"create_exercise_schedule_quantlib_instruments_create_exercise_schedule_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-exotic-barrier-option":{"post":{"tags":["quantlib-professional"],"summary":"Create Exotic Barrier Option","operationId":"create_exotic_barrier_option_quantlib_instruments_create_exotic_barrier_option_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExoticBarrierOptionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-ois-index":{"post":{"tags":["quantlib-professional"],"summary":"Create Ois Index","operationId":"create_ois_index_quantlib_instruments_create_ois_index_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-ffvsofr-basis":{"post":{"tags":["quantlib-professional"],"summary":"Create Ffvsofr Basis","operationId":"create_ffvsofr_basis_quantlib_instruments_create_ffvsofr_basis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-weather-index":{"post":{"tags":["quantlib-professional"],"summary":"Create Weather Index","operationId":"create_weather_index_quantlib_instruments_create_weather_index_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WeatherIndexRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/create-weather-measurement":{"post":{"tags":["quantlib-professional"],"summary":"Create Weather Measurement","operationId":"create_weather_measurement_quantlib_instruments_create_weather_measurement_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/option-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Option Type Enum","operationId":"get_option_type_enum_quantlib_instruments_enums_option_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/barrier-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Barrier Type Enum","operationId":"get_barrier_type_enum_quantlib_instruments_enums_barrier_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/averaging-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Averaging Type Enum","operationId":"get_averaging_type_enum_quantlib_instruments_enums_averaging_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/commodity-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Commodity Type Enum","operationId":"get_commodity_type_enum_quantlib_instruments_enums_commodity_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/compounding-method":{"get":{"tags":["quantlib-professional"],"summary":"Get Compounding Method Enum","operationId":"get_compounding_method_enum_quantlib_instruments_enums_compounding_method_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/exercise-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Exercise Type Enum","operationId":"get_exercise_type_enum_quantlib_instruments_enums_exercise_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/option-style":{"get":{"tags":["quantlib-professional"],"summary":"Get Option Style Enum","operationId":"get_option_style_enum_quantlib_instruments_enums_option_style_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/swaption-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Swaption Type Enum","operationId":"get_swaption_type_enum_quantlib_instruments_enums_swaption_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/swap-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Swap Type Enum","operationId":"get_swap_type_enum_quantlib_instruments_enums_swap_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/notional-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Notional Type Enum","operationId":"get_notional_type_enum_quantlib_instruments_enums_notional_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/mbs-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Mbs Type Enum","operationId":"get_mbs_type_enum_quantlib_instruments_enums_mbs_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/xccy-swap-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Xccy Swap Type Enum","operationId":"get_xccy_swap_type_enum_quantlib_instruments_enums_xccy_swap_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/exotic-barrier-type":{"get":{"tags":["quantlib-professional"],"summary":"Get Exotic Barrier Type Enum","operationId":"get_exotic_barrier_type_enum_quantlib_instruments_enums_exotic_barrier_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/enums/observation-shift":{"get":{"tags":["quantlib-professional"],"summary":"Get Observation Shift Enum","operationId":"get_observation_shift_enum_quantlib_instruments_enums_observation_shift_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/calculate-realized-variance":{"post":{"tags":["quantlib-professional"],"summary":"Calculate Realized Variance Endpoint","operationId":"calculate_realized_variance_endpoint_quantlib_instruments_calculate_realized_variance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RealizedVarianceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/calculate-realized-volatility":{"post":{"tags":["quantlib-professional"],"summary":"Calculate Realized Volatility Endpoint","operationId":"calculate_realized_volatility_endpoint_quantlib_instruments_calculate_realized_volatility_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RealizedVarianceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/bonds":{"get":{"tags":["quantlib-professional"],"summary":"Get Bonds Submodule","operationId":"get_bonds_submodule_quantlib_instruments_submodules_bonds_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/rates":{"get":{"tags":["quantlib-professional"],"summary":"Get Rates Submodule","operationId":"get_rates_submodule_quantlib_instruments_submodules_rates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/exotics":{"get":{"tags":["quantlib-professional"],"summary":"Get Exotics Submodule","operationId":"get_exotics_submodule_quantlib_instruments_submodules_exotics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/credit":{"get":{"tags":["quantlib-professional"],"summary":"Get Credit Submodule","operationId":"get_credit_submodule_quantlib_instruments_submodules_credit_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/securitization":{"get":{"tags":["quantlib-professional"],"summary":"Get Securitization Submodule","operationId":"get_securitization_submodule_quantlib_instruments_submodules_securitization_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/convertible":{"get":{"tags":["quantlib-professional"],"summary":"Get Convertible Submodule","operationId":"get_convertible_submodule_quantlib_instruments_submodules_convertible_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/commodity":{"get":{"tags":["quantlib-professional"],"summary":"Get Commodity Submodule","operationId":"get_commodity_submodule_quantlib_instruments_submodules_commodity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/equity":{"get":{"tags":["quantlib-professional"],"summary":"Get Equity Submodule","operationId":"get_equity_submodule_quantlib_instruments_submodules_equity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/fx":{"get":{"tags":["quantlib-professional"],"summary":"Get Fx Submodule","operationId":"get_fx_submodule_quantlib_instruments_submodules_fx_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/embedded-options":{"get":{"tags":["quantlib-professional"],"summary":"Get Embedded Options Submodule","operationId":"get_embedded_options_submodule_quantlib_instruments_submodules_embedded_options_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/money-market":{"get":{"tags":["quantlib-professional"],"summary":"Get Money Market Submodule","operationId":"get_money_market_submodule_quantlib_instruments_submodules_money_market_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/alternative":{"get":{"tags":["quantlib-professional"],"summary":"Get Alternative Submodule","operationId":"get_alternative_submodule_quantlib_instruments_submodules_alternative_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/submodules/math":{"get":{"tags":["quantlib-professional"],"summary":"Get Math Submodule","operationId":"get_math_submodule_quantlib_instruments_submodules_math_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/instruments/degree-days":{"post":{"tags":["quantlib-professional"],"summary":"Degree Days Endpoint","operationId":"degree_days_endpoint_quantlib_instruments_degree_days_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/info":{"get":{"tags":["quantlib-professional"],"summary":"Volatility Module Info","description":"Volatility module information","operationId":"volatility_module_info_quantlib_volatility_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/volatility/create-flat-volatility":{"post":{"tags":["quantlib-professional"],"summary":"Create Flat Volatility","operationId":"create_flat_volatility_quantlib_volatility_create_flat_volatility_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlatVolatilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-volatility-surface":{"post":{"tags":["quantlib-professional"],"summary":"Create Volatility Surface","operationId":"create_volatility_surface_quantlib_volatility_create_volatility_surface_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolatilitySurfaceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-volatility-cube":{"post":{"tags":["quantlib-professional"],"summary":"Create Volatility Cube","operationId":"create_volatility_cube_quantlib_volatility_create_volatility_cube_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VolatilityCubeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-term-structure-volatility":{"post":{"tags":["quantlib-professional"],"summary":"Create Term Structure Volatility","operationId":"create_term_structure_volatility_quantlib_volatility_create_term_structure_volatility_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TermStructureVolatilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-local-volatility":{"post":{"tags":["quantlib-professional"],"summary":"Create Local Volatility","operationId":"create_local_volatility_quantlib_volatility_create_local_volatility_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocalVolatilityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-dupire-local-vol":{"post":{"tags":["quantlib-professional"],"summary":"Create Dupire Local Vol","operationId":"create_dupire_local_vol_quantlib_volatility_create_dupire_local_vol_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DupireLocalVolRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-sabr-parameters":{"post":{"tags":["quantlib-professional"],"summary":"Create Sabr Parameters","operationId":"create_sabr_parameters_quantlib_volatility_create_sabr_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SABRParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/create-sabr-model":{"post":{"tags":["quantlib-professional"],"summary":"Create Sabr Model","operationId":"create_sabr_model_quantlib_volatility_create_sabr_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SABRModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/sabr-implied-vol":{"post":{"tags":["quantlib-professional"],"summary":"Sabr Implied Vol Endpoint","operationId":"sabr_implied_vol_endpoint_quantlib_volatility_sabr_implied_vol_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SABRImpliedVolRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/calibrate-sabr":{"post":{"tags":["quantlib-professional"],"summary":"Calibrate Sabr Endpoint","operationId":"calibrate_sabr_endpoint_quantlib_volatility_calibrate_sabr_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrateSABRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/submodules/surface":{"get":{"tags":["quantlib-professional"],"summary":"Get Surface Submodule","operationId":"get_surface_submodule_quantlib_volatility_submodules_surface_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/submodules/sabr":{"get":{"tags":["quantlib-professional"],"summary":"Get Sabr Submodule","operationId":"get_sabr_submodule_quantlib_volatility_submodules_sabr_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/volatility/submodules/local-vol":{"get":{"tags":["quantlib-professional"],"summary":"Get Local Vol Submodule","operationId":"get_local_vol_submodule_quantlib_volatility_submodules_local_vol_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/info":{"get":{"tags":["quantlib-professional"],"summary":"Solver Module Info","description":"Solver module information","operationId":"solver_module_info_quantlib_solver_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/solver/create-brent-solver":{"post":{"tags":["quantlib-professional"],"summary":"Create Brent Solver","operationId":"create_brent_solver_quantlib_solver_create_brent_solver_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrentSolverRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-newton-raphson":{"post":{"tags":["quantlib-professional"],"summary":"Create Newton Raphson","operationId":"create_newton_raphson_quantlib_solver_create_newton_raphson_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_solver__NewtonRaphsonRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-levenberg-marquardt":{"post":{"tags":["quantlib-professional"],"summary":"Create Levenberg Marquardt","operationId":"create_levenberg_marquardt_quantlib_solver_create_levenberg_marquardt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LevenbergMarquardtRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-gauss-newton":{"post":{"tags":["quantlib-professional"],"summary":"Create Gauss Newton","operationId":"create_gauss_newton_quantlib_solver_create_gauss_newton_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GaussNewtonRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-bootstrap-config":{"post":{"tags":["quantlib-professional"],"summary":"Create Bootstrap Config","operationId":"create_bootstrap_config_quantlib_solver_create_bootstrap_config_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapConfigRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-curve-solver":{"post":{"tags":["quantlib-professional"],"summary":"Create Curve Solver","operationId":"create_curve_solver_quantlib_solver_create_curve_solver_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurveSolverRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/create-calibration-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Calibration Result","operationId":"create_calibration_result_quantlib_solver_create_calibration_result_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalibrationResultRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/bootstrap-curve":{"post":{"tags":["quantlib-professional"],"summary":"Bootstrap Curve Endpoint","operationId":"bootstrap_curve_endpoint_quantlib_solver_bootstrap_curve_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BootstrapCurveRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/submodules/bootstrap":{"get":{"tags":["quantlib-professional"],"summary":"Get Bootstrap Submodule","operationId":"get_bootstrap_submodule_quantlib_solver_submodules_bootstrap_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/solver/submodules/optimizer":{"get":{"tags":["quantlib-professional"],"summary":"Get Optimizer Submodule","operationId":"get_optimizer_submodule_quantlib_solver_submodules_optimizer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/info":{"get":{"tags":["quantlib-professional"],"summary":"Portfolio Module Info","description":"Portfolio module information","operationId":"portfolio_module_info_quantlib_portfolio_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/portfolio/create-portfolio-constraints":{"post":{"tags":["quantlib-professional"],"summary":"Create Portfolio Constraints","operationId":"create_portfolio_constraints_quantlib_portfolio_create_portfolio_constraints_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioConstraintsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-mean-variance-optimizer":{"post":{"tags":["quantlib-professional"],"summary":"Create Mean Variance Optimizer","operationId":"create_mean_variance_optimizer_quantlib_portfolio_create_mean_variance_optimizer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeanVarianceOptimizerRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-optimization-result":{"post":{"tags":["quantlib-professional"],"summary":"Create Optimization Result","operationId":"create_optimization_result_quantlib_portfolio_create_optimization_result_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptimizationResultRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-portfolio-risk":{"post":{"tags":["quantlib-professional"],"summary":"Create Portfolio Risk","operationId":"create_portfolio_risk_quantlib_portfolio_create_portfolio_risk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortfolioRiskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-risk-parity":{"post":{"tags":["quantlib-professional"],"summary":"Create Risk Parity","operationId":"create_risk_parity_quantlib_portfolio_create_risk_parity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RiskParityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-equal-risk-contribution":{"post":{"tags":["quantlib-professional"],"summary":"Create Equal Risk Contribution","operationId":"create_equal_risk_contribution_quantlib_portfolio_create_equal_risk_contribution_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EqualRiskContributionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-hierarchical-risk-parity":{"post":{"tags":["quantlib-professional"],"summary":"Create Hierarchical Risk Parity","operationId":"create_hierarchical_risk_parity_quantlib_portfolio_create_hierarchical_risk_parity_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HierarchicalRiskParityRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-view":{"post":{"tags":["quantlib-professional"],"summary":"Create View","operationId":"create_view_quantlib_portfolio_create_view_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/create-black-litterman":{"post":{"tags":["quantlib-professional"],"summary":"Create Black Litterman","operationId":"create_black_litterman_quantlib_portfolio_create_black_litterman_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlackLittermanRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/enums/view-type":{"get":{"tags":["quantlib-professional"],"summary":"Get View Type Enum","operationId":"get_view_type_enum_quantlib_portfolio_enums_view_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/min-variance-portfolio":{"post":{"tags":["quantlib-professional"],"summary":"Min Variance Portfolio Endpoint","operationId":"min_variance_portfolio_endpoint_quantlib_portfolio_min_variance_portfolio_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MinVariancePortfolioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/max-sharpe-portfolio":{"post":{"tags":["quantlib-professional"],"summary":"Max Sharpe Portfolio Endpoint","operationId":"max_sharpe_portfolio_endpoint_quantlib_portfolio_max_sharpe_portfolio_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MaxSharpePortfolioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/target-return-portfolio":{"post":{"tags":["quantlib-professional"],"summary":"Target Return Portfolio Endpoint","operationId":"target_return_portfolio_endpoint_quantlib_portfolio_target_return_portfolio_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetReturnPortfolioRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/efficient-frontier":{"post":{"tags":["quantlib-professional"],"summary":"Efficient Frontier Endpoint","operationId":"efficient_frontier_endpoint_quantlib_portfolio_efficient_frontier_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EfficientFrontierRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/equilibrium-returns":{"post":{"tags":["quantlib-professional"],"summary":"Equilibrium Returns Endpoint","operationId":"equilibrium_returns_endpoint_quantlib_portfolio_equilibrium_returns_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EquilibriumReturnsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/calculate-var":{"post":{"tags":["quantlib-professional"],"summary":"Calculate Var Endpoint","operationId":"calculate_var_endpoint_quantlib_portfolio_calculate_var_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_risk__VaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/calculate-cvar":{"post":{"tags":["quantlib-professional"],"summary":"Calculate Cvar Endpoint","operationId":"calculate_cvar_endpoint_quantlib_portfolio_calculate_cvar_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CVaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/marginal-risk-contribution":{"post":{"tags":["quantlib-professional"],"summary":"Marginal Risk Contribution Endpoint","operationId":"marginal_risk_contribution_endpoint_quantlib_portfolio_marginal_risk_contribution_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarginalRiskContributionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/component-risk":{"post":{"tags":["quantlib-professional"],"summary":"Component Risk Endpoint","operationId":"component_risk_endpoint_quantlib_portfolio_component_risk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComponentRiskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/submodules/optimization":{"get":{"tags":["quantlib-professional"],"summary":"Get Optimization Submodule","operationId":"get_optimization_submodule_quantlib_portfolio_submodules_optimization_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/submodules/risk-metrics":{"get":{"tags":["quantlib-professional"],"summary":"Get Risk Metrics Submodule","operationId":"get_risk_metrics_submodule_quantlib_portfolio_submodules_risk_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/submodules/black-litterman":{"get":{"tags":["quantlib-professional"],"summary":"Get Black Litterman Submodule","operationId":"get_black_litterman_submodule_quantlib_portfolio_submodules_black_litterman_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/portfolio/submodules/risk-parity":{"get":{"tags":["quantlib-professional"],"summary":"Get Risk Parity Submodule","operationId":"get_risk_parity_submodule_quantlib_portfolio_submodules_risk_parity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/info":{"get":{"tags":["quantlib-enterprise"],"summary":"Models Module Info","description":"Models module information","operationId":"models_module_info_quantlib_models_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/models/create-heston-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Heston Parameters","operationId":"create_heston_parameters_quantlib_models_create_heston_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HestonParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-heston-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Heston Model","operationId":"create_heston_model_quantlib_models_create_heston_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HestonModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-heston-pricer":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Heston Pricer","operationId":"create_heston_pricer_quantlib_models_create_heston_pricer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HestonModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-sabr-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Sabr Parameters Enhanced","operationId":"create_sabr_parameters_enhanced_quantlib_models_create_sabr_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SABRParametersEnhancedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-sabr-model-enhanced":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Sabr Model Enhanced","operationId":"create_sabr_model_enhanced_quantlib_models_create_sabr_model_enhanced_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SABRModelEnhancedRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-svi":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Svi","operationId":"create_svi_quantlib_models_create_svi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SVIRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-ssvi":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Ssvi","operationId":"create_ssvi_quantlib_models_create_ssvi_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SSVIRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-dupire-local-vol":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Dupire Local Vol Model","operationId":"create_dupire_local_vol_model_quantlib_models_create_dupire_local_vol_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-short-rate-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Short Rate Parameters","operationId":"create_short_rate_parameters_quantlib_models_create_short_rate_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortRateParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-vasicek-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vasicek Model","operationId":"create_vasicek_model_quantlib_models_create_vasicek_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VasicekModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-vasicek":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vasicek Function","operationId":"create_vasicek_function_quantlib_models_create_vasicek_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VasicekModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-hull-white-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Hull White Model","operationId":"create_hull_white_model_quantlib_models_create_hull_white_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HullWhiteModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-hull-white":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Hull White Function","operationId":"create_hull_white_function_quantlib_models_create_hull_white_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HullWhiteModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-cir-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cir Model","operationId":"create_cir_model_quantlib_models_create_cir_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIRModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-cir":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cir Function","operationId":"create_cir_function_quantlib_models_create_cir_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CIRModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-black-karasinski-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Black Karasinski Model","operationId":"create_black_karasinski_model_quantlib_models_create_black_karasinski_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlackKarasinskiModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-merton-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Merton Parameters","operationId":"create_merton_parameters_quantlib_models_create_merton_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MertonParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-merton-jump-diffusion":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Merton Jump Diffusion","operationId":"create_merton_jump_diffusion_quantlib_models_create_merton_jump_diffusion_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MertonJumpDiffusionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/merton-call-price":{"post":{"tags":["quantlib-enterprise"],"summary":"Merton Call Price Endpoint","operationId":"merton_call_price_endpoint_quantlib_models_merton_call_price_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MertonCallPriceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-kou-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Kou Parameters","operationId":"create_kou_parameters_quantlib_models_create_kou_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KouParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-kou-jump-diffusion":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Kou Jump Diffusion","operationId":"create_kou_jump_diffusion_quantlib_models_create_kou_jump_diffusion_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KouJumpDiffusionRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/kou-call-price":{"post":{"tags":["quantlib-enterprise"],"summary":"Kou Call Price Endpoint","operationId":"kou_call_price_endpoint_quantlib_models_kou_call_price_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KouCallPriceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-vg-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vg Parameters","operationId":"create_vg_parameters_quantlib_models_create_vg_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VGParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-variance-gamma":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Variance Gamma","operationId":"create_variance_gamma_quantlib_models_create_variance_gamma_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VarianceGammaRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/vg-call-price":{"post":{"tags":["quantlib-enterprise"],"summary":"Vg Call Price Endpoint","operationId":"vg_call_price_endpoint_quantlib_models_vg_call_price_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VGCallPriceRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-local-vol-surface":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Local Vol Surface","operationId":"create_local_vol_surface_quantlib_models_create_local_vol_surface_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-flat-local-vol":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Flat Local Vol Endpoint","operationId":"create_flat_local_vol_endpoint_quantlib_models_create_flat_local_vol_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/create-svi-local-vol":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Svi Local Vol Endpoint","operationId":"create_svi_local_vol_endpoint_quantlib_models_create_svi_local_vol_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/submodules/stochastic-vol":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Stochastic Vol Submodule","operationId":"get_stochastic_vol_submodule_quantlib_models_submodules_stochastic_vol_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/submodules/short-rate":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Short Rate Submodule","operationId":"get_short_rate_submodule_quantlib_models_submodules_short_rate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/submodules/jump-diffusion":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Jump Diffusion Submodule","operationId":"get_jump_diffusion_submodule_quantlib_models_submodules_jump_diffusion_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/models/submodules/local-vol":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Local Vol Submodule","operationId":"get_local_vol_submodule_quantlib_models_submodules_local_vol_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/info":{"get":{"tags":["quantlib-enterprise"],"summary":"Risk Module Info","description":"Risk module information","operationId":"risk_module_info_quantlib_risk_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/risk/create-historical-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Historical Var","operationId":"create_historical_var_quantlib_risk_create_historical_var_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoricalVaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-parametric-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Parametric Var","operationId":"create_parametric_var_quantlib_risk_create_parametric_var_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ParametricVaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-monte-carlo-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Monte Carlo Var","operationId":"create_monte_carlo_var_quantlib_risk_create_monte_carlo_var_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonteCarloVaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-component-var-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Component Var Calculator","operationId":"create_component_var_calculator_quantlib_risk_create_component_var_calculator_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComponentVaRCalculatorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-component-var-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Component Var Result","operationId":"create_component_var_result_quantlib_risk_create_component_var_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-incremental-var-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Incremental Var Calculator","operationId":"create_incremental_var_calculator_quantlib_risk_create_incremental_var_calculator_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncrementalVaRCalculatorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-incremental-var-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Incremental Var Result","operationId":"create_incremental_var_result_quantlib_risk_create_incremental_var_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-liquidity-adjusted-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Liquidity Adjusted Var","operationId":"create_liquidity_adjusted_var_quantlib_risk_create_liquidity_adjusted_var_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LiquidityAdjustedVaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-liquidity-adjustment":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Liquidity Adjustment","operationId":"create_liquidity_adjustment_quantlib_risk_create_liquidity_adjustment_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-coherent-risk-measure":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Coherent Risk Measure","operationId":"create_coherent_risk_measure_quantlib_risk_create_coherent_risk_measure_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-credit-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Credit Parameters","operationId":"create_credit_parameters_quantlib_risk_create_credit_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-funding-parameters":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Funding Parameters","operationId":"create_funding_parameters_quantlib_risk_create_funding_parameters_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FundingParametersRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-cva-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cva Calculator","operationId":"create_cva_calculator_quantlib_risk_create_cva_calculator_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CVACalculatorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-fva-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Fva Calculator","operationId":"create_fva_calculator_quantlib_risk_create_fva_calculator_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FVACalculatorRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-kva-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Kva Calculator","operationId":"create_kva_calculator_quantlib_risk_create_kva_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-mva-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Mva Calculator","operationId":"create_mva_calculator_quantlib_risk_create_mva_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-vega-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vega Var","operationId":"create_vega_var_quantlib_risk_create_vega_var_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-vol-of-vol-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vol Of Vol Var","operationId":"create_vol_of_vol_var_quantlib_risk_create_vol_of_vol_var_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-xva-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Xva Calculator","operationId":"create_xva_calculator_quantlib_risk_create_xva_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-xva-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Xva Result","operationId":"create_xva_result_quantlib_risk_create_xva_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-correlation-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Correlation Scenario","operationId":"create_correlation_scenario_quantlib_risk_create_correlation_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-correlation-stress-tester":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Correlation Stress Tester","operationId":"create_correlation_stress_tester_quantlib_risk_create_correlation_stress_tester_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-scenario-builder":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scenario Builder","operationId":"create_scenario_builder_quantlib_risk_create_scenario_builder_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-stress-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Scenario","operationId":"create_stress_scenario_quantlib_risk_create_stress_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-stress-tester":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Tester","operationId":"create_stress_tester_quantlib_risk_create_stress_tester_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-stress-test-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Test Result","operationId":"create_stress_test_result_quantlib_risk_create_stress_test_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-backtest-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Backtest Result","operationId":"create_backtest_result_quantlib_risk_create_backtest_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/backtest-var-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Backtest Var Model Endpoint","operationId":"backtest_var_model_endpoint_quantlib_risk_backtest_var_model_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacktestVaRModelRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/calculate-delta":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Delta Endpoint","operationId":"calculate_delta_endpoint_quantlib_risk_calculate_delta_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/calculate-gamma":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Gamma Endpoint","operationId":"calculate_gamma_endpoint_quantlib_risk_calculate_gamma_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/calculate-vega":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Vega Endpoint","operationId":"calculate_vega_endpoint_quantlib_risk_calculate_vega_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/calculate-theta":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Theta Endpoint","operationId":"calculate_theta_endpoint_quantlib_risk_calculate_theta_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/calculate-rho":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Rho Endpoint","operationId":"calculate_rho_endpoint_quantlib_risk_calculate_rho_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/full-greeks":{"post":{"tags":["quantlib-enterprise"],"summary":"Full Greeks Endpoint","operationId":"full_greeks_endpoint_quantlib_risk_full_greeks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreeksRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/bucket-delta":{"post":{"tags":["quantlib-enterprise"],"summary":"Bucket Delta Endpoint","operationId":"bucket_delta_endpoint_quantlib_risk_bucket_delta_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/key-rate-duration":{"post":{"tags":["quantlib-enterprise"],"summary":"Key Rate Duration Endpoint","operationId":"key_rate_duration_endpoint_quantlib_risk_key_rate_duration_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/conditional-value-at-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Conditional Value At Risk Endpoint","operationId":"conditional_value_at_risk_endpoint_quantlib_risk_conditional_value_at_risk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_risk__VaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/expected-shortfall-optimization":{"post":{"tags":["quantlib-enterprise"],"summary":"Expected Shortfall Optimization Endpoint","operationId":"expected_shortfall_optimization_endpoint_quantlib_risk_expected_shortfall_optimization_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/marginal-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Marginal Var Endpoint","operationId":"marginal_var_endpoint_quantlib_risk_marginal_var_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/component-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Component Var Endpoint","operationId":"component_var_endpoint_quantlib_risk_component_var_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/incremental-var":{"post":{"tags":["quantlib-enterprise"],"summary":"Incremental Var Endpoint","operationId":"incremental_var_endpoint_quantlib_risk_incremental_var_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/tail-conditional-expectation":{"post":{"tags":["quantlib-enterprise"],"summary":"Tail Conditional Expectation Endpoint","operationId":"tail_conditional_expectation_endpoint_quantlib_risk_tail_conditional_expectation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_risk__VaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/tail-dependence-coefficient":{"post":{"tags":["quantlib-enterprise"],"summary":"Tail Dependence Coefficient Endpoint","operationId":"tail_dependence_coefficient_endpoint_quantlib_risk_tail_dependence_coefficient_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/worst-conditional-expectation":{"post":{"tags":["quantlib-enterprise"],"summary":"Worst Conditional Expectation Endpoint","operationId":"worst_conditional_expectation_endpoint_quantlib_risk_worst_conditional_expectation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/quantlib_risk__VaRRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-position":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Position","operationId":"create_position_quantlib_risk_create_position_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-portfolio":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Portfolio Risk","operationId":"create_portfolio_risk_quantlib_risk_create_portfolio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-portfolio-analytics":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Portfolio Analytics","operationId":"create_portfolio_analytics_quantlib_risk_create_portfolio_analytics_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-portfolio-risk-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Portfolio Risk Result","operationId":"create_portfolio_risk_result_quantlib_risk_create_portfolio_risk_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scenario","operationId":"create_scenario_quantlib_risk_create_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-scenario-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scenario Analysis","operationId":"create_scenario_analysis_quantlib_risk_create_scenario_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-stress-test":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Test","operationId":"create_stress_test_quantlib_risk_create_stress_test_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-stress-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Result","operationId":"create_stress_result_quantlib_risk_create_stress_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-tail-risk-analyzer":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Tail Risk Analyzer","operationId":"create_tail_risk_analyzer_quantlib_risk_create_tail_risk_analyzer_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-tail-risk-metrics":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Tail Risk Metrics","operationId":"create_tail_risk_metrics_quantlib_risk_create_tail_risk_metrics_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-var-backtester":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Var Backtester","operationId":"create_var_backtester_quantlib_risk_create_var_backtester_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-var-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Var Result","operationId":"create_var_result_quantlib_risk_create_var_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/create-xva-engine":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Xva Engine","operationId":"create_xva_engine_quantlib_risk_create_xva_engine_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/enums/scenario-type":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Scenario Type Enum","operationId":"get_scenario_type_enum_quantlib_risk_enums_scenario_type_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/enums/traffic-light-zone":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Traffic Light Zone Enum","operationId":"get_traffic_light_zone_enum_quantlib_risk_enums_traffic_light_zone_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/enums/asset-class":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Asset Class Enum","operationId":"get_asset_class_enum_quantlib_risk_enums_asset_class_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/var":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Var Submodule","operationId":"get_var_submodule_quantlib_risk_submodules_var_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/xva":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Xva Submodule","operationId":"get_xva_submodule_quantlib_risk_submodules_xva_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/sensitivities":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Sensitivities Submodule","operationId":"get_sensitivities_submodule_quantlib_risk_submodules_sensitivities_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/stress":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Stress Submodule","operationId":"get_stress_submodule_quantlib_risk_submodules_stress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/tail-risk":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Tail Risk Submodule","operationId":"get_tail_risk_submodule_quantlib_risk_submodules_tail_risk_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/backtesting":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Backtesting Submodule","operationId":"get_backtesting_submodule_quantlib_risk_submodules_backtesting_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/portfolio":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Portfolio Submodule","operationId":"get_portfolio_submodule_quantlib_risk_submodules_portfolio_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/advanced-var":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Advanced Var Submodule","operationId":"get_advanced_var_submodule_quantlib_risk_submodules_advanced_var_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/risk/submodules/correlation-stress":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Correlation Stress Submodule","operationId":"get_correlation_stress_submodule_quantlib_risk_submodules_correlation_stress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/info":{"get":{"tags":["quantlib-enterprise"],"summary":"Analysis Module Info","description":"Analysis module information","operationId":"analysis_module_info_quantlib_analysis_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/analysis/adjust-goodwill":{"post":{"tags":["quantlib-enterprise"],"summary":"Adjust Goodwill","operationId":"adjust_goodwill_quantlib_analysis_adjust_goodwill_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/adjust-pension":{"post":{"tags":["quantlib-enterprise"],"summary":"Adjust Pension","operationId":"adjust_pension_quantlib_analysis_adjust_pension_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/adjust-stock-compensation":{"post":{"tags":["quantlib-enterprise"],"summary":"Adjust Stock Compensation","operationId":"adjust_stock_compensation_quantlib_analysis_adjust_stock_compensation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/adjusted-ffo":{"post":{"tags":["quantlib-enterprise"],"summary":"Adjusted Ffo","operationId":"adjusted_ffo_quantlib_analysis_adjusted_ffo_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/altman-z-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Altman Z Score","operationId":"altman_z_score_quantlib_analysis_altman_z_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/altman-z-prime":{"post":{"tags":["quantlib-enterprise"],"summary":"Altman Z Prime","operationId":"altman_z_prime_quantlib_analysis_altman_z_prime_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/altman-z-double-prime":{"post":{"tags":["quantlib-enterprise"],"summary":"Altman Z Double Prime","operationId":"altman_z_double_prime_quantlib_analysis_altman_z_double_prime_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/asset-growth-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Asset Growth Factor","operationId":"asset_growth_factor_quantlib_analysis_asset_growth_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/asset-turnover":{"post":{"tags":["quantlib-enterprise"],"summary":"Asset Turnover","operationId":"asset_turnover_quantlib_analysis_asset_turnover_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/beneish-m-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Beneish M Score","operationId":"beneish_m_score_quantlib_analysis_beneish_m_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/breakup-value-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Breakup Value Analysis","operationId":"breakup_value_analysis_quantlib_analysis_breakup_value_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cagr":{"post":{"tags":["quantlib-enterprise"],"summary":"Cagr","operationId":"cagr_quantlib_analysis_cagr_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/calculate-factor-exposures":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Factor Exposures","operationId":"calculate_factor_exposures_quantlib_analysis_calculate_factor_exposures_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/calculate-ownership-dilution":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Ownership Dilution","operationId":"calculate_ownership_dilution_quantlib_analysis_calculate_ownership_dilution_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/capacity-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Capacity Factor","operationId":"capacity_factor_quantlib_analysis_capacity_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/capitalize-operating-leases":{"post":{"tags":["quantlib-enterprise"],"summary":"Capitalize Operating Leases","operationId":"capitalize_operating_leases_quantlib_analysis_capitalize_operating_leases_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/capitalize-rd":{"post":{"tags":["quantlib-enterprise"],"summary":"Capitalize Rd","operationId":"capitalize_rd_quantlib_analysis_capitalize_rd_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cash-conversion-cycle":{"post":{"tags":["quantlib-enterprise"],"summary":"Cash Conversion Cycle","operationId":"cash_conversion_cycle_quantlib_analysis_cash_conversion_cycle_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cash-conversion-quality":{"post":{"tags":["quantlib-enterprise"],"summary":"Cash Conversion Quality","operationId":"cash_conversion_quality_quantlib_analysis_cash_conversion_quality_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cash-flow-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Cash Flow Margin","operationId":"cash_flow_margin_quantlib_analysis_cash_flow_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cash-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Cash Ratio","operationId":"cash_ratio_quantlib_analysis_cash_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cfroi":{"post":{"tags":["quantlib-enterprise"],"summary":"Cfroi","operationId":"cfroi_quantlib_analysis_cfroi_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/combined-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Combined Ratio","operationId":"combined_ratio_quantlib_analysis_combined_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/composite-quality-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Composite Quality Score","operationId":"composite_quality_score_quantlib_analysis_composite_quality_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/composite-value-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Composite Value Score","operationId":"composite_value_score_quantlib_analysis_composite_value_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/conglomerate-discount":{"post":{"tags":["quantlib-enterprise"],"summary":"Conglomerate Discount","operationId":"conglomerate_discount_quantlib_analysis_conglomerate_discount_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/cost-of-equity-capm":{"post":{"tags":["quantlib-enterprise"],"summary":"Cost Of Equity Capm","operationId":"cost_of_equity_capm_quantlib_analysis_cost_of_equity_capm_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/credit-spread-from-pd":{"post":{"tags":["quantlib-enterprise"],"summary":"Credit Spread From Pd","operationId":"credit_spread_from_pd_quantlib_analysis_credit_spread_from_pd_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/credit-spread-merton":{"post":{"tags":["quantlib-enterprise"],"summary":"Credit Spread Merton","operationId":"credit_spread_merton_quantlib_analysis_credit_spread_merton_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/current-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Current Ratio","operationId":"current_ratio_quantlib_analysis_current_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/days-inventory":{"post":{"tags":["quantlib-enterprise"],"summary":"Days Inventory","operationId":"days_inventory_quantlib_analysis_days_inventory_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/days-payables":{"post":{"tags":["quantlib-enterprise"],"summary":"Days Payables","operationId":"days_payables_quantlib_analysis_days_payables_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/days-receivables":{"post":{"tags":["quantlib-enterprise"],"summary":"Days Receivables","operationId":"days_receivables_quantlib_analysis_days_receivables_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/ddm-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Ddm Valuation","operationId":"ddm_valuation_quantlib_analysis_ddm_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/debt-capacity":{"post":{"tags":["quantlib-enterprise"],"summary":"Debt Capacity","operationId":"debt_capacity_quantlib_analysis_debt_capacity_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/debt-service-coverage":{"post":{"tags":["quantlib-enterprise"],"summary":"Debt Service Coverage","operationId":"debt_service_coverage_quantlib_analysis_debt_service_coverage_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/debt-to-assets":{"post":{"tags":["quantlib-enterprise"],"summary":"Debt To Assets","operationId":"debt_to_assets_quantlib_analysis_debt_to_assets_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/debt-to-equity":{"post":{"tags":["quantlib-enterprise"],"summary":"Debt To Equity","operationId":"debt_to_equity_quantlib_analysis_debt_to_equity_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/defensive-interval":{"post":{"tags":["quantlib-enterprise"],"summary":"Defensive Interval","operationId":"defensive_interval_quantlib_analysis_defensive_interval_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/distance-to-default":{"post":{"tags":["quantlib-enterprise"],"summary":"Distance To Default","operationId":"distance_to_default_quantlib_analysis_distance_to_default_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/calculate-function":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Function","description":"Universal endpoint for all remaining analysis functions.\nPass 'function_name' and parameters in request body.\n\nSupported functions: dividend_yield, dupont_3_factor, dupont_5_factor, ebitda_margin,\neconomic_value_added, ev_to_ebitda, fcfe, fcff, gordon_growth_model, gross_margin,\ninterest_coverage, inventory_turnover, net_margin, operating_margin, payout_ratio,\npe_to_growth, piotroski_f_score, price_to_book, price_to_sales, quick_ratio,\nreturn_on_assets, return_on_equity, return_on_invested_capital, revenue_growth,\nsustainable_growth_rate, times_interest_earned, tobin_q, wacc, working_capital,\nand 67 more...","operationId":"calculate_function_quantlib_analysis_calculate_function_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-financial-analyzer":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Financial Analyzer","operationId":"create_financial_analyzer_quantlib_analysis_create_financial_analyzer_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-dcf-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Dcf Model","operationId":"create_dcf_model_quantlib_analysis_create_dcf_model_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-dupont-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Dupont Analysis","operationId":"create_dupont_analysis_quantlib_analysis_create_dupont_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-credit-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Credit Analysis","operationId":"create_credit_analysis_quantlib_analysis_create_credit_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-valuation-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Valuation Analysis","operationId":"create_valuation_analysis_quantlib_analysis_create_valuation_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-comparable-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Comparable Analysis","operationId":"create_comparable_analysis_quantlib_analysis_create_comparable_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-financial-statements":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Financial Statements","operationId":"create_financial_statements_quantlib_analysis_create_financial_statements_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-balance-sheet":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Balance Sheet","operationId":"create_balance_sheet_quantlib_analysis_create_balance_sheet_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-income-statement":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Income Statement","operationId":"create_income_statement_quantlib_analysis_create_income_statement_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-cash-flow-statement":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cash Flow Statement","operationId":"create_cash_flow_statement_quantlib_analysis_create_cash_flow_statement_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-class-instance":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Class Instance","description":"Universal endpoint for creating instances of analysis classes.\nPass 'class_name' and constructor parameters in request body.\n\nSupported classes: Company, CompanyFundamentals, AnalysisReport, ValuationResult,\nProfitabilityAnalysis, LiquidityAnalysis, SolvencyAnalysis, EfficiencyAnalysis,\nGrowthAnalysis, CashFlowAnalysis, CapitalStructureAnalysis, SegmentAnalysis,\nFactorAnalysis, BankingAnalysis, InsuranceAnalysis, REITAnalysis, UtilityAnalysis,\nand 36 more...","operationId":"create_class_instance_quantlib_analysis_create_class_instance_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/valuation":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Valuation Submodule","operationId":"get_valuation_submodule_quantlib_analysis_submodules_valuation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/credit":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Credit Submodule","operationId":"get_credit_submodule_quantlib_analysis_submodules_credit_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/quality":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Quality Submodule","operationId":"get_quality_submodule_quantlib_analysis_submodules_quality_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/dcf":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Dcf Submodule","operationId":"get_dcf_submodule_quantlib_analysis_submodules_dcf_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/dupont":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Dupont Submodule","operationId":"get_dupont_submodule_quantlib_analysis_submodules_dupont_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/comparable":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Comparable Submodule","operationId":"get_comparable_submodule_quantlib_analysis_submodules_comparable_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/profitability":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Profitability Submodule","operationId":"get_profitability_submodule_quantlib_analysis_submodules_profitability_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/liquidity":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Liquidity Submodule","operationId":"get_liquidity_submodule_quantlib_analysis_submodules_liquidity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/solvency":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Solvency Submodule","operationId":"get_solvency_submodule_quantlib_analysis_submodules_solvency_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/efficiency":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Efficiency Submodule","operationId":"get_efficiency_submodule_quantlib_analysis_submodules_efficiency_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/growth":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Growth Submodule","operationId":"get_growth_submodule_quantlib_analysis_submodules_growth_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/cashflow":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Cashflow Submodule","operationId":"get_cashflow_submodule_quantlib_analysis_submodules_cashflow_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/capital-structure":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Capital Structure Submodule","operationId":"get_capital_structure_submodule_quantlib_analysis_submodules_capital_structure_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/comprehensive":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Comprehensive Submodule","operationId":"get_comprehensive_submodule_quantlib_analysis_submodules_comprehensive_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/factor-models":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Factor Models Submodule","operationId":"get_factor_models_submodule_quantlib_analysis_submodules_factor_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/industry":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Industry Submodule","operationId":"get_industry_submodule_quantlib_analysis_submodules_industry_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/predictive":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Predictive Submodule","operationId":"get_predictive_submodule_quantlib_analysis_submodules_predictive_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/proforma":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Proforma Submodule","operationId":"get_proforma_submodule_quantlib_analysis_submodules_proforma_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/segment":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Segment Submodule","operationId":"get_segment_submodule_quantlib_analysis_submodules_segment_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/startup":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Startup Submodule","operationId":"get_startup_submodule_quantlib_analysis_submodules_startup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/submodules/statements":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Statements Submodule","operationId":"get_statements_submodule_quantlib_analysis_submodules_statements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/gross-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Gross Margin Endpoint","operationId":"gross_margin_endpoint_quantlib_analysis_gross_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/operating-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Operating Margin Endpoint","operationId":"operating_margin_endpoint_quantlib_analysis_operating_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/net-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Net Margin Endpoint","operationId":"net_margin_endpoint_quantlib_analysis_net_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/return-on-assets":{"post":{"tags":["quantlib-enterprise"],"summary":"Return On Assets Endpoint","operationId":"return_on_assets_endpoint_quantlib_analysis_return_on_assets_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/return-on-equity":{"post":{"tags":["quantlib-enterprise"],"summary":"Return On Equity Endpoint","operationId":"return_on_equity_endpoint_quantlib_analysis_return_on_equity_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/return-on-invested-capital":{"post":{"tags":["quantlib-enterprise"],"summary":"Return On Invested Capital Endpoint","operationId":"return_on_invested_capital_endpoint_quantlib_analysis_return_on_invested_capital_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/return-on-capital-employed":{"post":{"tags":["quantlib-enterprise"],"summary":"Return On Capital Employed Endpoint","operationId":"return_on_capital_employed_endpoint_quantlib_analysis_return_on_capital_employed_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/inventory-turnover":{"post":{"tags":["quantlib-enterprise"],"summary":"Inventory Turnover Endpoint","operationId":"inventory_turnover_endpoint_quantlib_analysis_inventory_turnover_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/receivables-turnover":{"post":{"tags":["quantlib-enterprise"],"summary":"Receivables Turnover Endpoint","operationId":"receivables_turnover_endpoint_quantlib_analysis_receivables_turnover_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/payables-turnover":{"post":{"tags":["quantlib-enterprise"],"summary":"Payables Turnover Endpoint","operationId":"payables_turnover_endpoint_quantlib_analysis_payables_turnover_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/interest-coverage":{"post":{"tags":["quantlib-enterprise"],"summary":"Interest Coverage Endpoint","operationId":"interest_coverage_endpoint_quantlib_analysis_interest_coverage_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/quick-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Quick Ratio Endpoint","operationId":"quick_ratio_endpoint_quantlib_analysis_quick_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/invested-capital":{"post":{"tags":["quantlib-enterprise"],"summary":"Invested Capital Endpoint","operationId":"invested_capital_endpoint_quantlib_analysis_invested_capital_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/nopat":{"post":{"tags":["quantlib-enterprise"],"summary":"Nopat Endpoint","operationId":"nopat_endpoint_quantlib_analysis_nopat_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/wacc":{"post":{"tags":["quantlib-enterprise"],"summary":"Wacc Endpoint","operationId":"wacc_endpoint_quantlib_analysis_wacc_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/sustainable-growth-rate":{"post":{"tags":["quantlib-enterprise"],"summary":"Sustainable Growth Rate Endpoint","operationId":"sustainable_growth_rate_endpoint_quantlib_analysis_sustainable_growth_rate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/internal-growth-rate":{"post":{"tags":["quantlib-enterprise"],"summary":"Internal Growth Rate Endpoint","operationId":"internal_growth_rate_endpoint_quantlib_analysis_internal_growth_rate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/price-to-earnings":{"post":{"tags":["quantlib-enterprise"],"summary":"Price To Earnings Endpoint","operationId":"price_to_earnings_endpoint_quantlib_analysis_price_to_earnings_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/price-to-book":{"post":{"tags":["quantlib-enterprise"],"summary":"Price To Book Endpoint","operationId":"price_to_book_endpoint_quantlib_analysis_price_to_book_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/price-to-sales":{"post":{"tags":["quantlib-enterprise"],"summary":"Price To Sales Endpoint","operationId":"price_to_sales_endpoint_quantlib_analysis_price_to_sales_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/peg-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Peg Ratio Endpoint","operationId":"peg_ratio_endpoint_quantlib_analysis_peg_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/market-value-added":{"post":{"tags":["quantlib-enterprise"],"summary":"Market Value Added Endpoint","operationId":"market_value_added_endpoint_quantlib_analysis_market_value_added_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/two-stage-dcf":{"post":{"tags":["quantlib-enterprise"],"summary":"Two Stage Dcf Endpoint","operationId":"two_stage_dcf_endpoint_quantlib_analysis_two_stage_dcf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/three-stage-dcf":{"post":{"tags":["quantlib-enterprise"],"summary":"Three Stage Dcf Endpoint","operationId":"three_stage_dcf_endpoint_quantlib_analysis_three_stage_dcf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/terminal-value-perpetuity":{"post":{"tags":["quantlib-enterprise"],"summary":"Terminal Value Perpetuity Endpoint","operationId":"terminal_value_perpetuity_endpoint_quantlib_analysis_terminal_value_perpetuity_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/terminal-value-exit-multiple":{"post":{"tags":["quantlib-enterprise"],"summary":"Terminal Value Exit Multiple Endpoint","operationId":"terminal_value_exit_multiple_endpoint_quantlib_analysis_terminal_value_exit_multiple_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/two-stage-ddm":{"post":{"tags":["quantlib-enterprise"],"summary":"Two Stage Ddm Endpoint","operationId":"two_stage_ddm_endpoint_quantlib_analysis_two_stage_ddm_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/residual-income-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Residual Income Valuation Endpoint","operationId":"residual_income_valuation_endpoint_quantlib_analysis_residual_income_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/residual-income":{"post":{"tags":["quantlib-enterprise"],"summary":"Residual Income Endpoint","operationId":"residual_income_endpoint_quantlib_analysis_residual_income_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/relative-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Relative Valuation Endpoint","operationId":"relative_valuation_endpoint_quantlib_analysis_relative_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/sum-of-the-parts":{"post":{"tags":["quantlib-enterprise"],"summary":"Sum Of The Parts Endpoint","operationId":"sum_of_the_parts_endpoint_quantlib_analysis_sum_of_the_parts_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/justified-pb-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Justified Pb Ratio Endpoint","operationId":"justified_pb_ratio_endpoint_quantlib_analysis_justified_pb_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/three-stage-dcf-fade":{"post":{"tags":["quantlib-enterprise"],"summary":"Three Stage Dcf Fade Endpoint","operationId":"three_stage_dcf_fade_endpoint_quantlib_analysis_three_stage_dcf_fade_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/n-stage-dcf":{"post":{"tags":["quantlib-enterprise"],"summary":"N Stage Dcf Endpoint","operationId":"n_stage_dcf_endpoint_quantlib_analysis_n_stage_dcf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/peer-comparison":{"post":{"tags":["quantlib-enterprise"],"summary":"Peer Comparison Endpoint","operationId":"peer_comparison_endpoint_quantlib_analysis_peer_comparison_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/quality-of-earnings":{"post":{"tags":["quantlib-enterprise"],"summary":"Quality Of Earnings Endpoint","operationId":"quality_of_earnings_endpoint_quantlib_analysis_quality_of_earnings_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/normalize-earnings":{"post":{"tags":["quantlib-enterprise"],"summary":"Normalize Earnings Endpoint","operationId":"normalize_earnings_endpoint_quantlib_analysis_normalize_earnings_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/lifo-to-fifo-adjustment":{"post":{"tags":["quantlib-enterprise"],"summary":"Lifo To Fifo Adjustment Endpoint","operationId":"lifo_to_fifo_adjustment_endpoint_quantlib_analysis_lifo_to_fifo_adjustment_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/segment-profitability":{"post":{"tags":["quantlib-enterprise"],"summary":"Segment Profitability Endpoint","operationId":"segment_profitability_endpoint_quantlib_analysis_segment_profitability_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/size-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Size Factor Endpoint","operationId":"size_factor_endpoint_quantlib_analysis_size_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/sloan-accruals-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Sloan Accruals Ratio Endpoint","operationId":"sloan_accruals_ratio_endpoint_quantlib_analysis_sloan_accruals_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/ohlson-o-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Ohlson O Score Endpoint","operationId":"ohlson_o_score_endpoint_quantlib_analysis_ohlson_o_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/piotroski-f-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Piotroski F Score Endpoint","operationId":"piotroski_f_score_endpoint_quantlib_analysis_piotroski_f_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/springate-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Springate Score Endpoint","operationId":"springate_score_endpoint_quantlib_analysis_springate_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/zmijewski-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Zmijewski Score Endpoint","operationId":"zmijewski_score_endpoint_quantlib_analysis_zmijewski_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/percentile-rank":{"post":{"tags":["quantlib-enterprise"],"summary":"Percentile Rank Endpoint","operationId":"percentile_rank_endpoint_quantlib_analysis_percentile_rank_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/optimal-debt-ratio-tradeoff":{"post":{"tags":["quantlib-enterprise"],"summary":"Optimal Debt Ratio Tradeoff Endpoint","operationId":"optimal_debt_ratio_tradeoff_endpoint_quantlib_analysis_optimal_debt_ratio_tradeoff_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/wacc-minimization":{"post":{"tags":["quantlib-enterprise"],"summary":"Wacc Minimization Endpoint","operationId":"wacc_minimization_endpoint_quantlib_analysis_wacc_minimization_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/mm-proposition-2":{"post":{"tags":["quantlib-enterprise"],"summary":"Mm Proposition 2 Endpoint","operationId":"mm_proposition_2_endpoint_quantlib_analysis_mm_proposition_2_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/loan-to-deposit-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Loan To Deposit Ratio Endpoint","operationId":"loan_to_deposit_ratio_endpoint_quantlib_analysis_loan_to_deposit_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/non-performing-loan-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Non Performing Loan Ratio Endpoint","operationId":"non_performing_loan_ratio_endpoint_quantlib_analysis_non_performing_loan_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/net-interest-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Net Interest Margin Endpoint","operationId":"net_interest_margin_endpoint_quantlib_analysis_net_interest_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/tier1-capital-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Tier1 Capital Ratio Endpoint","operationId":"tier1_capital_ratio_endpoint_quantlib_analysis_tier1_capital_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/price-to-ffo":{"post":{"tags":["quantlib-enterprise"],"summary":"Price To Ffo Endpoint","operationId":"price_to_ffo_endpoint_quantlib_analysis_price_to_ffo_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/net-asset-value":{"post":{"tags":["quantlib-enterprise"],"summary":"Net Asset Value Endpoint","operationId":"net_asset_value_endpoint_quantlib_analysis_net_asset_value_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/implied-cap-rate":{"post":{"tags":["quantlib-enterprise"],"summary":"Implied Cap Rate Endpoint","operationId":"implied_cap_rate_endpoint_quantlib_analysis_implied_cap_rate_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/loss-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Loss Ratio Endpoint","operationId":"loss_ratio_endpoint_quantlib_analysis_loss_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/premium-to-surplus":{"post":{"tags":["quantlib-enterprise"],"summary":"Premium To Surplus Endpoint","operationId":"premium_to_surplus_endpoint_quantlib_analysis_premium_to_surplus_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/rate-base":{"post":{"tags":["quantlib-enterprise"],"summary":"Rate Base Endpoint","operationId":"rate_base_endpoint_quantlib_analysis_rate_base_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/earned-return-on-rate-base":{"post":{"tags":["quantlib-enterprise"],"summary":"Earned Return On Rate Base Endpoint","operationId":"earned_return_on_rate_base_endpoint_quantlib_analysis_earned_return_on_rate_base_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/merton-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Merton Model Endpoint","operationId":"merton_model_endpoint_quantlib_analysis_merton_model_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/probability-of-default-from-dd":{"post":{"tags":["quantlib-enterprise"],"summary":"Probability Of Default From Dd Endpoint","operationId":"probability_of_default_from_dd_endpoint_quantlib_analysis_probability_of_default_from_dd_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/unexpected-loss":{"post":{"tags":["quantlib-enterprise"],"summary":"Unexpected Loss Endpoint","operationId":"unexpected_loss_endpoint_quantlib_analysis_unexpected_loss_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/pd-to-rating":{"post":{"tags":["quantlib-enterprise"],"summary":"Pd To Rating Endpoint","operationId":"pd_to_rating_endpoint_quantlib_analysis_pd_to_rating_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/rating-to-pd":{"post":{"tags":["quantlib-enterprise"],"summary":"Rating To Pd Endpoint","operationId":"rating_to_pd_endpoint_quantlib_analysis_rating_to_pd_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/tax-shield-value":{"post":{"tags":["quantlib-enterprise"],"summary":"Tax Shield Value Endpoint","operationId":"tax_shield_value_endpoint_quantlib_analysis_tax_shield_value_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/unlever-beta":{"post":{"tags":["quantlib-enterprise"],"summary":"Unlever Beta Endpoint","operationId":"unlever_beta_endpoint_quantlib_analysis_unlever_beta_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/prat-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Prat Model Endpoint","operationId":"prat_model_endpoint_quantlib_analysis_prat_model_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/pre-revenue-valuation-range":{"post":{"tags":["quantlib-enterprise"],"summary":"Pre Revenue Valuation Range Endpoint","operationId":"pre_revenue_valuation_range_endpoint_quantlib_analysis_pre_revenue_valuation_range_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/dividend-yield":{"post":{"tags":["quantlib-enterprise"],"summary":"Dividend Yield Endpoint","operationId":"dividend_yield_endpoint_quantlib_analysis_dividend_yield_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/dupont-3-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Dupont 3 Factor Endpoint","operationId":"dupont_3_factor_endpoint_quantlib_analysis_dupont_3_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/dupont-5-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Dupont 5 Factor Endpoint","operationId":"dupont_5_factor_endpoint_quantlib_analysis_dupont_5_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/earnings-persistence":{"post":{"tags":["quantlib-enterprise"],"summary":"Earnings Persistence Endpoint","operationId":"earnings_persistence_endpoint_quantlib_analysis_earnings_persistence_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/earnings-yield":{"post":{"tags":["quantlib-enterprise"],"summary":"Earnings Yield Endpoint","operationId":"earnings_yield_endpoint_quantlib_analysis_earnings_yield_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/ebitda-margin":{"post":{"tags":["quantlib-enterprise"],"summary":"Ebitda Margin Endpoint","operationId":"ebitda_margin_endpoint_quantlib_analysis_ebitda_margin_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/economic-value-added":{"post":{"tags":["quantlib-enterprise"],"summary":"Economic Value Added Endpoint","operationId":"economic_value_added_endpoint_quantlib_analysis_economic_value_added_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/efficiency-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Efficiency Ratio Endpoint","operationId":"efficiency_ratio_endpoint_quantlib_analysis_efficiency_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/ev-to-ebitda":{"post":{"tags":["quantlib-enterprise"],"summary":"Ev To Ebitda Endpoint","operationId":"ev_to_ebitda_endpoint_quantlib_analysis_ev_to_ebitda_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/eva-spread":{"post":{"tags":["quantlib-enterprise"],"summary":"Eva Spread Endpoint","operationId":"eva_spread_endpoint_quantlib_analysis_eva_spread_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/expected-default-frequency":{"post":{"tags":["quantlib-enterprise"],"summary":"Expected Default Frequency Endpoint","operationId":"expected_default_frequency_endpoint_quantlib_analysis_expected_default_frequency_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/expected-distress-cost":{"post":{"tags":["quantlib-enterprise"],"summary":"Expected Distress Cost Endpoint","operationId":"expected_distress_cost_endpoint_quantlib_analysis_expected_distress_cost_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/expected-loss":{"post":{"tags":["quantlib-enterprise"],"summary":"Expected Loss Endpoint","operationId":"expected_loss_endpoint_quantlib_analysis_expected_loss_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/expense-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Expense Ratio Endpoint","operationId":"expense_ratio_endpoint_quantlib_analysis_expense_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/fcfe":{"post":{"tags":["quantlib-enterprise"],"summary":"Fcfe Endpoint","operationId":"fcfe_endpoint_quantlib_analysis_fcfe_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/fcfe-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Fcfe Valuation Endpoint","operationId":"fcfe_valuation_endpoint_quantlib_analysis_fcfe_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/fcff":{"post":{"tags":["quantlib-enterprise"],"summary":"Fcff Endpoint","operationId":"fcff_endpoint_quantlib_analysis_fcff_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/fcff-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Fcff Valuation Endpoint","operationId":"fcff_valuation_endpoint_quantlib_analysis_fcff_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/ffo-to-debt":{"post":{"tags":["quantlib-enterprise"],"summary":"Ffo To Debt Endpoint","operationId":"ffo_to_debt_endpoint_quantlib_analysis_ffo_to_debt_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/financial-leverage":{"post":{"tags":["quantlib-enterprise"],"summary":"Financial Leverage Endpoint","operationId":"financial_leverage_endpoint_quantlib_analysis_financial_leverage_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/free-cash-flow":{"post":{"tags":["quantlib-enterprise"],"summary":"Free Cash Flow Endpoint","operationId":"free_cash_flow_endpoint_quantlib_analysis_free_cash_flow_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/funds-from-operations":{"post":{"tags":["quantlib-enterprise"],"summary":"Funds From Operations Endpoint","operationId":"funds_from_operations_endpoint_quantlib_analysis_funds_from_operations_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/gordon-growth-model":{"post":{"tags":["quantlib-enterprise"],"summary":"Gordon Growth Model Endpoint","operationId":"gordon_growth_model_endpoint_quantlib_analysis_gordon_growth_model_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/graham-number":{"post":{"tags":["quantlib-enterprise"],"summary":"Graham Number Endpoint","operationId":"graham_number_endpoint_quantlib_analysis_graham_number_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/gross-profitability-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Gross Profitability Factor Endpoint","operationId":"gross_profitability_factor_endpoint_quantlib_analysis_gross_profitability_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/h-model-dcf":{"post":{"tags":["quantlib-enterprise"],"summary":"H Model Dcf Endpoint","operationId":"h_model_dcf_endpoint_quantlib_analysis_h_model_dcf_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/hamada-equation":{"post":{"tags":["quantlib-enterprise"],"summary":"Hamada Equation Endpoint","operationId":"hamada_equation_endpoint_quantlib_analysis_hamada_equation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-banking-financials":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Banking Financials","operationId":"create_banking_financials_quantlib_analysis_create_banking_financials_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-insurance-financials":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Insurance Financials","operationId":"create_insurance_financials_quantlib_analysis_create_insurance_financials_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-reit-financials":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Reit Financials","operationId":"create_reit_financials_quantlib_analysis_create_reit_financials_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-utility-financials":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Utility Financials","operationId":"create_utility_financials_quantlib_analysis_create_utility_financials_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-berkus-method":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Berkus Method","operationId":"create_berkus_method_quantlib_analysis_create_berkus_method_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-berkus-score":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Berkus Score","operationId":"create_berkus_score_quantlib_analysis_create_berkus_score_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-first-chicago-method":{"post":{"tags":["quantlib-enterprise"],"summary":"Create First Chicago Method","operationId":"create_first_chicago_method_quantlib_analysis_create_first_chicago_method_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-venture-capital-method":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Venture Capital Method","operationId":"create_venture_capital_method_quantlib_analysis_create_venture_capital_method_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-milestone-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Milestone Valuation","operationId":"create_milestone_valuation_quantlib_analysis_create_milestone_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-network-effects-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Network Effects Valuation","operationId":"create_network_effects_valuation_quantlib_analysis_create_network_effects_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-option-pricing-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Option Pricing Valuation","operationId":"create_option_pricing_valuation_quantlib_analysis_create_option_pricing_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-scorecard-valuation":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scorecard Valuation","operationId":"create_scorecard_valuation_quantlib_analysis_create_scorecard_valuation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-eva-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Eva Analysis","operationId":"create_eva_analysis_quantlib_analysis_create_eva_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-earnings-quality-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Earnings Quality Analysis","operationId":"create_earnings_quality_analysis_quantlib_analysis_create_earnings_quality_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-proforma-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Proforma Analysis","operationId":"create_proforma_analysis_quantlib_analysis_create_proforma_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-residual-income-analysis":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Residual Income Analysis","operationId":"create_residual_income_analysis_quantlib_analysis_create_residual_income_analysis_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-business-segment":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Business Segment","operationId":"create_business_segment_quantlib_analysis_create_business_segment_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-geographic-segment":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Geographic Segment","operationId":"create_geographic_segment_quantlib_analysis_create_geographic_segment_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-factor-exposures":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Factor Exposures","operationId":"create_factor_exposures_quantlib_analysis_create_factor_exposures_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-ratio-summary":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Ratio Summary","operationId":"create_ratio_summary_quantlib_analysis_create_ratio_summary_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-risk-factor-summation":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Risk Factor Summation","operationId":"create_risk_factor_summation_quantlib_analysis_create_risk_factor_summation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-milestone":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Milestone","operationId":"create_milestone_quantlib_analysis_create_milestone_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scenario","operationId":"create_scenario_quantlib_analysis_create_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/create-scorecard-factors":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Scorecard Factors","operationId":"create_scorecard_factors_quantlib_analysis_create_scorecard_factors_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/analysis/risk-levels":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Risk Levels","description":"Get available risk level values","operationId":"get_risk_levels_quantlib_analysis_risk_levels_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/analysis/startup-stages":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Startup Stages","description":"Get available startup stage values","operationId":"get_startup_stages_quantlib_analysis_startup_stages_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/regulatory/info":{"get":{"tags":["quantlib-enterprise"],"summary":"Regulatory Module Info","description":"Regulatory module information","operationId":"regulatory_module_info_quantlib_regulatory_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/regulatory/calculate-cet1-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Cet1 Ratio","operationId":"calculate_cet1_ratio_quantlib_regulatory_calculate_cet1_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-tier1-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Tier1 Ratio","operationId":"calculate_tier1_ratio_quantlib_regulatory_calculate_tier1_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-total-capital-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Total Capital Ratio","operationId":"calculate_total_capital_ratio_quantlib_regulatory_calculate_total_capital_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-leverage-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Leverage Ratio","operationId":"calculate_leverage_ratio_quantlib_regulatory_calculate_leverage_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-lcr":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Lcr","operationId":"calculate_lcr_quantlib_regulatory_calculate_lcr_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-nsfr":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Nsfr","operationId":"calculate_nsfr_quantlib_regulatory_calculate_nsfr_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-pfe":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Pfe","operationId":"calculate_pfe_quantlib_regulatory_calculate_pfe_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-rc":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Rc","operationId":"calculate_rc_quantlib_regulatory_calculate_rc_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/calculate-ead-ccr":{"post":{"tags":["quantlib-enterprise"],"summary":"Calculate Ead Ccr","operationId":"calculate_ead_ccr_quantlib_regulatory_calculate_ead_ccr_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/addon-aggregation":{"post":{"tags":["quantlib-enterprise"],"summary":"Addon Aggregation","operationId":"addon_aggregation_quantlib_regulatory_addon_aggregation_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/assess-stage":{"post":{"tags":["quantlib-enterprise"],"summary":"Assess Stage","operationId":"assess_stage_quantlib_regulatory_assess_stage_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/significant-increase-in-credit-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Significant Increase In Credit Risk","operationId":"significant_increase_in_credit_risk_quantlib_regulatory_significant_increase_in_credit_risk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/twelve-month-ecl":{"post":{"tags":["quantlib-enterprise"],"summary":"Twelve Month Ecl","operationId":"twelve_month_ecl_quantlib_regulatory_twelve_month_ecl_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/lifetime-ecl":{"post":{"tags":["quantlib-enterprise"],"summary":"Lifetime Ecl","operationId":"lifetime_ecl_quantlib_regulatory_lifetime_ecl_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/project-capital-ratios":{"post":{"tags":["quantlib-enterprise"],"summary":"Project Capital Ratios","operationId":"project_capital_ratios_quantlib_regulatory_project_capital_ratios_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-basel-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Basel Calculator","operationId":"create_basel_calculator_quantlib_regulatory_create_basel_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-capital-ratios":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Capital Ratios","operationId":"create_capital_ratios_quantlib_regulatory_create_capital_ratios_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-cet1":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cet1","operationId":"create_cet1_quantlib_regulatory_create_cet1_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-credit-risk-standardized":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Credit Risk Standardized","operationId":"create_credit_risk_standardized_quantlib_regulatory_create_credit_risk_standardized_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-credit-risk-irb":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Credit Risk Irb","operationId":"create_credit_risk_irb_quantlib_regulatory_create_credit_risk_irb_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-ecl-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Ecl Calculator","operationId":"create_ecl_calculator_quantlib_regulatory_create_ecl_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-ccar-test":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Ccar Test","operationId":"create_ccar_test_quantlib_regulatory_create_ccar_test_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-dfast-test":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Dfast Test","operationId":"create_dfast_test_quantlib_regulatory_create_dfast_test_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-class-instance":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Regulatory Class","description":"Universal endpoint for creating regulatory class instances.\nPass 'class_name' and constructor parameters in request body.\n\nSupported classes: AdverseScenario, BaselineScenario, CapitalCharge, CapitalProjection,\nCashInflows, CashOutflows, CreditExposure, DeltaRisk, CurvatureRisk, VegaRisk,\nAvailableStableFunding, RequiredStableFunding, LiquidityCoverageRatio,\nNetStableFundingRatio, AssetClass, AssetClassCCR, MarketRiskCharge,\nOperationalRiskCharge, and 40 more...","operationId":"create_regulatory_class_quantlib_regulatory_create_class_instance_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/basel":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Basel Submodule","operationId":"get_basel_submodule_quantlib_regulatory_submodules_basel_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/frtb":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Frtb Submodule","operationId":"get_frtb_submodule_quantlib_regulatory_submodules_frtb_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/ifrs9":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Ifrs9 Submodule","operationId":"get_ifrs9_submodule_quantlib_regulatory_submodules_ifrs9_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/liquidity":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Liquidity Submodule","operationId":"get_liquidity_submodule_quantlib_regulatory_submodules_liquidity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/saccr":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Saccr Submodule","operationId":"get_saccr_submodule_quantlib_regulatory_submodules_saccr_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/submodules/stress":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Stress Submodule","operationId":"get_stress_submodule_quantlib_regulatory_submodules_stress_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-common-equity-tier1":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Common Equity Tier1","operationId":"create_common_equity_tier1_quantlib_regulatory_create_common_equity_tier1_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-tier1-capital":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Tier1 Capital","operationId":"create_tier1_capital_quantlib_regulatory_create_tier1_capital_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-tier2-capital":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Tier2 Capital","operationId":"create_tier2_capital_quantlib_regulatory_create_tier2_capital_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-credit-exposure":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Credit Exposure","operationId":"create_credit_exposure_quantlib_regulatory_create_credit_exposure_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-risk-weighted-assets":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Risk Weighted Assets","operationId":"create_risk_weighted_assets_quantlib_regulatory_create_risk_weighted_assets_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-leverage-ratio":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Leverage Ratio","operationId":"create_leverage_ratio_quantlib_regulatory_create_leverage_ratio_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-operational-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Operational Risk","operationId":"create_operational_risk_quantlib_regulatory_create_operational_risk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-market-risk-standardized":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Market Risk Standardized","operationId":"create_market_risk_standardized_quantlib_regulatory_create_market_risk_standardized_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-frtb-sa-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Frtb Sa Calculator","operationId":"create_frtb_sa_calculator_quantlib_regulatory_create_frtb_sa_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-delta-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Delta Risk","operationId":"create_delta_risk_quantlib_regulatory_create_delta_risk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-vega-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Vega Risk","operationId":"create_vega_risk_quantlib_regulatory_create_vega_risk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-curvature-risk":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Curvature Risk","operationId":"create_curvature_risk_quantlib_regulatory_create_curvature_risk_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-capital-charge":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Capital Charge","operationId":"create_capital_charge_quantlib_regulatory_create_capital_charge_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-frtb-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Frtb Result","operationId":"create_frtb_result_quantlib_regulatory_create_frtb_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-sensitivity-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Sensitivity Result","operationId":"create_sensitivity_result_quantlib_regulatory_create_sensitivity_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-sensitivity-based-method":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Sensitivity Based Method","operationId":"create_sensitivity_based_method_quantlib_regulatory_create_sensitivity_based_method_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-ifrs9-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Ifrs9 Calculator","operationId":"create_ifrs9_calculator_quantlib_regulatory_create_ifrs9_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-expected-credit-loss":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Expected Credit Loss","operationId":"create_expected_credit_loss_quantlib_regulatory_create_expected_credit_loss_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-stage-assessment":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stage Assessment","operationId":"create_stage_assessment_quantlib_regulatory_create_stage_assessment_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-probability-of-default":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Probability Of Default","operationId":"create_probability_of_default_quantlib_regulatory_create_probability_of_default_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-loss-given-default":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Loss Given Default","operationId":"create_loss_given_default_quantlib_regulatory_create_loss_given_default_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-exposure-at-default":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Exposure At Default","operationId":"create_exposure_at_default_quantlib_regulatory_create_exposure_at_default_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-lcr-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Lcr Calculator","operationId":"create_lcr_calculator_quantlib_regulatory_create_lcr_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-nsfr-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Nsfr Calculator","operationId":"create_nsfr_calculator_quantlib_regulatory_create_nsfr_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-high-quality-liquid-assets":{"post":{"tags":["quantlib-enterprise"],"summary":"Create High Quality Liquid Assets","operationId":"create_high_quality_liquid_assets_quantlib_regulatory_create_high_quality_liquid_assets_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-cash-outflows":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cash Outflows","operationId":"create_cash_outflows_quantlib_regulatory_create_cash_outflows_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-cash-inflows":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Cash Inflows","operationId":"create_cash_inflows_quantlib_regulatory_create_cash_inflows_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-available-stable-funding":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Available Stable Funding","operationId":"create_available_stable_funding_quantlib_regulatory_create_available_stable_funding_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-required-stable-funding":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Required Stable Funding","operationId":"create_required_stable_funding_quantlib_regulatory_create_required_stable_funding_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-liquidity-ratios":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Liquidity Ratios","operationId":"create_liquidity_ratios_quantlib_regulatory_create_liquidity_ratios_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-saccr-calculator":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Saccr Calculator","operationId":"create_saccr_calculator_quantlib_regulatory_create_saccr_calculator_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-replacement-cost":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Replacement Cost","operationId":"create_replacement_cost_quantlib_regulatory_create_replacement_cost_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-potential-future-exposure":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Potential Future Exposure","operationId":"create_potential_future_exposure_quantlib_regulatory_create_potential_future_exposure_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-hedging-set":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Hedging Set","operationId":"create_hedging_set_quantlib_regulatory_create_hedging_set_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-exposure-at-default-ccr":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Exposure At Default Ccr","operationId":"create_exposure_at_default_ccr_quantlib_regulatory_create_exposure_at_default_ccr_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-maturity-factor":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Maturity Factor","operationId":"create_maturity_factor_quantlib_regulatory_create_maturity_factor_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-supervisory-delta":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Supervisory Delta","operationId":"create_supervisory_delta_quantlib_regulatory_create_supervisory_delta_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-stress-test-framework":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Test Framework","operationId":"create_stress_test_framework_quantlib_regulatory_create_stress_test_framework_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-stress-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Scenario","operationId":"create_stress_scenario_quantlib_regulatory_create_stress_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-baseline-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Baseline Scenario","operationId":"create_baseline_scenario_quantlib_regulatory_create_baseline_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-adverse-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Adverse Scenario","operationId":"create_adverse_scenario_quantlib_regulatory_create_adverse_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-severely-adverse-scenario":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Severely Adverse Scenario","operationId":"create_severely_adverse_scenario_quantlib_regulatory_create_severely_adverse_scenario_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-stress-test-result":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Test Result","operationId":"create_stress_test_result_quantlib_regulatory_create_stress_test_result_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-capital-projection":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Capital Projection","operationId":"create_capital_projection_quantlib_regulatory_create_capital_projection_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/create-stress-period":{"post":{"tags":["quantlib-enterprise"],"summary":"Create Stress Period","operationId":"create_stress_period_quantlib_regulatory_create_stress_period_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Req"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"APIKeyHeader":[]}]}},"/quantlib/regulatory/hqla-levels":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Hqla Levels","description":"Get available HQLA (High Quality Liquid Assets) level values","operationId":"get_hqla_levels_quantlib_regulatory_hqla_levels_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/regulatory/risk-classes":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Risk Classes","description":"Get available Basel risk class values","operationId":"get_risk_classes_quantlib_regulatory_risk_classes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/quantlib/regulatory/risk-factors":{"get":{"tags":["quantlib-enterprise"],"summary":"Get Risk Factors","description":"Get available risk factor type values","operationId":"get_risk_factors_quantlib_regulatory_risk_factors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/search/symbols":{"get":{"tags":["search"],"summary":"Http Symbol Search","description":"HTTP endpoint for symbol search (alternative to WebSocket)\n\nQuery params:\n query: Search term\n limit: Maximum results (default 50, max 100)","operationId":"http_symbol_search_search_symbols_get","parameters":[{"name":"query","in":"query","required":false,"schema":{"type":"string","default":"","title":"Query"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/":{"get":{"summary":"Root","description":"API status endpoint","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health Check","description":"System health check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/status":{"get":{"summary":"Auth Status","description":"Check authentication status","operationId":"auth_status_auth_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/test":{"get":{"summary":"Test Endpoint","description":"Test endpoint","operationId":"test_endpoint_test_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/mcp/sync":{"post":{"summary":"Manual Mcp Sync","description":"Manually trigger MCP scripts sync from GitHub (Admin only)\n\nArgs:\n force: Force sync even if not time yet (default False)","operationId":"manual_mcp_sync_mcp_sync_post","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"force","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Force"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mcp/status":{"get":{"summary":"Mcp Status","description":"Get MCP system status (tools available, last sync, etc.)","operationId":"mcp_status_mcp_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AddBusinessDaysRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"days":{"type":"integer","title":"Days"}},"type":"object","required":["start_date","days"],"title":"AddBusinessDaysRequest"},"AdjustDateRequest":{"properties":{"date":{"type":"string","title":"Date"},"business_day_convention":{"type":"string","title":"Business Day Convention","default":"Following"},"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","required":["date"],"title":"AdjustDateRequest"},"AdjustmentRequest":{"properties":{"date":{"type":"string","title":"Date"},"calendar":{"type":"string","title":"Calendar","default":"TARGET"}},"type":"object","required":["date"],"title":"AdjustmentRequest"},"AdvanceDateRequest":{"properties":{"date":{"type":"string","title":"Date"},"period":{"type":"string","title":"Period"},"business_day_convention":{"type":"string","title":"Business Day Convention","default":"Following"},"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","required":["date","period"],"title":"AdvanceDateRequest"},"AircraftRequest":{"properties":{"aircraft_id":{"type":"string","title":"Aircraft Id"}},"type":"object","required":["aircraft_id"],"title":"AircraftRequest"},"AmortizingSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"initial_notional":{"type":"number","title":"Initial Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"amortization_schedule":{"items":{"type":"number"},"type":"array","title":"Amortization Schedule"}},"type":"object","required":["effective_date","termination_date","initial_notional","fixed_rate","amortization_schedule"],"title":"AmortizingSwapRequest"},"AreaSearchRequest":{"properties":{"min_lat":{"type":"number","title":"Min Lat"},"max_lat":{"type":"number","title":"Max Lat"},"min_lng":{"type":"number","title":"Min Lng"},"max_lng":{"type":"number","title":"Max Lng"},"days_ago":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Days Ago"}},"type":"object","required":["min_lat","max_lat","min_lng","max_lng"],"title":"AreaSearchRequest"},"ArithmeticAsianOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"observation_dates":{"items":{"type":"string"},"type":"array","title":"Observation Dates"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","observation_dates","expiry_date"],"title":"ArithmeticAsianOptionRequest"},"AsCurrencyRequest":{"properties":{"value":{"type":"string","title":"Value"}},"type":"object","required":["value"],"title":"AsCurrencyRequest"},"AsianOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"averaging_type":{"type":"string","title":"Averaging Type"},"observation_dates":{"items":{"type":"string"},"type":"array","title":"Observation Dates"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","averaging_type","observation_dates","expiry_date"],"title":"AsianOptionRequest"},"AssetBackedSecurityRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"collateral_type":{"type":"string","title":"Collateral Type"}},"type":"object","required":["issue_date","maturity_date","notional","coupon_rate","collateral_type"],"title":"AssetBackedSecurityRequest"},"AustraliaCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"Settlement"}},"type":"object","title":"AustraliaCalendarRequest"},"BacktestVaRModelRequest":{"properties":{"var_estimates":{"items":{"type":"number"},"type":"array","title":"Var Estimates"},"actual_losses":{"items":{"type":"number"},"type":"array","title":"Actual Losses"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95}},"type":"object","required":["var_estimates","actual_losses"],"title":"BacktestVaRModelRequest"},"BackwardFlatInterpRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x":{"type":"number","title":"X"}},"type":"object","required":["x_values","y_values","x"],"title":"BackwardFlatInterpRequest"},"BarrierOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"barrier_type":{"type":"string","title":"Barrier Type"},"strike":{"type":"number","title":"Strike"},"barrier":{"type":"number","title":"Barrier"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","barrier_type","strike","barrier","expiry_date"],"title":"BarrierOptionRequest"},"BasisSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"index1":{"type":"string","title":"Index1"},"index2":{"type":"string","title":"Index2"},"spread":{"type":"number","title":"Spread","default":0.0}},"type":"object","required":["effective_date","termination_date","notional","index1","index2"],"title":"BasisSwapRequest"},"BlackKarasinskiModelRequest":{"properties":{"r0":{"type":"number","title":"R0"},"a":{"type":"number","title":"A"},"sigma":{"type":"number","title":"Sigma"}},"type":"object","required":["r0","a","sigma"],"title":"BlackKarasinskiModelRequest"},"BlackLittermanRequest":{"properties":{"market_weights":{"items":{"type":"number"},"type":"array","title":"Market Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"views":{"items":{"$ref":"#/components/schemas/ViewRequest"},"type":"array","title":"Views"},"risk_aversion":{"type":"number","title":"Risk Aversion","default":2.5},"tau":{"type":"number","title":"Tau","default":0.025}},"type":"object","required":["market_weights","covariance_matrix","views"],"title":"BlackLittermanRequest"},"Body_extract_pdf_text_research_pdf_extract_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"PDF file to process"}},"type":"object","required":["file"],"title":"Body_extract_pdf_text_research_pdf_extract_post"},"Body_upload_dataset_marketplace_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_dataset_marketplace_upload_post"},"BondFutureRequest":{"properties":{"delivery_date":{"type":"string","title":"Delivery Date"},"basket_bonds":{"items":{"type":"string"},"type":"array","title":"Basket Bonds"},"conversion_factors":{"items":{"type":"number"},"type":"array","title":"Conversion Factors"}},"type":"object","required":["delivery_date","basket_bonds","conversion_factors"],"title":"BondFutureRequest"},"BondPriceResultRequest":{"properties":{"clean_price":{"type":"number","title":"Clean Price"},"dirty_price":{"type":"number","title":"Dirty Price"},"accrued_interest":{"type":"number","title":"Accrued Interest"}},"type":"object","required":["clean_price","dirty_price","accrued_interest"],"title":"BondPriceResultRequest"},"BondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"face_value":{"type":"number","title":"Face Value","default":100.0},"currency":{"type":"string","title":"Currency","default":"USD"}},"type":"object","required":["issue_date","maturity_date"],"title":"BondRequest"},"BootstrapConfigRequest":{"properties":{"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100},"interpolation_method":{"type":"string","title":"Interpolation Method","default":"LINEAR"}},"type":"object","title":"BootstrapConfigRequest"},"BootstrapCurveRequest":{"properties":{"instruments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Instruments"},"config":{"$ref":"#/components/schemas/BootstrapConfigRequest"}},"type":"object","required":["instruments","config"],"title":"BootstrapCurveRequest"},"BootstrapInflationRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"cpi_dates":{"items":{"type":"string"},"type":"array","title":"Cpi Dates"},"cpi_values":{"items":{"type":"number"},"type":"array","title":"Cpi Values"}},"type":"object","required":["reference_date","cpi_dates","cpi_values"],"title":"BootstrapInflationRequest"},"BrazilCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"Settlement"}},"type":"object","title":"BrazilCalendarRequest"},"BrentSolverRequest":{"properties":{"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","title":"BrentSolverRequest"},"BroadcastMessageRequest":{"properties":{"subject":{"type":"string","title":"Subject"},"message":{"type":"string","title":"Message"},"target_users":{"type":"string","title":"Target Users","default":"all"}},"type":"object","required":["subject","message"],"title":"BroadcastMessageRequest"},"BusinessDayAdjustmentRequest":{"properties":{"adjustment_type":{"type":"string","title":"Adjustment Type"}},"type":"object","required":["adjustment_type"],"title":"BusinessDayAdjustmentRequest"},"BusinessDaysBetweenRequest":{"properties":{"from_date":{"type":"string","title":"From Date"},"to_date":{"type":"string","title":"To Date"},"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","required":["from_date","to_date"],"title":"BusinessDaysBetweenRequest"},"CDORequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"attachment_point":{"type":"number","title":"Attachment Point"},"detachment_point":{"type":"number","title":"Detachment Point"}},"type":"object","required":["issue_date","maturity_date","notional","attachment_point","detachment_point"],"title":"CDORequest"},"CDSBootstrapRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"maturities":{"items":{"type":"string"},"type":"array","title":"Maturities"},"spreads":{"items":{"type":"number"},"type":"array","title":"Spreads"},"recovery_rate":{"type":"number","title":"Recovery Rate","default":0.4}},"type":"object","required":["reference_date","maturities","spreads"],"title":"CDSBootstrapRequest"},"CDSResultRequest":{"properties":{"fair_spread":{"type":"number","title":"Fair Spread"},"default_probability":{"type":"number","title":"Default Probability"},"upfront":{"type":"number","title":"Upfront"}},"type":"object","required":["fair_spread","default_probability","upfront"],"title":"CDSResultRequest"},"CIRModelRequest":{"properties":{"r0":{"type":"number","title":"R0"},"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"sigma":{"type":"number","title":"Sigma"}},"type":"object","required":["r0","a","b","sigma"],"title":"CIRModelRequest"},"CLORequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"senior_tranche_pct":{"type":"number","title":"Senior Tranche Pct"}},"type":"object","required":["issue_date","maturity_date","notional","senior_tranche_pct"],"title":"CLORequest"},"CMSSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"cms_tenor":{"type":"string","title":"Cms Tenor"},"spread":{"type":"number","title":"Spread","default":0.0}},"type":"object","required":["effective_date","termination_date","notional","cms_tenor"],"title":"CMSSwapRequest"},"CVACalculatorRequest":{"properties":{"exposure_profile":{"items":{"type":"number"},"type":"array","title":"Exposure Profile"},"credit_parameters":{"$ref":"#/components/schemas/CreditParametersRequest"},"discount_factors":{"items":{"type":"number"},"type":"array","title":"Discount Factors"}},"type":"object","required":["exposure_profile","credit_parameters","discount_factors"],"title":"CVACalculatorRequest"},"CVaRRequest":{"properties":{"returns":{"items":{"type":"number"},"type":"array","title":"Returns"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95}},"type":"object","required":["returns"],"title":"CVaRRequest"},"CalibrateMulticurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"instruments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Instruments"}},"type":"object","required":["reference_date","instruments"],"title":"CalibrateMulticurveRequest"},"CalibrateSABRRequest":{"properties":{"forward":{"type":"number","title":"Forward"},"expiry":{"type":"number","title":"Expiry"},"strikes":{"items":{"type":"number"},"type":"array","title":"Strikes"},"market_vols":{"items":{"type":"number"},"type":"array","title":"Market Vols"},"beta":{"type":"number","title":"Beta","default":0.5}},"type":"object","required":["forward","expiry","strikes","market_vols"],"title":"CalibrateSABRRequest"},"CalibrationResultRequest":{"properties":{"success":{"type":"boolean","title":"Success"},"iterations":{"type":"integer","title":"Iterations"},"final_error":{"type":"number","title":"Final Error"},"parameters":{"items":{"type":"number"},"type":"array","title":"Parameters"}},"type":"object","required":["success","iterations","final_error","parameters"],"title":"CalibrationResultRequest"},"CallProvisionRequest":{"properties":{"call_date":{"type":"string","title":"Call Date"},"call_price":{"type":"number","title":"Call Price"},"call_type":{"type":"string","title":"Call Type","default":"AMERICAN"}},"type":"object","required":["call_date","call_price"],"title":"CallProvisionRequest"},"CallScheduleRequest":{"properties":{"call_dates":{"items":{"type":"string"},"type":"array","title":"Call Dates"},"call_prices":{"items":{"type":"number"},"type":"array","title":"Call Prices"}},"type":"object","required":["call_dates","call_prices"],"title":"CallScheduleRequest"},"CallableBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"call_schedule":{"$ref":"#/components/schemas/CallScheduleRequest"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","coupon_rate","call_schedule"],"title":"CallableBondRequest"},"CallablePuttableBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","coupon_rate"],"title":"CallablePuttableBondRequest"},"CallablePuttableSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate"],"title":"CallablePuttableSwapRequest"},"CallableSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"call_dates":{"items":{"type":"string"},"type":"array","title":"Call Dates"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","call_dates"],"title":"CallableSwapRequest"},"CanadaCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","title":"CanadaCalendarRequest"},"CapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"strike_rate":{"type":"number","title":"Strike Rate"},"index_name":{"type":"string","title":"Index Name"}},"type":"object","required":["effective_date","termination_date","notional","strike_rate","index_name"],"title":"CapRequest"},"CappedFlooredSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"cap_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Cap Rate"},"floor_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Floor Rate"}},"type":"object","required":["effective_date","termination_date","notional"],"title":"CappedFlooredSwapRequest"},"CashflowsRequest":{"properties":{"leg_type":{"type":"string","title":"Leg Type"},"notional":{"type":"number","title":"Notional"},"rate":{"type":"number","title":"Rate"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"}},"type":"object","required":["leg_type","notional","rate","start_date","end_date"],"title":"CashflowsRequest"},"CatastropheBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"trigger_event":{"type":"string","title":"Trigger Event"}},"type":"object","required":["issue_date","maturity_date","notional","coupon_rate","trigger_event"],"title":"CatastropheBondRequest"},"CertificateOfDepositRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"rate":{"type":"number","title":"Rate"}},"type":"object","required":["issue_date","maturity_date","notional","rate"],"title":"CertificateOfDepositRequest"},"ChatMessageCreate":{"properties":{"content":{"type":"string","title":"Content"}},"type":"object","required":["content"],"title":"ChatMessageCreate"},"ChatRequest":{"properties":{"messages":{"items":{},"type":"array","title":"Messages"},"model":{"type":"string","title":"Model","default":"meituan/longcat-flash-chat:free"}},"type":"object","required":["messages"],"title":"ChatRequest"},"ChatSessionCreate":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","default":"New Conversation"}},"type":"object","title":"ChatSessionCreate"},"ChinaCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"SSE"}},"type":"object","title":"ChinaCalendarRequest"},"ChooserOptionRequest":{"properties":{"strike":{"type":"number","title":"Strike"},"choice_date":{"type":"string","title":"Choice Date"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["strike","choice_date","expiry_date"],"title":"ChooserOptionRequest"},"CoerceFloatRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"CoerceFloatRequest"},"CoerceToListRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"CoerceToListRequest"},"CollarRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"cap_rate":{"type":"number","title":"Cap Rate"},"floor_rate":{"type":"number","title":"Floor Rate"}},"type":"object","required":["effective_date","termination_date","notional","cap_rate","floor_rate"],"title":"CollarRequest"},"CombinedCalendarRequest":{"properties":{"calendar1":{"type":"string","title":"Calendar1"},"calendar2":{"type":"string","title":"Calendar2"}},"type":"object","required":["calendar1","calendar2"],"title":"CombinedCalendarRequest"},"CommercialPaperRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"face_value":{"type":"number","title":"Face Value"},"discount_rate":{"type":"number","title":"Discount Rate"}},"type":"object","required":["issue_date","maturity_date","face_value","discount_rate"],"title":"CommercialPaperRequest"},"CommodityFutureRequest":{"properties":{"delivery_date":{"type":"string","title":"Delivery Date"},"commodity_type":{"type":"string","title":"Commodity Type"},"quantity":{"type":"number","title":"Quantity"},"price":{"type":"number","title":"Price"}},"type":"object","required":["delivery_date","commodity_type","quantity","price"],"title":"CommodityFutureRequest"},"CommodityIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"commodity_type":{"type":"string","title":"Commodity Type"}},"type":"object","required":["name","commodity_type"],"title":"CommodityIndexRequest"},"CommodityOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"commodity_type":{"type":"string","title":"Commodity Type"}},"type":"object","required":["option_type","strike","expiry_date","commodity_type"],"title":"CommodityOptionRequest"},"CommoditySwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_price":{"type":"number","title":"Fixed Price"},"commodity_type":{"type":"string","title":"Commodity Type"}},"type":"object","required":["effective_date","termination_date","notional","fixed_price","commodity_type"],"title":"CommoditySwapRequest"},"ComponentRiskRequest":{"properties":{"weights":{"items":{"type":"number"},"type":"array","title":"Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"}},"type":"object","required":["weights","covariance_matrix"],"title":"ComponentRiskRequest"},"ComponentVaRCalculatorRequest":{"properties":{"weights":{"items":{"type":"number"},"type":"array","title":"Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95}},"type":"object","required":["weights","covariance_matrix"],"title":"ComponentVaRCalculatorRequest"},"CompoundOptionRequest":{"properties":{"underlying_option_type":{"type":"string","title":"Underlying Option Type"},"compound_option_type":{"type":"string","title":"Compound Option Type"},"underlying_strike":{"type":"number","title":"Underlying Strike"},"compound_strike":{"type":"number","title":"Compound Strike"},"compound_expiry":{"type":"string","title":"Compound Expiry"},"underlying_expiry":{"type":"string","title":"Underlying Expiry"}},"type":"object","required":["underlying_option_type","compound_option_type","underlying_strike","compound_strike","compound_expiry","underlying_expiry"],"title":"CompoundOptionRequest"},"CompoundedRFRSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"rfr_index":{"type":"string","title":"Rfr Index"},"spread":{"type":"number","title":"Spread","default":0.0}},"type":"object","required":["effective_date","termination_date","notional","rfr_index"],"title":"CompoundedRFRSwapRequest"},"ConstantHazardRateRequest":{"properties":{"hazard_rate":{"type":"number","title":"Hazard Rate"},"reference_date":{"type":"string","title":"Reference Date"}},"type":"object","required":["hazard_rate","reference_date"],"title":"ConstantHazardRateRequest"},"ContactFormCreate":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"subject":{"type":"string","title":"Subject"},"message":{"type":"string","title":"Message"}},"type":"object","required":["name","email","subject","message"],"title":"ContactFormCreate"},"ContentReaderRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"},"format":{"type":"string","title":"Format","default":"markdown"}},"type":"object","required":["url"],"title":"ContentReaderRequest"},"ConversionTermsRequest":{"properties":{"conversion_ratio":{"type":"number","title":"Conversion Ratio"},"conversion_price":{"type":"number","title":"Conversion Price"},"conversion_start":{"type":"string","title":"Conversion Start"},"conversion_end":{"type":"string","title":"Conversion End"}},"type":"object","required":["conversion_ratio","conversion_price","conversion_start","conversion_end"],"title":"ConversionTermsRequest"},"ConversionTriggerRequest":{"properties":{"trigger_type":{"type":"string","title":"Trigger Type"},"trigger_level":{"type":"number","title":"Trigger Level"},"observation_period":{"type":"string","title":"Observation Period"}},"type":"object","required":["trigger_type","trigger_level","observation_period"],"title":"ConversionTriggerRequest"},"ConvertibleBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"conversion_ratio":{"type":"number","title":"Conversion Ratio"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","coupon_rate","conversion_ratio"],"title":"ConvertibleBondRequest"},"CorrelationRequest":{"properties":{"data_x":{"items":{"type":"number"},"type":"array","title":"Data X"},"data_y":{"items":{"type":"number"},"type":"array","title":"Data Y"}},"type":"object","required":["data_x","data_y"],"title":"CorrelationRequest"},"CreateCurrencyRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"CreateCurrencyRequest"},"CreateCurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"tenors":{"items":{"type":"number"},"type":"array","title":"Tenors","description":"Tenors in years"},"values":{"items":{"type":"number"},"type":"array","title":"Values","description":"Discount factors or rates"},"interpolation":{"type":"string","title":"Interpolation","description":"Interpolation method","default":"LINEAR"}},"type":"object","required":["reference_date","tenors","values"],"title":"CreateCurveRequest"},"CreateDualRequest":{"properties":{"value":{"type":"number","title":"Value"},"derivative":{"type":"number","title":"Derivative","default":1.0}},"type":"object","required":["value"],"title":"CreateDualRequest"},"CreateFeePaymentRequest":{"properties":{"payment_date":{"type":"string","title":"Payment Date"},"amount":{"type":"number","title":"Amount"}},"type":"object","required":["payment_date","amount"],"title":"CreateFeePaymentRequest"},"CreateFixedLegRequest":{"properties":{"notional":{"type":"number","title":"Notional"},"rate":{"type":"number","title":"Rate"},"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"frequency":{"type":"string","title":"Frequency","default":"SEMI_ANNUAL"}},"type":"object","required":["notional","rate","start_date","end_date"],"title":"CreateFixedLegRequest"},"CreateFixedPeriodRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"notional":{"type":"number","title":"Notional"},"rate":{"type":"number","title":"Rate"}},"type":"object","required":["start_date","end_date","notional","rate"],"title":"CreateFixedPeriodRequest"},"CreateHyperDualRequest":{"properties":{"value":{"type":"number","title":"Value"},"first_derivative":{"type":"number","title":"First Derivative","default":1.0},"second_derivative":{"type":"number","title":"Second Derivative","default":0.0}},"type":"object","required":["value"],"title":"CreateHyperDualRequest"},"CreateMoneyRequest":{"properties":{"amount":{"type":"number","title":"Amount"},"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["amount","currency_code"],"title":"CreateMoneyRequest"},"CreateNotionalScheduleRequest":{"properties":{"dates":{"items":{"type":"string"},"type":"array","title":"Dates"},"notionals":{"items":{"type":"number"},"type":"array","title":"Notionals"}},"type":"object","required":["dates","notionals"],"title":"CreateNotionalScheduleRequest"},"CreateOrderRequest":{"properties":{"plan_id":{"type":"string","title":"Plan Id"},"currency":{"type":"string","title":"Currency","default":"USD"},"return_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return Url"},"customer_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Phone"}},"type":"object","required":["plan_id"],"title":"CreateOrderRequest","description":"Request model for creating Cashfree payment order"},"CreatePrincipalExchangeRequest":{"properties":{"exchange_date":{"type":"string","title":"Exchange Date"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["exchange_date","notional"],"title":"CreatePrincipalExchangeRequest"},"CreateRateRequest":{"properties":{"value":{"type":"number","title":"Value"},"unit":{"type":"string","title":"Unit","default":"PERCENT"}},"type":"object","required":["value"],"title":"CreateRateRequest"},"CreateSpreadRequest":{"properties":{"value":{"type":"number","title":"Value"}},"type":"object","required":["value"],"title":"CreateSpreadRequest"},"CreateTenorRequest":{"properties":{"tenor_string":{"type":"string","title":"Tenor String"}},"type":"object","required":["tenor_string"],"title":"CreateTenorRequest"},"CreditAdjustmentRequest":{"properties":{"action":{"type":"string","title":"Action"},"amount":{"type":"integer","title":"Amount"},"reason":{"type":"string","title":"Reason","default":"Admin adjustment"}},"type":"object","required":["action","amount"],"title":"CreditAdjustmentRequest"},"CreditDefaultSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"spread":{"type":"number","title":"Spread"},"recovery_rate":{"type":"number","title":"Recovery Rate","default":0.4}},"type":"object","required":["effective_date","termination_date","notional","spread"],"title":"CreditDefaultSwapRequest"},"CreditLinkedNoteRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"reference_entity":{"type":"string","title":"Reference Entity"}},"type":"object","required":["issue_date","maturity_date","notional","coupon_rate","reference_entity"],"title":"CreditLinkedNoteRequest"},"CreditParametersRequest":{"properties":{"default_probability":{"type":"number","title":"Default Probability"},"recovery_rate":{"type":"number","title":"Recovery Rate"},"credit_spread":{"type":"number","title":"Credit Spread"}},"type":"object","required":["default_probability","recovery_rate","credit_spread"],"title":"CreditParametersRequest"},"CrossCurrencyBasisSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"spread":{"type":"number","title":"Spread"}},"type":"object","required":["effective_date","termination_date","notional","spread"],"title":"CrossCurrencyBasisSwapRequest"},"CrossCurrencySwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional_domestic":{"type":"number","title":"Notional Domestic"},"notional_foreign":{"type":"number","title":"Notional Foreign"},"domestic_currency":{"type":"string","title":"Domestic Currency"},"foreign_currency":{"type":"string","title":"Foreign Currency"}},"type":"object","required":["effective_date","termination_date","notional_domestic","notional_foreign","domestic_currency","foreign_currency"],"title":"CrossCurrencySwapRequest"},"CurrencyRequest":{"properties":{"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["currency_code"],"title":"CurrencyRequest"},"CurveSolverRequest":{"properties":{"config":{"$ref":"#/components/schemas/BootstrapConfigRequest"}},"type":"object","required":["config"],"title":"CurveSolverRequest"},"DatabaseCreateRequest":{"properties":{"database_name":{"type":"string","title":"Database Name"},"display_name":{"type":"string","title":"Display Name"},"description":{"type":"string","title":"Description","default":""},"category":{"type":"string","title":"Category","default":"general"},"is_public":{"type":"boolean","title":"Is Public","default":false},"requires_subscription":{"type":"boolean","title":"Requires Subscription","default":true},"cost_per_request":{"type":"integer","title":"Cost Per Request","default":20},"free_tier_limit":{"type":"integer","title":"Free Tier Limit","default":10},"total_tables":{"type":"integer","title":"Total Tables","default":0}},"type":"object","required":["database_name","display_name"],"title":"DatabaseCreateRequest"},"DatabaseSubscriptionRequest":{"properties":{"database_name":{"type":"string","title":"Database Name"}},"type":"object","required":["database_name"],"title":"DatabaseSubscriptionRequest"},"DateCheckRequest":{"properties":{"date":{"type":"string","title":"Date"}},"type":"object","required":["date"],"title":"DateCheckRequest"},"DateRangeRequest":{"properties":{"start_date":{"type":"string","format":"date-time","title":"Start Date"},"end_date":{"type":"string","format":"date-time","title":"End Date"},"domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Domains"},"category":{"anyOf":[{"$ref":"#/components/schemas/NewsCategory"},{"type":"null"}]},"limit":{"type":"integer","title":"Limit","default":10}},"type":"object","required":["start_date","end_date"],"title":"DateRangeRequest"},"DateToExcelRequest":{"properties":{"date_str":{"type":"string","title":"Date Str"}},"type":"object","required":["date_str"],"title":"DateToExcelRequest"},"DepositRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"rate":{"type":"number","title":"Rate"}},"type":"object","required":["start_date","maturity_date","notional","rate"],"title":"DepositRequest"},"DeterminantRequest":{"properties":{"matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix"}},"type":"object","required":["matrix"],"title":"DeterminantRequest"},"DeviceRegistration":{"properties":{"device_id":{"type":"string","title":"Device Id"},"device_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Name"},"platform":{"type":"string","title":"Platform"},"hardware_info":{"additionalProperties":true,"type":"object","title":"Hardware Info"}},"type":"object","required":["device_id","platform","hardware_info"],"title":"DeviceRegistration"},"DigitalOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"payout":{"type":"number","title":"Payout"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","payout","expiry_date"],"title":"DigitalOptionRequest"},"DiscreteBarrierOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"barrier_type":{"type":"string","title":"Barrier Type"},"strike":{"type":"number","title":"Strike"},"barrier":{"type":"number","title":"Barrier"},"observation_dates":{"items":{"type":"string"},"type":"array","title":"Observation Dates"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","barrier_type","strike","barrier","observation_dates","expiry_date"],"title":"DiscreteBarrierOptionRequest"},"DoubleBarrierOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"lower_barrier":{"type":"number","title":"Lower Barrier"},"upper_barrier":{"type":"number","title":"Upper Barrier"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","lower_barrier","upper_barrier","expiry_date"],"title":"DoubleBarrierOptionRequest"},"DupireLocalVolRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"dividend_yield":{"type":"number","title":"Dividend Yield"},"volatility_surface":{"$ref":"#/components/schemas/VolatilitySurfaceRequest"}},"type":"object","required":["spot","risk_free_rate","dividend_yield","volatility_surface"],"title":"DupireLocalVolRequest"},"EfficientFrontierRequest":{"properties":{"expected_returns":{"items":{"type":"number"},"type":"array","title":"Expected Returns"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"num_portfolios":{"type":"integer","title":"Num Portfolios","default":100}},"type":"object","required":["expected_returns","covariance_matrix"],"title":"EfficientFrontierRequest"},"EqualRiskContributionRequest":{"properties":{"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"}},"type":"object","required":["covariance_matrix"],"title":"EqualRiskContributionRequest"},"EquilibriumReturnsRequest":{"properties":{"market_weights":{"items":{"type":"number"},"type":"array","title":"Market Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"risk_aversion":{"type":"number","title":"Risk Aversion","default":2.5}},"type":"object","required":["market_weights","covariance_matrix"],"title":"EquilibriumReturnsRequest"},"EquitySwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"equity_leg_return":{"type":"string","title":"Equity Leg Return"},"fixed_leg_rate":{"type":"number","title":"Fixed Leg Rate"}},"type":"object","required":["effective_date","termination_date","notional","equity_leg_return","fixed_leg_rate"],"title":"EquitySwapRequest"},"ExchangeOptionRequest":{"properties":{"expiry_date":{"type":"string","title":"Expiry Date"},"quantity1":{"type":"number","title":"Quantity1"},"quantity2":{"type":"number","title":"Quantity2"}},"type":"object","required":["expiry_date","quantity1","quantity2"],"title":"ExchangeOptionRequest"},"ExecutionTimeRequest":{"properties":{"function_name":{"type":"string","title":"Function Name"},"execution_time":{"type":"number","title":"Execution Time"}},"type":"object","required":["function_name","execution_time"],"title":"ExecutionTimeRequest"},"ExoticBarrierOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"barrier_type":{"type":"string","title":"Barrier Type"},"strike":{"type":"number","title":"Strike"},"barrier":{"type":"number","title":"Barrier"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","barrier_type","strike","barrier","expiry_date"],"title":"ExoticBarrierOptionRequest"},"ExtrapolateLinearRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x":{"type":"number","title":"X"}},"type":"object","required":["x_values","y_values","x"],"title":"ExtrapolateLinearRequest"},"ExtrapolationRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x":{"type":"number","title":"X"}},"type":"object","required":["x_values","y_values","x"],"title":"ExtrapolationRequest"},"FRARequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"notional":{"type":"number","title":"Notional"},"agreed_rate":{"type":"number","title":"Agreed Rate"},"index_name":{"type":"string","title":"Index Name"}},"type":"object","required":["start_date","end_date","notional","agreed_rate","index_name"],"title":"FRARequest"},"FVACalculatorRequest":{"properties":{"exposure_profile":{"items":{"type":"number"},"type":"array","title":"Exposure Profile"},"funding_parameters":{"$ref":"#/components/schemas/FundingParametersRequest"},"discount_factors":{"items":{"type":"number"},"type":"array","title":"Discount Factors"}},"type":"object","required":["exposure_profile","funding_parameters","discount_factors"],"title":"FVACalculatorRequest"},"FXFixingRequest":{"properties":{"index_name":{"type":"string","title":"Index Name"},"fixing_date":{"type":"string","title":"Fixing Date"},"value":{"type":"number","title":"Value"},"base_currency":{"type":"string","title":"Base Currency"},"quote_currency":{"type":"string","title":"Quote Currency"},"source":{"type":"string","title":"Source","default":"Manual"}},"type":"object","required":["index_name","fixing_date","value","base_currency","quote_currency"],"title":"FXFixingRequest"},"FXForwardCalculatorRequest":{"properties":{"pair":{"type":"string","title":"Pair","description":"Currency pair (e.g., 'EURUSD')"},"spot":{"type":"number","title":"Spot","description":"Spot rate"},"base_curve":{"items":{"additionalProperties":{"type":"number"},"type":"object"},"type":"array","title":"Base Curve","description":"Base currency discount curve"},"quote_curve":{"items":{"additionalProperties":{"type":"number"},"type":"object"},"type":"array","title":"Quote Curve","description":"Quote currency discount curve"},"spot_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spot Date","description":"Spot date (YYYY-MM-DD)"},"continuous":{"type":"boolean","title":"Continuous","description":"Use continuous compounding","default":true}},"type":"object","required":["pair","spot","base_curve","quote_curve"],"title":"FXForwardCalculatorRequest"},"FXForwardPointsRequest":{"properties":{"spot":{"type":"number","title":"Spot","description":"Spot rate"},"base_rate":{"type":"number","title":"Base Rate","description":"Base currency interest rate"},"quote_rate":{"type":"number","title":"Quote Rate","description":"Quote currency interest rate"},"days":{"type":"integer","title":"Days","description":"Days to forward date"},"pair":{"type":"string","title":"Pair","description":"Currency pair"},"in_pips":{"type":"boolean","title":"In Pips","description":"Return result in pips","default":true}},"type":"object","required":["spot","base_rate","quote_rate","days","pair"],"title":"FXForwardPointsRequest"},"FXForwardQuoteRequest":{"properties":{"base":{"type":"string","title":"Base"},"quote":{"type":"string","title":"Quote"},"spot":{"type":"number","title":"Spot"},"forward_points":{"type":"number","title":"Forward Points"},"value_date":{"type":"string","title":"Value Date"}},"type":"object","required":["base","quote","spot","forward_points","value_date"],"title":"FXForwardQuoteRequest"},"FXForwardRequest":{"properties":{"settlement_date":{"type":"string","title":"Settlement Date"},"domestic_currency":{"type":"string","title":"Domestic Currency"},"foreign_currency":{"type":"string","title":"Foreign Currency"},"notional":{"type":"number","title":"Notional"},"forward_rate":{"type":"number","title":"Forward Rate"}},"type":"object","required":["settlement_date","domestic_currency","foreign_currency","notional","forward_rate"],"title":"FXForwardRequest"},"FXIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"base_currency":{"type":"string","title":"Base Currency"},"quote_currency":{"type":"string","title":"Quote Currency"}},"type":"object","required":["name","base_currency","quote_currency"],"title":"FXIndexRequest"},"FXOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"domestic_currency":{"type":"string","title":"Domestic Currency"},"foreign_currency":{"type":"string","title":"Foreign Currency"}},"type":"object","required":["option_type","strike","expiry_date","domestic_currency","foreign_currency"],"title":"FXOptionRequest"},"FXOutrightForwardRequest":{"properties":{"spot":{"type":"number","title":"Spot","description":"Spot rate"},"base_rate":{"type":"number","title":"Base Rate","description":"Base currency interest rate"},"quote_rate":{"type":"number","title":"Quote Rate","description":"Quote currency interest rate"},"days":{"type":"integer","title":"Days","description":"Days to forward date"}},"type":"object","required":["spot","base_rate","quote_rate","days"],"title":"FXOutrightForwardRequest"},"FXQuoteRequest":{"properties":{"base":{"type":"string","title":"Base","description":"Base currency (e.g., 'USD')"},"quote":{"type":"string","title":"Quote","description":"Quote currency (e.g., 'EUR')"},"mid":{"type":"number","title":"Mid","description":"Mid rate"},"bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Bid","description":"Bid rate"},"ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ask","description":"Ask rate"},"value_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Date","description":"Value date (YYYY-MM-DD)"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","description":"Quote source"}},"type":"object","required":["base","quote","mid"],"title":"FXQuoteRequest"},"FXRateMatrixRequest":{"properties":{"value_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value Date","description":"Value date (YYYY-MM-DD)"},"quotes":{"items":{"$ref":"#/components/schemas/FXQuoteRequest"},"type":"array","title":"Quotes","description":"List of FX quotes"}},"type":"object","required":["quotes"],"title":"FXRateMatrixRequest"},"FXSpotRequest":{"properties":{"settlement_date":{"type":"string","title":"Settlement Date"},"rate":{"type":"number","title":"Rate"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["settlement_date","rate","notional"],"title":"FXSpotRequest"},"FXSwapRequest":{"properties":{"near_date":{"type":"string","title":"Near Date"},"far_date":{"type":"string","title":"Far Date"},"notional":{"type":"number","title":"Notional"},"near_rate":{"type":"number","title":"Near Rate"},"far_rate":{"type":"number","title":"Far Rate"}},"type":"object","required":["near_date","far_date","notional","near_rate","far_rate"],"title":"FXSwapRequest"},"FeedbackCreate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"rating":{"type":"integer","title":"Rating"},"feedback_text":{"type":"string","title":"Feedback Text"},"category":{"type":"string","title":"Category","default":"general"}},"type":"object","required":["rating","feedback_text"],"title":"FeedbackCreate"},"FindIntervalRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"x":{"type":"number","title":"X"}},"type":"object","required":["x_values","x"],"title":"FindIntervalRequest"},"FiniteDifferenceRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"x":{"type":"number","title":"X"},"h":{"type":"number","title":"H","default":1e-05}},"type":"object","required":["func_name","x"],"title":"FiniteDifferenceRequest"},"FirstToDefaultSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"spread":{"type":"number","title":"Spread"},"reference_names":{"items":{"type":"string"},"type":"array","title":"Reference Names"}},"type":"object","required":["effective_date","termination_date","notional","spread","reference_names"],"title":"FirstToDefaultSwapRequest"},"FixedRateBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"frequency":{"type":"string","title":"Frequency","default":"SEMI_ANNUAL"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","coupon_rate"],"title":"FixedRateBondRequest"},"FixedStrikeLookbackRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","expiry_date"],"title":"FixedStrikeLookbackRequest"},"FlatVolatilityRequest":{"properties":{"volatility":{"type":"number","title":"Volatility"},"reference_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reference Date"}},"type":"object","required":["volatility"],"title":"FlatVolatilityRequest"},"FloatingRateBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"index_name":{"type":"string","title":"Index Name"},"spread":{"type":"number","title":"Spread","default":0.0},"frequency":{"type":"string","title":"Frequency","default":"QUARTERLY"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","index_name"],"title":"FloatingRateBondRequest"},"FloatingStrikeLookbackRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","expiry_date"],"title":"FloatingStrikeLookbackRequest"},"FloorRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"strike_rate":{"type":"number","title":"Strike Rate"},"index_name":{"type":"string","title":"Index Name"}},"type":"object","required":["effective_date","termination_date","notional","strike_rate","index_name"],"title":"FloorRequest"},"ForumCommentCreate":{"properties":{"content":{"type":"string","title":"Content"},"parent_comment_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Parent Comment Id"}},"type":"object","required":["content"],"title":"ForumCommentCreate"},"ForumPostCreate":{"properties":{"title":{"type":"string","title":"Title"},"content":{"type":"string","title":"Content"},"category_id":{"type":"integer","title":"Category Id"}},"type":"object","required":["title","content","category_id"],"title":"ForumPostCreate"},"ForumProfileUpdate":{"properties":{"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"bio":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bio"},"avatar_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Color"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"},"show_email":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Show Email"},"email_notifications":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email Notifications"}},"type":"object","title":"ForumProfileUpdate"},"ForumVoteCreate":{"properties":{"vote_type":{"type":"string","title":"Vote Type"}},"type":"object","required":["vote_type"],"title":"ForumVoteCreate"},"ForwardFlatInterpRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x":{"type":"number","title":"X"}},"type":"object","required":["x_values","y_values","x"],"title":"ForwardFlatInterpRequest"},"ForwardRequest":{"properties":{"settlement_date":{"type":"string","title":"Settlement Date"},"forward_price":{"type":"number","title":"Forward Price"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["settlement_date","forward_price","notional"],"title":"ForwardRequest"},"ForwardStartOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"start_date":{"type":"string","title":"Start Date"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","start_date","expiry_date"],"title":"ForwardStartOptionRequest"},"FranceCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","title":"FranceCalendarRequest"},"FunctionCallLogRequest":{"properties":{"function_name":{"type":"string","title":"Function Name"},"args":{"items":{},"type":"array","title":"Args","default":[]}},"type":"object","required":["function_name"],"title":"FunctionCallLogRequest"},"FundingParametersRequest":{"properties":{"funding_spread":{"type":"number","title":"Funding Spread"},"collateral_rate":{"type":"number","title":"Collateral Rate"}},"type":"object","required":["funding_spread","collateral_rate"],"title":"FundingParametersRequest"},"FuturesContractRequest":{"properties":{"delivery_date":{"type":"string","title":"Delivery Date"},"contract_size":{"type":"number","title":"Contract Size"},"price":{"type":"number","title":"Price"}},"type":"object","required":["delivery_date","contract_size","price"],"title":"FuturesContractRequest"},"GaussNewtonRequest":{"properties":{"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","title":"GaussNewtonRequest"},"GeometricAsianOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"observation_dates":{"items":{"type":"string"},"type":"array","title":"Observation Dates"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","observation_dates","expiry_date"],"title":"GeometricAsianOptionRequest"},"GermanyCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","title":"GermanyCalendarRequest"},"GetCalendarRequest":{"properties":{"calendar_name":{"type":"string","title":"Calendar Name"}},"type":"object","required":["calendar_name"],"title":"GetCalendarRequest"},"GetIndexRequest":{"properties":{"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"GetIndexRequest"},"GoldenSectionRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"tolerance":{"type":"number","title":"Tolerance","default":1e-06}},"type":"object","required":["func_name","a","b"],"title":"GoldenSectionRequest"},"GradientRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"x":{"items":{"type":"number"},"type":"array","title":"X"}},"type":"object","required":["func_name","x"],"title":"GradientRequest"},"GreeksRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"strike":{"type":"number","title":"Strike"},"expiry":{"type":"number","title":"Expiry"},"volatility":{"type":"number","title":"Volatility"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"option_type":{"type":"string","title":"Option Type","default":"CALL"}},"type":"object","required":["spot","strike","expiry","volatility","risk_free_rate"],"title":"GreeksRequest"},"GrokipediaRequest":{"properties":{"slug":{"type":"string","title":"Slug"},"extract_refs":{"type":"boolean","title":"Extract Refs","default":true},"truncate":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Truncate"},"citations":{"type":"boolean","title":"Citations","default":false}},"type":"object","required":["slug"],"title":"GrokipediaRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HermiteInterpRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"derivatives":{"items":{"type":"number"},"type":"array","title":"Derivatives"},"x_interp":{"type":"number","title":"X Interp"}},"type":"object","required":["x_values","y_values","derivatives","x_interp"],"title":"HermiteInterpRequest"},"HestonModelRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"dividend_yield":{"type":"number","title":"Dividend Yield"},"parameters":{"$ref":"#/components/schemas/HestonParametersRequest"}},"type":"object","required":["spot","risk_free_rate","dividend_yield","parameters"],"title":"HestonModelRequest"},"HestonParametersRequest":{"properties":{"v0":{"type":"number","title":"V0","description":"Initial variance"},"kappa":{"type":"number","title":"Kappa","description":"Mean reversion speed"},"theta":{"type":"number","title":"Theta","description":"Long-term variance"},"sigma":{"type":"number","title":"Sigma","description":"Volatility of volatility"},"rho":{"type":"number","title":"Rho","description":"Correlation"}},"type":"object","required":["v0","kappa","theta","sigma","rho"],"title":"HestonParametersRequest"},"HierarchicalRiskParityRequest":{"properties":{"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"expected_returns":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Expected Returns"}},"type":"object","required":["covariance_matrix"],"title":"HierarchicalRiskParityRequest"},"HistoricalVaRRequest":{"properties":{"returns":{"items":{"type":"number"},"type":"array","title":"Returns"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95},"lookback_period":{"type":"integer","title":"Lookback Period","default":252}},"type":"object","required":["returns"],"title":"HistoricalVaRRequest"},"HullWhiteModelRequest":{"properties":{"r0":{"type":"number","title":"R0"},"a":{"type":"number","title":"A"},"sigma":{"type":"number","title":"Sigma"}},"type":"object","required":["r0","a","sigma"],"title":"HullWhiteModelRequest"},"IBORFixingRequest":{"properties":{"index_name":{"type":"string","title":"Index Name"},"fixing_date":{"type":"string","title":"Fixing Date"},"value":{"type":"number","title":"Value"},"tenor":{"type":"string","title":"Tenor"},"source":{"type":"string","title":"Source","default":"Manual"}},"type":"object","required":["index_name","fixing_date","value","tenor"],"title":"IBORFixingRequest"},"IBORIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"currency":{"type":"string","title":"Currency"},"tenor":{"type":"string","title":"Tenor"}},"type":"object","required":["name","currency","tenor"],"title":"IBORIndexRequest"},"IMMDateCheckRequest":{"properties":{"date":{"type":"string","title":"Date"}},"type":"object","required":["date"],"title":"IMMDateCheckRequest"},"IncrementalVaRCalculatorRequest":{"properties":{"portfolio_var":{"type":"number","title":"Portfolio Var"},"asset_weights":{"items":{"type":"number"},"type":"array","title":"Asset Weights"}},"type":"object","required":["portfolio_var","asset_weights"],"title":"IncrementalVaRCalculatorRequest"},"IndiaCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"NSE"}},"type":"object","title":"IndiaCalendarRequest"},"InflationFixingRequest":{"properties":{"index_name":{"type":"string","title":"Index Name"},"fixing_date":{"type":"string","title":"Fixing Date"},"value":{"type":"number","title":"Value"},"reference_month":{"type":"string","title":"Reference Month"},"source":{"type":"string","title":"Source","default":"Manual"}},"type":"object","required":["index_name","fixing_date","value","reference_month"],"title":"InflationFixingRequest"},"InflationIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["name","currency"],"title":"InflationIndexRequest"},"InflationIndexedSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"inflation_index":{"type":"string","title":"Inflation Index"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","inflation_index"],"title":"InflationIndexedSwapRequest"},"InflationLinkedBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"real_coupon_rate":{"type":"number","title":"Real Coupon Rate"},"inflation_index":{"type":"string","title":"Inflation Index"}},"type":"object","required":["issue_date","maturity_date","notional","real_coupon_rate","inflation_index"],"title":"InflationLinkedBondRequest"},"InflationSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"inflation_index":{"type":"string","title":"Inflation Index"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","inflation_index"],"title":"InflationSwapRequest"},"IntegrationRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"n":{"type":"integer","title":"N","default":100}},"type":"object","required":["func_name","a","b"],"title":"IntegrationRequest"},"InterestRateSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"frequency":{"type":"string","title":"Frequency","default":"SEMI_ANNUAL"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate"],"title":"InterestRateSwapRequest"},"InterpolationRequest":{"properties":{"x":{"type":"number","title":"X"},"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"}},"type":"object","required":["x","x_values","y_values"],"title":"InterpolationRequest"},"InverseMatrixRequest":{"properties":{"matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix"}},"type":"object","required":["matrix"],"title":"InverseMatrixRequest"},"KeyRateShiftRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"tenors":{"items":{"type":"number"},"type":"array","title":"Tenors"},"values":{"items":{"type":"number"},"type":"array","title":"Values"},"key_tenor":{"type":"number","title":"Key Tenor"},"shift":{"type":"number","title":"Shift"}},"type":"object","required":["reference_date","tenors","values","key_tenor","shift"],"title":"KeyRateShiftRequest"},"KouCallPriceRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"strike":{"type":"number","title":"Strike"},"expiry":{"type":"number","title":"Expiry"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"volatility":{"type":"number","title":"Volatility"},"lambda":{"type":"number","title":"Lambda"},"p":{"type":"number","title":"P"},"eta1":{"type":"number","title":"Eta1"},"eta2":{"type":"number","title":"Eta2"}},"type":"object","required":["spot","strike","expiry","risk_free_rate","volatility","lambda","p","eta1","eta2"],"title":"KouCallPriceRequest"},"KouJumpDiffusionRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"volatility":{"type":"number","title":"Volatility"},"parameters":{"$ref":"#/components/schemas/KouParametersRequest"}},"type":"object","required":["spot","risk_free_rate","volatility","parameters"],"title":"KouJumpDiffusionRequest"},"KouParametersRequest":{"properties":{"lambda":{"type":"number","title":"Lambda"},"p":{"type":"number","title":"P"},"eta1":{"type":"number","title":"Eta1"},"eta2":{"type":"number","title":"Eta2"}},"type":"object","required":["lambda","p","eta1","eta2"],"title":"KouParametersRequest"},"LLMRequest":{"properties":{"prompt":{"type":"string","title":"Prompt"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","default":4096},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0.7}},"type":"object","required":["prompt"],"title":"LLMRequest"},"LevenbergMarquardtRequest":{"properties":{"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100},"lambda_initial":{"type":"number","title":"Lambda Initial","default":0.01}},"type":"object","title":"LevenbergMarquardtRequest"},"LinearInterpRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x_interp":{"type":"number","title":"X Interp"}},"type":"object","required":["x_values","y_values","x_interp"],"title":"LinearInterpRequest"},"LinearSystemRequest":{"properties":{"matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix"},"vector":{"items":{"type":"number"},"type":"array","title":"Vector"}},"type":"object","required":["matrix","vector"],"title":"LinearSystemRequest"},"LiquidityAdjustedVaRRequest":{"properties":{"base_var":{"type":"number","title":"Base Var"},"liquidity_adjustment":{"type":"number","title":"Liquidity Adjustment"},"time_to_liquidate":{"type":"integer","title":"Time To Liquidate"}},"type":"object","required":["base_var","liquidity_adjustment","time_to_liquidate"],"title":"LiquidityAdjustedVaRRequest"},"LocalVolatilityRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"strikes":{"items":{"type":"number"},"type":"array","title":"Strikes"},"expiries":{"items":{"type":"string"},"type":"array","title":"Expiries"},"local_vols":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Local Vols"}},"type":"object","required":["reference_date","strikes","expiries","local_vols"],"title":"LocalVolatilityRequest"},"LogLinearInterpRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"},"x_interp":{"type":"number","title":"X Interp"}},"type":"object","required":["x_values","y_values","x_interp"],"title":"LogLinearInterpRequest"},"LogMessageRequest":{"properties":{"message":{"type":"string","title":"Message"},"level":{"type":"string","title":"Level","default":"INFO"}},"type":"object","required":["message"],"title":"LogMessageRequest"},"LookbackOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"lookback_type":{"type":"string","title":"Lookback Type"},"strike":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","lookback_type","expiry_date"],"title":"LookbackOptionRequest"},"MTMCrossCurrencySwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional_domestic":{"type":"number","title":"Notional Domestic"},"notional_foreign":{"type":"number","title":"Notional Foreign"},"domestic_currency":{"type":"string","title":"Domestic Currency"},"foreign_currency":{"type":"string","title":"Foreign Currency"}},"type":"object","required":["effective_date","termination_date","notional_domestic","notional_foreign","domestic_currency","foreign_currency"],"title":"MTMCrossCurrencySwapRequest"},"MandatoryConvertibleRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"conversion_ratio":{"type":"number","title":"Conversion Ratio"}},"type":"object","required":["issue_date","maturity_date","coupon_rate","conversion_ratio"],"title":"MandatoryConvertibleRequest"},"MarginalRiskContributionRequest":{"properties":{"weights":{"items":{"type":"number"},"type":"array","title":"Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"}},"type":"object","required":["weights","covariance_matrix"],"title":"MarginalRiskContributionRequest"},"MathRequest":{"properties":{"x":{"type":"number","title":"X"}},"type":"object","required":["x"],"title":"MathRequest"},"MatrixMultiplyRequest":{"properties":{"matrix_a":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix A"},"matrix_b":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix B"}},"type":"object","required":["matrix_a","matrix_b"],"title":"MatrixMultiplyRequest"},"MatrixUtilRequest":{"properties":{"matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix"}},"type":"object","required":["matrix"],"title":"MatrixUtilRequest"},"MaxSharpePortfolioRequest":{"properties":{"expected_returns":{"items":{"type":"number"},"type":"array","title":"Expected Returns"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"risk_free_rate":{"type":"number","title":"Risk Free Rate","default":0.0}},"type":"object","required":["expected_returns","covariance_matrix"],"title":"MaxSharpePortfolioRequest"},"MeanRequest":{"properties":{"data":{"items":{"type":"number"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"MeanRequest"},"MeanVarianceOptimizerRequest":{"properties":{"expected_returns":{"items":{"type":"number"},"type":"array","title":"Expected Returns"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"constraints":{"anyOf":[{"$ref":"#/components/schemas/PortfolioConstraintsRequest"},{"type":"null"}]}},"type":"object","required":["expected_returns","covariance_matrix"],"title":"MeanVarianceOptimizerRequest"},"MertonCallPriceRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"strike":{"type":"number","title":"Strike"},"expiry":{"type":"number","title":"Expiry"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"volatility":{"type":"number","title":"Volatility"},"lambda":{"type":"number","title":"Lambda"},"mu_j":{"type":"number","title":"Mu J"},"sigma_j":{"type":"number","title":"Sigma J"}},"type":"object","required":["spot","strike","expiry","risk_free_rate","volatility","lambda","mu_j","sigma_j"],"title":"MertonCallPriceRequest"},"MertonJumpDiffusionRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"volatility":{"type":"number","title":"Volatility"},"parameters":{"$ref":"#/components/schemas/MertonParametersRequest"}},"type":"object","required":["spot","risk_free_rate","volatility","parameters"],"title":"MertonJumpDiffusionRequest"},"MertonParametersRequest":{"properties":{"lambda":{"type":"number","title":"Lambda"},"mu_j":{"type":"number","title":"Mu J"},"sigma_j":{"type":"number","title":"Sigma J"}},"type":"object","required":["lambda","mu_j","sigma_j"],"title":"MertonParametersRequest"},"MessageCreate":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MessageCreate"},"MinVariancePortfolioRequest":{"properties":{"expected_returns":{"items":{"type":"number"},"type":"array","title":"Expected Returns"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"}},"type":"object","required":["expected_returns","covariance_matrix"],"title":"MinVariancePortfolioRequest"},"MoneyRequest":{"properties":{"amount":{"type":"number","title":"Amount"},"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["amount","currency_code"],"title":"MoneyRequest"},"MonteCarloVaRRequest":{"properties":{"simulations":{"type":"integer","title":"Simulations","default":10000},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95},"time_horizon":{"type":"integer","title":"Time Horizon","default":1}},"type":"object","title":"MonteCarloVaRRequest"},"MortgageBackedSecurityRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"notional":{"type":"number","title":"Notional"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"prepayment_speed":{"type":"number","title":"Prepayment Speed"}},"type":"object","required":["issue_date","maturity_date","notional","coupon_rate","prepayment_speed"],"title":"MortgageBackedSecurityRequest"},"MultiVesselRequest":{"properties":{"imos":{"items":{"type":"string"},"type":"array","title":"Imos"}},"type":"object","required":["imos"],"title":"MultiVesselRequest"},"MulticurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"discount_tenors":{"items":{"type":"number"},"type":"array","title":"Discount Tenors"},"discount_values":{"items":{"type":"number"},"type":"array","title":"Discount Values"}},"type":"object","required":["reference_date","discount_tenors","discount_values"],"title":"MulticurveRequest"},"NelsonSiegelRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"beta0":{"type":"number","title":"Beta0"},"beta1":{"type":"number","title":"Beta1"},"beta2":{"type":"number","title":"Beta2"},"tau":{"type":"number","title":"Tau"}},"type":"object","required":["reference_date","beta0","beta1","beta2","tau"],"title":"NelsonSiegelRequest"},"NelsonSiegelSvenssonRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"beta0":{"type":"number","title":"Beta0"},"beta1":{"type":"number","title":"Beta1"},"beta2":{"type":"number","title":"Beta2"},"beta3":{"type":"number","title":"Beta3"},"tau1":{"type":"number","title":"Tau1"},"tau2":{"type":"number","title":"Tau2"}},"type":"object","required":["reference_date","beta0","beta1","beta2","beta3","tau1","tau2"],"title":"NelsonSiegelSvenssonRequest"},"NewsAnalysisRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"NewsAnalysisRequest"},"NewsCategory":{"type":"string","enum":["business","technology","sports","entertainment","health","science","politics","world","local"],"title":"NewsCategory"},"NewsRequest":{"properties":{"domains":{"items":{"type":"string"},"type":"array","title":"Domains"},"category":{"anyOf":[{"$ref":"#/components/schemas/NewsCategory"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language","default":"en"},"limit":{"type":"integer","title":"Limit","default":10}},"type":"object","required":["domains"],"title":"NewsRequest"},"NewsletterSubscribe":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source","default":"website"}},"type":"object","required":["email"],"title":"NewsletterSubscribe"},"NextIMMDateRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"}},"type":"object","required":["reference_date"],"title":"NextIMMDateRequest"},"NormalRandomRequest":{"properties":{"seed":{"type":"integer","title":"Seed","default":42},"size":{"type":"integer","title":"Size","default":1},"mean":{"type":"number","title":"Mean","default":0.0},"std_dev":{"type":"number","title":"Std Dev","default":1.0}},"type":"object","title":"NormalRandomRequest"},"NthToDefaultSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"spread":{"type":"number","title":"Spread"},"reference_names":{"items":{"type":"string"},"type":"array","title":"Reference Names"},"nth":{"type":"integer","title":"Nth"}},"type":"object","required":["effective_date","termination_date","notional","spread","reference_names","nth"],"title":"NthToDefaultSwapRequest"},"NthWeekdayRequest":{"properties":{"year":{"type":"integer","title":"Year"},"month":{"type":"integer","title":"Month"},"weekday":{"type":"integer","title":"Weekday"},"n":{"type":"integer","title":"N"}},"type":"object","required":["year","month","weekday","n"],"title":"NthWeekdayRequest"},"NumericalDerivativeRequest":{"properties":{"x_values":{"items":{"type":"number"},"type":"array","title":"X Values"},"y_values":{"items":{"type":"number"},"type":"array","title":"Y Values"}},"type":"object","required":["x_values","y_values"],"title":"NumericalDerivativeRequest"},"OTPVerification":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"otp":{"type":"string","title":"Otp"}},"type":"object","required":["email","otp"],"title":"OTPVerification"},"OptimizationRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"initial_guess":{"items":{"type":"number"},"type":"array","title":"Initial Guess"},"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","required":["func_name","initial_guess"],"title":"OptimizationRequest"},"OptimizationResultRequest":{"properties":{"weights":{"items":{"type":"number"},"type":"array","title":"Weights"},"expected_return":{"type":"number","title":"Expected Return"},"volatility":{"type":"number","title":"Volatility"},"sharpe_ratio":{"type":"number","title":"Sharpe Ratio"}},"type":"object","required":["weights","expected_return","volatility","sharpe_ratio"],"title":"OptimizationResultRequest"},"OvernightIndexSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"ois_index":{"type":"string","title":"Ois Index"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","ois_index"],"title":"OvernightIndexSwapRequest"},"ParametricVaRRequest":{"properties":{"mean":{"type":"number","title":"Mean"},"std_dev":{"type":"number","title":"Std Dev"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95},"portfolio_value":{"type":"number","title":"Portfolio Value"}},"type":"object","required":["mean","std_dev","portfolio_value"],"title":"ParametricVaRRequest"},"PasswordReset":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"PasswordReset"},"PasswordResetConfirm":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"otp":{"type":"string","title":"Otp"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["email","otp","new_password"],"title":"PasswordResetConfirm"},"PortfolioConstraintsRequest":{"properties":{"min_weights":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Min Weights"},"max_weights":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Max Weights"},"target_return":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Target Return"},"max_volatility":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Max Volatility"}},"type":"object","title":"PortfolioConstraintsRequest"},"PortfolioRiskRequest":{"properties":{"weights":{"items":{"type":"number"},"type":"array","title":"Weights"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"}},"type":"object","required":["weights","covariance_matrix"],"title":"PortfolioRiskRequest"},"PowerRequest":{"properties":{"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"}},"type":"object","required":["x","y"],"title":"PowerRequest"},"ProfileFunctionRequest":{"properties":{"function_name":{"type":"string","title":"Function Name"},"args":{"items":{},"type":"array","title":"Args","default":[]}},"type":"object","required":["function_name"],"title":"ProfileFunctionRequest"},"PuttableBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date","coupon_rate"],"title":"PuttableBondRequest"},"PuttableSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate"],"title":"PuttableSwapRequest"},"QuantoOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"quanto_factor":{"type":"number","title":"Quanto Factor"}},"type":"object","required":["option_type","strike","expiry_date","quanto_factor"],"title":"QuantoOptionRequest"},"RFRBasisSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"rfr1":{"type":"string","title":"Rfr1"},"rfr2":{"type":"string","title":"Rfr2"},"spread":{"type":"number","title":"Spread"}},"type":"object","required":["effective_date","termination_date","notional","rfr1","rfr2","spread"],"title":"RFRBasisSwapRequest"},"RFRFixingRequest":{"properties":{"index_name":{"type":"string","title":"Index Name"},"fixing_date":{"type":"string","title":"Fixing Date"},"value":{"type":"number","title":"Value"},"source":{"type":"string","title":"Source","default":"Manual"}},"type":"object","required":["index_name","fixing_date","value"],"title":"RFRFixingRequest"},"RFRIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"currency":{"type":"string","title":"Currency"}},"type":"object","required":["name","currency"],"title":"RFRIndexRequest"},"RainbowOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"num_assets":{"type":"integer","title":"Num Assets"}},"type":"object","required":["option_type","strike","expiry_date","num_assets"],"title":"RainbowOptionRequest"},"RangeAccrualSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"lower_barrier":{"type":"number","title":"Lower Barrier"},"upper_barrier":{"type":"number","title":"Upper Barrier"}},"type":"object","required":["effective_date","termination_date","notional","lower_barrier","upper_barrier"],"title":"RangeAccrualSwapRequest"},"RealizedVarianceRequest":{"properties":{"prices":{"items":{"type":"number"},"type":"array","title":"Prices"},"annualization_factor":{"type":"number","title":"Annualization Factor","default":252.0}},"type":"object","required":["prices"],"title":"RealizedVarianceRequest"},"RepoRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"notional":{"type":"number","title":"Notional"},"repo_rate":{"type":"number","title":"Repo Rate"}},"type":"object","required":["start_date","end_date","notional","repo_rate"],"title":"RepoRequest"},"ReverseConvertibleRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"coupon_rate":{"type":"number","title":"Coupon Rate"},"knock_in_barrier":{"type":"number","title":"Knock In Barrier"}},"type":"object","required":["issue_date","maturity_date","coupon_rate","knock_in_barrier"],"title":"ReverseConvertibleRequest"},"RiskParityRequest":{"properties":{"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"target_risk":{"anyOf":[{"items":{"type":"number"},"type":"array"},{"type":"null"}],"title":"Target Risk"}},"type":"object","required":["covariance_matrix"],"title":"RiskParityRequest"},"RollCurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"tenors":{"items":{"type":"number"},"type":"array","title":"Tenors"},"values":{"items":{"type":"number"},"type":"array","title":"Values"},"days":{"type":"integer","title":"Days"}},"type":"object","required":["reference_date","tenors","values","days"],"title":"RollCurveRequest"},"SABRImpliedVolRequest":{"properties":{"forward":{"type":"number","title":"Forward"},"strike":{"type":"number","title":"Strike"},"expiry":{"type":"number","title":"Expiry"},"alpha":{"type":"number","title":"Alpha"},"beta":{"type":"number","title":"Beta"},"rho":{"type":"number","title":"Rho"},"nu":{"type":"number","title":"Nu"}},"type":"object","required":["forward","strike","expiry","alpha","beta","rho","nu"],"title":"SABRImpliedVolRequest"},"SABRModelEnhancedRequest":{"properties":{"forward":{"type":"number","title":"Forward"},"expiry":{"type":"number","title":"Expiry"},"parameters":{"$ref":"#/components/schemas/SABRParametersEnhancedRequest"}},"type":"object","required":["forward","expiry","parameters"],"title":"SABRModelEnhancedRequest"},"SABRModelRequest":{"properties":{"forward":{"type":"number","title":"Forward"},"expiry":{"type":"number","title":"Expiry"},"parameters":{"$ref":"#/components/schemas/SABRParametersRequest"}},"type":"object","required":["forward","expiry","parameters"],"title":"SABRModelRequest"},"SABRParametersEnhancedRequest":{"properties":{"alpha":{"type":"number","title":"Alpha"},"beta":{"type":"number","title":"Beta"},"rho":{"type":"number","title":"Rho"},"nu":{"type":"number","title":"Nu"}},"type":"object","required":["alpha","beta","rho","nu"],"title":"SABRParametersEnhancedRequest"},"SABRParametersRequest":{"properties":{"alpha":{"type":"number","title":"Alpha"},"beta":{"type":"number","title":"Beta"},"rho":{"type":"number","title":"Rho"},"nu":{"type":"number","title":"Nu"}},"type":"object","required":["alpha","beta","rho","nu"],"title":"SABRParametersRequest"},"SSVIRequest":{"properties":{"theta_t":{"type":"number","title":"Theta T"},"phi":{"type":"number","title":"Phi"},"rho":{"type":"number","title":"Rho"}},"type":"object","required":["theta_t","phi","rho"],"title":"SSVIRequest"},"STIRFutureRequest":{"properties":{"delivery_date":{"type":"string","title":"Delivery Date"},"contract_size":{"type":"number","title":"Contract Size"},"price":{"type":"number","title":"Price"}},"type":"object","required":["delivery_date","contract_size","price"],"title":"STIRFutureRequest"},"SVDRequest":{"properties":{"matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Matrix"}},"type":"object","required":["matrix"],"title":"SVDRequest"},"SVIRequest":{"properties":{"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"rho":{"type":"number","title":"Rho"},"m":{"type":"number","title":"M"},"sigma":{"type":"number","title":"Sigma"}},"type":"object","required":["a","b","rho","m","sigma"],"title":"SVIRequest"},"ScheduleRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"frequency":{"type":"string","title":"Frequency","default":"SEMI_ANNUAL"}},"type":"object","required":["start_date","end_date"],"title":"ScheduleRequest"},"SecantMethodRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"x0":{"type":"number","title":"X0"},"x1":{"type":"number","title":"X1"},"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","required":["func_name","x0","x1"],"title":"SecantMethodRequest"},"ShiftCurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"tenors":{"items":{"type":"number"},"type":"array","title":"Tenors"},"values":{"items":{"type":"number"},"type":"array","title":"Values"},"shift":{"type":"number","title":"Shift"}},"type":"object","required":["reference_date","tenors","values","shift"],"title":"ShiftCurveRequest"},"ShortRateParametersRequest":{"properties":{"mean_reversion":{"type":"number","title":"Mean Reversion"},"volatility":{"type":"number","title":"Volatility"},"long_term_rate":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Long Term Rate"}},"type":"object","required":["mean_reversion","volatility"],"title":"ShortRateParametersRequest"},"SingleCurrencyBasisSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"spread":{"type":"number","title":"Spread"}},"type":"object","required":["effective_date","termination_date","notional","spread"],"title":"SingleCurrencyBasisSwapRequest"},"SolverUtilRequest":{"properties":{"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"tolerance":{"type":"number","title":"Tolerance","default":1e-06}},"type":"object","required":["a","b"],"title":"SolverUtilRequest"},"SpeechInput":{"properties":{"text":{"type":"string","maxLength":500000,"minLength":50,"title":"Text","description":"Raw speech text (50-500K chars)"}},"type":"object","required":["text"],"title":"SpeechInput"},"SpreadOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"}},"type":"object","required":["option_type","strike","expiry_date"],"title":"SpreadOptionRequest"},"StandardDeviationRequest":{"properties":{"data":{"items":{"type":"number"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"StandardDeviationRequest"},"SwaptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"swap_start":{"type":"string","title":"Swap Start"},"swap_end":{"type":"string","title":"Swap End"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["option_type","strike","expiry_date","swap_start","swap_end","notional"],"title":"SwaptionRequest"},"SwitzerlandCalendarRequest":{"properties":{"calendar_type":{"type":"string","title":"Calendar Type","default":"TARGET"}},"type":"object","title":"SwitzerlandCalendarRequest"},"SystemConfigRequest":{"properties":{"config_key":{"type":"string","title":"Config Key"},"config_value":{"type":"string","title":"Config Value"},"config_type":{"type":"string","title":"Config Type","default":"string"},"description":{"type":"string","title":"Description","default":""}},"type":"object","required":["config_key","config_value"],"title":"SystemConfigRequest"},"TARNRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"target_redemption":{"type":"number","title":"Target Redemption"}},"type":"object","required":["effective_date","termination_date","notional","target_redemption"],"title":"TARNRequest"},"TargetReturnPortfolioRequest":{"properties":{"expected_returns":{"items":{"type":"number"},"type":"array","title":"Expected Returns"},"covariance_matrix":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Covariance Matrix"},"target_return":{"type":"number","title":"Target Return"}},"type":"object","required":["expected_returns","covariance_matrix","target_return"],"title":"TargetReturnPortfolioRequest"},"TaylorExpandRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"x":{"type":"number","title":"X"},"order":{"type":"integer","title":"Order","default":2}},"type":"object","required":["func_name","x"],"title":"TaylorExpandRequest"},"TenorBasisSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"pay_tenor":{"type":"string","title":"Pay Tenor"},"receive_tenor":{"type":"string","title":"Receive Tenor"},"spread":{"type":"number","title":"Spread"}},"type":"object","required":["effective_date","termination_date","notional","pay_tenor","receive_tenor","spread"],"title":"TenorBasisSwapRequest"},"TermStructureVolatilityRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"expiries":{"items":{"type":"string"},"type":"array","title":"Expiries"},"volatilities":{"items":{"type":"number"},"type":"array","title":"Volatilities"}},"type":"object","required":["reference_date","expiries","volatilities"],"title":"TermStructureVolatilityRequest"},"TicketCreate":{"properties":{"subject":{"type":"string","title":"Subject"},"description":{"type":"string","title":"Description"},"category":{"type":"string","title":"Category"},"priority":{"type":"string","title":"Priority","default":"medium"}},"type":"object","required":["subject","description","category"],"title":"TicketCreate"},"TicketUpdate":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","title":"TicketUpdate"},"ToDateRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"ToDateRequest"},"ToDateTimeRequest":{"properties":{"date_str":{"type":"string","title":"Date Str"}},"type":"object","required":["date_str"],"title":"ToDateTimeRequest"},"TopicSearchRequest":{"properties":{"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"domains":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Domains"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"limit":{"type":"integer","title":"Limit","default":10}},"type":"object","required":["keywords"],"title":"TopicSearchRequest"},"TotalReturnSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"reference_asset":{"type":"string","title":"Reference Asset"},"funding_spread":{"type":"number","title":"Funding Spread"}},"type":"object","required":["effective_date","termination_date","notional","reference_asset","funding_spread"],"title":"TotalReturnSwapRequest"},"TrancheRequest":{"properties":{"attachment_point":{"type":"number","title":"Attachment Point"},"detachment_point":{"type":"number","title":"Detachment Point"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["attachment_point","detachment_point","notional"],"title":"TrancheRequest"},"TreasuryBillRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"face_value":{"type":"number","title":"Face Value","default":100.0},"discount_rate":{"type":"number","title":"Discount Rate"}},"type":"object","required":["issue_date","maturity_date","discount_rate"],"title":"TreasuryBillRequest"},"TwistCurveRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"tenors":{"items":{"type":"number"},"type":"array","title":"Tenors"},"values":{"items":{"type":"number"},"type":"array","title":"Values"},"short_shift":{"type":"number","title":"Short Shift"},"long_shift":{"type":"number","title":"Long Shift"}},"type":"object","required":["reference_date","tenors","values","short_shift","long_shift"],"title":"TwistCurveRequest"},"TypeCheckRequest":{"properties":{"value":{"title":"Value"}},"type":"object","required":["value"],"title":"TypeCheckRequest"},"UnadjustedRequest":{"properties":{"date":{"type":"string","title":"Date"}},"type":"object","required":["date"],"title":"UnadjustedRequest"},"UniformRandomRequest":{"properties":{"seed":{"type":"integer","title":"Seed","default":42},"size":{"type":"integer","title":"Size","default":1}},"type":"object","title":"UniformRandomRequest"},"UserCreateRequest":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"account_type":{"type":"string","title":"Account Type","default":"free"},"is_admin":{"type":"boolean","title":"Is Admin","default":false},"is_verified":{"type":"boolean","title":"Is Verified","default":true},"credit_balance":{"type":"integer","title":"Credit Balance","default":0}},"type":"object","required":["username","email","password"],"title":"UserCreateRequest"},"UserLogin":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["email","password"],"title":"UserLogin"},"UserRegistration":{"properties":{"username":{"type":"string","title":"Username"},"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country"},"country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Country Code"}},"type":"object","required":["username","email","password"],"title":"UserRegistration"},"UserUpdateRequest":{"properties":{"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"account_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Account Type"},"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Verified"},"is_admin":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Admin"},"credit_balance":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Balance"}},"type":"object","title":"UserUpdateRequest"},"VGCallPriceRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"strike":{"type":"number","title":"Strike"},"expiry":{"type":"number","title":"Expiry"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"sigma":{"type":"number","title":"Sigma"},"nu":{"type":"number","title":"Nu"},"theta":{"type":"number","title":"Theta"}},"type":"object","required":["spot","strike","expiry","risk_free_rate","sigma","nu","theta"],"title":"VGCallPriceRequest"},"VGParametersRequest":{"properties":{"sigma":{"type":"number","title":"Sigma"},"nu":{"type":"number","title":"Nu"},"theta":{"type":"number","title":"Theta"}},"type":"object","required":["sigma","nu","theta"],"title":"VGParametersRequest"},"ValidateCurrencyRequest":{"properties":{"currency_code":{"type":"string","title":"Currency Code"}},"type":"object","required":["currency_code"],"title":"ValidateCurrencyRequest"},"ValidatePositiveRequest":{"properties":{"value":{"type":"number","title":"Value"}},"type":"object","required":["value"],"title":"ValidatePositiveRequest"},"ValidateProbabilityRequest":{"properties":{"value":{"type":"number","title":"Value"}},"type":"object","required":["value"],"title":"ValidateProbabilityRequest"},"ValidateRangeRequest":{"properties":{"value":{"type":"number","title":"Value"},"min_val":{"type":"number","title":"Min Val"},"max_val":{"type":"number","title":"Max Val"}},"type":"object","required":["value","min_val","max_val"],"title":"ValidateRangeRequest"},"ValidateRateRequest":{"properties":{"rate":{"type":"number","title":"Rate"}},"type":"object","required":["rate"],"title":"ValidateRateRequest"},"ValidateTenorRequest":{"properties":{"tenor":{"type":"string","title":"Tenor"}},"type":"object","required":["tenor"],"title":"ValidateTenorRequest"},"ValidateValueRequest":{"properties":{"value":{"type":"number","title":"Value"}},"type":"object","required":["value"],"title":"ValidateValueRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VanillaOptionRequest":{"properties":{"option_type":{"type":"string","title":"Option Type"},"strike":{"type":"number","title":"Strike"},"expiry_date":{"type":"string","title":"Expiry Date"},"spot":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spot"}},"type":"object","required":["option_type","strike","expiry_date"],"title":"VanillaOptionRequest"},"VarianceGammaRequest":{"properties":{"spot":{"type":"number","title":"Spot"},"risk_free_rate":{"type":"number","title":"Risk Free Rate"},"parameters":{"$ref":"#/components/schemas/VGParametersRequest"}},"type":"object","required":["spot","risk_free_rate","parameters"],"title":"VarianceGammaRequest"},"VarianceRequest":{"properties":{"data":{"items":{"type":"number"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"VarianceRequest"},"VarianceSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"strike_variance":{"type":"number","title":"Strike Variance"}},"type":"object","required":["effective_date","termination_date","notional","strike_variance"],"title":"VarianceSwapRequest"},"VasicekModelRequest":{"properties":{"r0":{"type":"number","title":"R0"},"a":{"type":"number","title":"A"},"b":{"type":"number","title":"B"},"sigma":{"type":"number","title":"Sigma"}},"type":"object","required":["r0","a","b","sigma"],"title":"VasicekModelRequest"},"VectorCrossProductRequest":{"properties":{"vector1":{"items":{"type":"number"},"type":"array","title":"Vector1"},"vector2":{"items":{"type":"number"},"type":"array","title":"Vector2"}},"type":"object","required":["vector1","vector2"],"title":"VectorCrossProductRequest"},"VectorDotProductRequest":{"properties":{"vector1":{"items":{"type":"number"},"type":"array","title":"Vector1"},"vector2":{"items":{"type":"number"},"type":"array","title":"Vector2"}},"type":"object","required":["vector1","vector2"],"title":"VectorDotProductRequest"},"VectorNormRequest":{"properties":{"vector":{"items":{"type":"number"},"type":"array","title":"Vector"}},"type":"object","required":["vector"],"title":"VectorNormRequest"},"VesselPositionRequest":{"properties":{"imo":{"type":"string","title":"Imo"}},"type":"object","required":["imo"],"title":"VesselPositionRequest"},"ViewRequest":{"properties":{"view_type":{"type":"string","title":"View Type"},"assets":{"items":{"type":"integer"},"type":"array","title":"Assets"},"expected_return":{"type":"number","title":"Expected Return"},"confidence":{"type":"number","title":"Confidence","default":1.0}},"type":"object","required":["view_type","assets","expected_return"],"title":"ViewRequest"},"VisualAnalysisRequest":{"properties":{"image_url":{"type":"string","title":"Image Url"},"prompt":{"type":"string","title":"Prompt"},"max_tokens":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Tokens","default":4096},"temperature":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Temperature","default":0.7},"enable_thinking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enable Thinking","default":false}},"type":"object","required":["image_url","prompt"],"title":"VisualAnalysisRequest"},"VolatilityCubeRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"strikes":{"items":{"type":"number"},"type":"array","title":"Strikes"},"expiries":{"items":{"type":"string"},"type":"array","title":"Expiries"},"tenors":{"items":{"type":"string"},"type":"array","title":"Tenors"},"volatilities":{"items":{"items":{"items":{"type":"number"},"type":"array"},"type":"array"},"type":"array","title":"Volatilities"}},"type":"object","required":["reference_date","strikes","expiries","tenors","volatilities"],"title":"VolatilityCubeRequest"},"VolatilitySurfaceRequest":{"properties":{"reference_date":{"type":"string","title":"Reference Date"},"strikes":{"items":{"type":"number"},"type":"array","title":"Strikes"},"expiries":{"items":{"type":"string"},"type":"array","title":"Expiries"},"volatilities":{"items":{"items":{"type":"number"},"type":"array"},"type":"array","title":"Volatilities"}},"type":"object","required":["reference_date","strikes","expiries","volatilities"],"title":"VolatilitySurfaceRequest"},"VolatilitySwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"strike_volatility":{"type":"number","title":"Strike Volatility"}},"type":"object","required":["effective_date","termination_date","notional","strike_volatility"],"title":"VolatilitySwapRequest"},"WeatherDerivativeRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"strike_temperature":{"type":"number","title":"Strike Temperature"}},"type":"object","required":["effective_date","termination_date","notional","strike_temperature"],"title":"WeatherDerivativeRequest"},"WeatherIndexRequest":{"properties":{"name":{"type":"string","title":"Name"},"location":{"type":"string","title":"Location"}},"type":"object","required":["name","location"],"title":"WeatherIndexRequest"},"WebSearchRequest":{"properties":{"query":{"type":"string","title":"Query"},"engine":{"type":"string","title":"Engine","default":"google"}},"type":"object","required":["query"],"title":"WebSearchRequest"},"YearFractionRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"},"convention":{"type":"string","title":"Convention","default":"Actual360"}},"type":"object","required":["start_date","end_date"],"title":"YearFractionRequest"},"YearOnYearInflationSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"inflation_index":{"type":"string","title":"Inflation Index"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","inflation_index"],"title":"YearOnYearInflationSwapRequest"},"ZeroCouponBondRequest":{"properties":{"issue_date":{"type":"string","title":"Issue Date"},"maturity_date":{"type":"string","title":"Maturity Date"},"face_value":{"type":"number","title":"Face Value","default":100.0}},"type":"object","required":["issue_date","maturity_date"],"title":"ZeroCouponBondRequest"},"ZeroCouponInflationSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"},"inflation_index":{"type":"string","title":"Inflation Index"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate","inflation_index"],"title":"ZeroCouponInflationSwapRequest"},"ZeroCouponSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"},"fixed_rate":{"type":"number","title":"Fixed Rate"}},"type":"object","required":["effective_date","termination_date","notional","fixed_rate"],"title":"ZeroCouponSwapRequest"},"ZeroZeroSwapRequest":{"properties":{"effective_date":{"type":"string","title":"Effective Date"},"termination_date":{"type":"string","title":"Termination Date"},"notional":{"type":"number","title":"Notional"}},"type":"object","required":["effective_date","termination_date","notional"],"title":"ZeroZeroSwapRequest"},"quantlib_core__ValidateDateOrderRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"}},"type":"object","required":["start_date","end_date"],"title":"ValidateDateOrderRequest"},"quantlib_risk__VaRRequest":{"properties":{"returns":{"items":{"type":"number"},"type":"array","title":"Returns"},"confidence_level":{"type":"number","title":"Confidence Level","default":0.95}},"type":"object","required":["returns"],"title":"VaRRequest"},"quantlib_solver__NewtonRaphsonRequest":{"properties":{"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","title":"NewtonRaphsonRequest"},"quantlib_utils__CalendarRequest":{"properties":{"date":{"type":"string","title":"Date"}},"type":"object","required":["date"],"title":"CalendarRequest"},"quantlib_utils__DayCountRequest":{"properties":{"start_date":{"type":"string","title":"Start Date"},"end_date":{"type":"string","title":"End Date"}},"type":"object","required":["start_date","end_date"],"title":"DayCountRequest"},"quantlib_utils__NewtonRaphsonRequest":{"properties":{"func_name":{"type":"string","title":"Func Name"},"initial_guess":{"type":"number","title":"Initial Guess"},"tolerance":{"type":"number","title":"Tolerance","default":1e-06},"max_iterations":{"type":"integer","title":"Max Iterations","default":100}},"type":"object","required":["func_name","initial_guess"],"title":"NewtonRaphsonRequest"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key"}}}}\ No newline at end of file