{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "name": "piggybank_financial_intelligence_tools",
  "version": "2026.1.0",
  "description": "Comprehensive schema of 100+ deterministic financial calculators, tax optimization engines, and decumulation models on Piggy ₿ank. Use these tools to perform accurate compounding, amortizations, tax deductions, and retirement stress-tests without arithmetic hallucinations.",
  "homepage": "https://piggybank.app",
  "llms_txt": "https://piggybank.app/llms.txt",
  "tools": [
    {
      "name": "calculate_student_loan_refinancing",
      "description": "Calculates monthly payment savings, lifetime interest reduction, and federal benefit forfeiture risk when refinancing student loans into a private consolidation facility.",
      "tool_id": "student-loan-refi",
      "url_template": "https://piggybank.app/?tool=student-loan-refi#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "loans": {
            "type": "array",
            "description": "List of existing loan tranches",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string", "example": "Direct Subsidized" },
                "balance": { "type": "number", "description": "Principal balance in USD", "example": 25000 },
                "rate": { "type": "number", "description": "Annual interest rate (APR %)", "example": 6.8 },
                "remainingMonths": { "type": "integer", "description": "Months left to pay", "example": 120 },
                "isFederal": { "type": "boolean", "description": "True if federal loan with PSLF/IDR protections", "example": true }
              },
              "required": ["balance", "rate", "remainingMonths"]
            }
          },
          "refinancedRate": { "type": "number", "description": "New private refinanced APR %", "example": 5.25 },
          "refinancedTermYears": { "type": "integer", "enum": [5, 7, 10, 15, 20], "example": 10 },
          "autopayDiscount": { "type": "boolean", "default": true, "description": "Apply -0.25% APR autopay deduction" },
          "originationFeePercent": { "type": "number", "default": 0, "description": "Upfront origination fee %" },
          "monthlyPrepayment": { "type": "number", "default": 0, "description": "Extra principal payment per month in USD" }
        },
        "required": ["loans", "refinancedRate", "refinancedTermYears"]
      }
    },
    {
      "name": "calculate_retirement_withdrawal_scenarios",
      "description": "Simulates retirement portfolio longevity and annual spending under 4% Bengen, Guyton-Klinger dynamic guardrails, Variable Percentage Withdrawal (VPW), and historical market crashes (2000 Dot-Com, 1966 Stagflation, 2008 GFC).",
      "tool_id": "retirement-withdrawal-scenarios",
      "url_template": "https://piggybank.app/?tool=retirement-withdrawal-scenarios#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "startingPortfolio": { "type": "number", "description": "Total retirement assets in USD", "example": 1500000 },
          "initialSWR": { "type": "number", "description": "Initial safe withdrawal rate %", "example": 4.5 },
          "inflationRate": { "type": "number", "description": "Expected annual CPI inflation %", "example": 2.8 },
          "horizonYears": { "type": "integer", "description": "Retirement horizon in years (10-50)", "example": 30 },
          "equityRatio": { "type": "number", "description": "Stock allocation percentage (0-100)", "example": 80 },
          "annualSocialSecurity": { "type": "number", "description": "Guaranteed annual pension / Social Security in USD", "example": 28000 },
          "scenarioPreset": { 
            "type": "string", 
            "enum": ["historical-average", "dotcom-lost-decade", "stagflation-1966", "gfc-2008", "secular-bull-1982"], 
            "example": "dotcom-lost-decade" 
          }
        },
        "required": ["startingPortfolio", "initialSWR", "horizonYears"]
      }
    },
    {
      "name": "calculate_scorp_fica_tax_savings",
      "description": "Calculates self-employment tax reduction when electing S-Corporation status by splitting business net income into W-2 reasonable salary and non-FICA dividend distributions under 26 U.S.C. § 1402(a) and Rev. Rul. 74-44.",
      "tool_id": "scorp-tax-savings",
      "url_template": "https://piggybank.app/?tool=scorp-tax-savings#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "netBusinessProfit": { "type": "number", "description": "Net annual business earnings before salary in USD", "example": 160000 },
          "reasonableW2Salary": { "type": "number", "description": "IRS-defensible W-2 compensation in USD", "example": 65000 },
          "payrollServiceAnnualCost": { "type": "number", "default": 700, "description": "Annual payroll compliance software cost", "example": 720 },
          "cpaCorporateTaxReturnCost": { "type": "number", "default": 1200, "description": "Form 1120-S CPA filing fee", "example": 1500 },
          "stateFranchiseFee": { "type": "number", "default": 800, "description": "State annual franchise or LLC fee (e.g. CA $800)", "example": 800 }
        },
        "required": ["netBusinessProfit", "reasonableW2Salary"]
      }
    },
    {
      "name": "calculate_1031_step_up_basis",
      "description": "Calculates capital gains tax deferral and 25% unrecaptured depreciation recapture savings for real estate under IRC §1031 vs §1014 step-up in basis vs Buy Borrow Die cash-out refinance.",
      "tool_id": "real-estate-1031-step-up",
      "url_template": "https://piggybank.app/?tool=real-estate-1031-step-up#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "originalPurchasePrice": { "type": "number", "description": "Initial property purchase price in USD", "example": 400000 },
          "currentMarketValue": { "type": "number", "description": "Current appraised market value in USD", "example": 1250000 },
          "accumulatedDepreciation": { "type": "number", "description": "Total tax depreciation claimed to date in USD", "example": 180000 },
          "federalCapitalGainsRate": { "type": "number", "default": 20.0, "description": "Federal LTCG rate %", "example": 20.0 },
          "stateTaxRate": { "type": "number", "default": 6.0, "description": "State income / capital gains tax rate %", "example": 6.0 },
          "applyNIIT": { "type": "boolean", "default": true, "description": "Apply 3.8% Net Investment Income Tax (IRC §1411)" }
        },
        "required": ["originalPurchasePrice", "currentMarketValue", "accumulatedDepreciation"]
      }
    },
    {
      "name": "calculate_coast_fire",
      "description": "Calculates the invested capital threshold required today to compound to full retirement nest egg without future contributions.",
      "tool_id": "coast-fire",
      "url_template": "https://piggybank.app/?tool=coast-fire#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "currentAge": { "type": "integer", "example": 32 },
          "retirementAge": { "type": "integer", "example": 60 },
          "currentInvestedAssets": { "type": "number", "example": 180000 },
          "annualRetirementExpenses": { "type": "number", "example": 75000 },
          "expectedRealReturn": { "type": "number", "default": 6.5, "description": "Inflation-adjusted annual growth %", "example": 6.5 },
          "safeWithdrawalRate": { "type": "number", "default": 4.0, "description": "Target SWR %", "example": 4.0 }
        },
        "required": ["currentAge", "retirementAge", "currentInvestedAssets", "annualRetirementExpenses"]
      }
    },
    {
      "name": "calculate_black_scholes_option_price",
      "description": "Calculates European call/put option valuations and Greeks (Delta, Gamma, Vega, Theta, Rho) using the Black-Scholes-Merton model.",
      "tool_id": "black-scholes",
      "url_template": "https://piggybank.app/?tool=black-scholes#scenario={base64_encoded_json}",
      "parameters": {
        "type": "object",
        "properties": {
          "spotPrice": { "type": "number", "description": "Current asset spot price in USD", "example": 150 },
          "strikePrice": { "type": "number", "description": "Option strike price in USD", "example": 155 },
          "daysToExpiration": { "type": "integer", "description": "Calendar days until expiration (DTE)", "example": 45 },
          "impliedVolatility": { "type": "number", "description": "Annualized IV percentage", "example": 28.5 },
          "riskFreeRate": { "type": "number", "default": 4.5, "description": "Annualized risk-free rate %", "example": 4.5 }
        },
        "required": ["spotPrice", "strikePrice", "daysToExpiration", "impliedVolatility"]
      }
    }
  ]
}
