/* * ============================================================================= * 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 }) => (