/* * ============================================================================= * VibeQuant (vquant) — AI-Powered Financial Intelligence Platform * ----------------------------------------------------------------------------- * File: client/src/components/financial/options-pricing-card.tsx * * Author: Simon-Pierre Boucher * Contact: contact@spboucher.ai * Website: https://www.spboucher.ai * Demo: https://www.vquant.ai * License: MIT (see LICENSE) * * Copyright © 2026 Simon-Pierre Boucher. All rights reserved. * ============================================================================= */ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; import { TrendingUp, TrendingDown, DollarSign, Clock, Percent, Activity } from "lucide-react"; interface OptionGreeks { delta: number; gamma: number; theta: number; vega: number; rho: number; } interface OptionResult { price: number; intrinsic_value: number; time_value: number; greeks: OptionGreeks; moneyness: string; } interface OptionsPricingData { parameters: { stock_price: number; strike_price: number; time_to_maturity: number; risk_free_rate: number; volatility: number; option_type: string; }; call_option: OptionResult; put_option: OptionResult; parity_check: { call_minus_put: number; stock_minus_pv_strike: number; parity_holds: boolean; }; } interface OptionsPricingCardProps { data: OptionsPricingData; } export function OptionsPricingCard({ data }: OptionsPricingCardProps) { const formatPrice = (value: number) => `$${value.toFixed(4)}`; const formatPercent = (value: number) => `${(value * 100).toFixed(2)}%`; const formatGreek = (value: number, decimals: number = 4) => value.toFixed(decimals); const getMoneynessColor = (moneyness: string) => { switch (moneyness) { case 'ITM': return 'bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200'; case 'ATM': return 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200'; case 'OTM': return 'bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200'; default: return 'bg-gray-100 text-gray-800 dark:bg-gray-900 dark:text-gray-200'; } }; const GreekIndicator = ({ label, value, tooltip }: { label: string; value: number; tooltip: string }) => (
{label}
= 0 ? 'text-green-600 dark:text-green-400' : 'text-red-600 dark:text-red-400'}`}> {formatGreek(value)}
); const OptionCard = ({ title, option, icon }: { title: string; option: OptionResult; icon: React.ReactNode }) => (
{icon} {title}
{option.moneyness}
{/* Option Price */}
Option Price
{formatPrice(option.price)}
{/* Value Breakdown */}
Intrinsic
{formatPrice(option.intrinsic_value)}
Time Value
{formatPrice(option.time_value)}
{/* Greeks */}
Greeks (Sensitivities)
); return (
{/* Parameters Header */} Black-Scholes Option Pricing Theoretical option values and Greeks for European options
Stock Price
{formatPrice(data.parameters.stock_price)}
Strike Price
{formatPrice(data.parameters.strike_price)}
Time to Expiry
{data.parameters.time_to_maturity.toFixed(4)} yr
{(data.parameters.time_to_maturity * 365).toFixed(0)} days
Volatility
{formatPercent(data.parameters.volatility)}
Risk-Free Rate
{formatPercent(data.parameters.risk_free_rate)}
{/* Call and Put Options Side by Side */}
} /> } />
{/* Put-Call Parity Check */} Put-Call Parity Verification Verifies that C - P = S - K×e^(-rT)
Call - Put
{formatPrice(data.parity_check.call_minus_put)}
S - PV(K)
{formatPrice(data.parity_check.stock_minus_pv_strike)}
Parity Check
{data.parity_check.parity_holds ? '✓ Holds' : '✗ Failed'}
); }