How to Calculate Swap Rate with Forward Rates

Swap Rate Calculator using Forward Rates body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; line-height: 1.6; color: #333; max-width: 800px; margin: 0 auto; padding: 20px; background-color: #f9f9f9; } .calculator-container { background: #ffffff; padding: 30px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); margin-bottom: 40px; border: 1px solid #e1e1e1; } .calculator-title { text-align: center; color: #2c3e50; margin-bottom: 25px; font-size: 24px; font-weight: 700; } .input-group { margin-bottom: 20px; } .input-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #555; } .input-group input, .input-group select { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 16px; box-sizing: border-box; transition: border-color 0.3s; } .input-group input:focus, .input-group select:focus { border-color: #3498db; outline: none; } .forward-rates-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; background: #f8f9fa; padding: 15px; border-radius: 6px; border: 1px solid #eee; margin-bottom: 20px; } .grid-header { grid-column: 1 / -1; font-size: 14px; font-weight: bold; color: #7f8c8d; margin-bottom: 5px; text-transform: uppercase; } .calc-btn { display: block; width: 100%; padding: 15px; background-color: #2c3e50; color: white; border: none; border-radius: 4px; font-size: 18px; font-weight: bold; cursor: pointer; transition: background-color 0.3s; } .calc-btn:hover { background-color: #34495e; } .result-section { margin-top: 30px; padding: 20px; background-color: #e8f6f3; border: 1px solid #d1f2eb; border-radius: 6px; display: none; } .result-title { color: #16a085; font-size: 18px; margin-bottom: 10px; font-weight: bold; } .result-value { font-size: 32px; color: #2c3e50; font-weight: bold; } .breakdown-table { width: 100%; margin-top: 15px; border-collapse: collapse; font-size: 14px; } .breakdown-table th, .breakdown-table td { text-align: left; padding: 8px; border-bottom: 1px solid #ddd; } .breakdown-table th { background-color: #f1f1f1; } .content-section { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); } h2 { color: #2c3e50; margin-top: 30px; border-bottom: 2px solid #ecf0f1; padding-bottom: 10px; } p { color: #555; margin-bottom: 15px; } ul { color: #555; margin-left: 20px; } .formula-box { background-color: #f8f9fa; padding: 15px; border-left: 4px solid #3498db; font-family: monospace; margin: 20px 0; overflow-x: auto; }
Par Swap Rate Calculator
Annual (Once per year) Semi-Annual (Twice per year) Quarterly (Four times per year)
Enter Forward Rates (%) for each consecutive period
Calculated Par Swap Rate
0.00%
Based on implied Discount Factors
Bootstrap Analysis:
Period Forward Rate Discount Factor (DF)

How to Calculate Swap Rate with Forward Rates

In quantitative finance, calculating the par swap rate is a fundamental task for pricing interest rate swaps. An interest rate swap is a derivative contract where two parties exchange cash flows—one based on a fixed rate and the other on a floating rate (typically linked to a benchmark like SOFR or LIBOR). The "swap rate" is the specific fixed rate that makes the net present value (NPV) of the contract zero at inception.

While swap rates are often quoted directly by the market, they can also be derived mathematically using a series of forward rates. Forward rates represent the market's expectation of future interest rates for specific periods.

The Mathematical Relationship

To calculate the swap rate from forward rates, one must typically perform a "bootstrapping" process to determine the Discount Factors (DF) for each payment date. The par swap rate is essentially a weighted average of the forward rates, but weighted by the discount factors rather than time alone.

Swap Rate (S) = (1 – DFₙ) / Σ (Δt × DFᵢ)

Where:

  • DFₙ is the discount factor at the final maturity date.
  • DFᵢ is the discount factor for each interim payment period i.
  • Δt (Delta t) is the accrual period fraction (e.g., 0.5 for semi-annual).

Step-by-Step Calculation Logic

If you have a series of Forward Rates ($f_1, f_2, … f_n$), the process is as follows:

1. Determine Time Fraction (Δt)

First, identify the frequency of payments. If payments are semi-annual, Δt is 0.5. If quarterly, Δt is 0.25.

2. Calculate Discount Factors (DF)

A Discount Factor represents the present value of $1 received at a future date. It is derived from the forward rates using the recurrence relation:

DF₀ = 1.0
DF₁ = DF₀ / (1 + f₁ × Δt)
DF₂ = DF₁ / (1 + f₂ × Δt)

This continues for all periods involved in the swap.

3. Solve for the Swap Rate

The numerator of the swap rate formula represents the total floating leg value (which simplifies to $1 – DF_n$ in a par context). The denominator is the sum of the discount factors multiplied by the time fraction (often called the PV01 or Annuity factor).

Why Use Forward Rates?

Using forward rates allows for a more granular pricing model that accounts for the term structure of interest rates (the yield curve). A simple average of rates would ignore the time value of money, leading to incorrect valuations. By converting forwards to discount factors, we ensure the calculated swap rate implies no arbitrage opportunities.

Example Calculation

Assume a 1-year swap with semi-annual payments (Δt = 0.5).
Period 1 Forward Rate: 4.0%
Period 2 Forward Rate: 5.0%

Step 1: Calculate DF₁
DF₁ = 1 / (1 + 0.04 × 0.5) = 1 / 1.02 = 0.9804

Step 2: Calculate DF₂
DF₂ = 0.9804 / (1 + 0.05 × 0.5) = 0.9804 / 1.025 = 0.9565

Step 3: Calculate PV01 (Denominator)
PV01 = (0.5 × 0.9804) + (0.5 × 0.9565) = 0.4902 + 0.47825 = 0.96845

Step 4: Calculate Swap Rate
Numerator = 1 – 0.9565 = 0.0435
Swap Rate = 0.0435 / 0.96845 = 4.49%

function calculateSwapRate() { // 1. Get Payment Frequency and determine Delta T var freqElement = document.getElementById('paymentFrequency'); var frequency = parseFloat(freqElement.value); var deltaT = 1.0 / frequency; // e.g., 0.5 for semi-annual // 2. Gather Forward Rates var forwardRates = []; // We scan inputs fwdRate1 through fwdRate6 for (var i = 1; i <= 6; i++) { var inputId = 'fwdRate' + i; var val = document.getElementById(inputId).value; if (val !== "" && !isNaN(val)) { forwardRates.push(parseFloat(val) / 100); // Convert % to decimal } else { // Stop gathering if we hit an empty input, assuming sequential entry // If user skips period 2 but enters 3, logic breaks, so we assume sequential. if (i === 1) { alert("Please enter at least the Period 1 Forward Rate."); return; } break; } } if (forwardRates.length === 0) return; // 3. Calculate Discount Factors and Accumulate PV01 var df = 1.0; // Starting DF at time 0 var pv01 = 0.0; // Denominator sum(deltaT * DF) var breakdownHtml = ""; // Array to store results for table var results = []; for (var j = 0; j < forwardRates.length; j++) { var fwd = forwardRates[j]; // Calculate DF for end of this period // DF_new = DF_prev / (1 + fwd * deltaT) var dfPrev = df; df = dfPrev / (1 + (fwd * deltaT)); // Accumulate denominator (Sum of DeltaT * DF_new) pv01 += deltaT * df; // Store data for table results.push({ period: j + 1, rate: (fwd * 100).toFixed(2) + "%", df: df.toFixed(5) }); } var finalDF = df; // 4. Calculate Swap Rate // Formula: (1 – DF_final) / PV01 var numerator = 1.0 – finalDF; var swapRateDecimal = numerator / pv01; var swapRatePercent = (swapRateDecimal * 100).toFixed(4); // 5. Display Results var resultSection = document.getElementById('resultSection'); var resultDisplay = document.getElementById('swapRateResult'); var tableBody = document.getElementById('breakdownBody'); resultDisplay.innerHTML = swapRatePercent + "%"; // Populate breakdown table tableBody.innerHTML = ""; for (var k = 0; k < results.length; k++) { var row = "" + "" + results[k].period + "" + "" + results[k].rate + "" + "" + results[k].df + "" + ""; tableBody.innerHTML += row; } resultSection.style.display = "block"; }

Leave a Comment