Pricing an Interest Rate Cap
Price interest rate caps with caplet-level breakdown, SABR volatility smile, and full Greeks using the BlueGamma API.
The /cap_floor_price endpoint prices interest rate caps (and floors) with a full caplet-level breakdown. Use this when you need to price caps programmatically, run strike/tenor scenarios, or feed cap valuations into a risk or advisory workflow.
Basic Example: ATM Cap
Price a 3Y ATM SOFR cap on $10M notional with quarterly caplets:
import requests
url = "https://api.bluegamma.io/v1/cap_floor_price"
headers = {"x-api-key": "your_api_key"}
params = {
"index": "SOFR",
"start_date": "0D",
"maturity_date": "3Y",
"cap_or_floor": "cap",
"notional": 10000000,
"frequency": "3M"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(f"Strike: {data['strike_rate']:.2f}% (ATM)")
print(f"NPV: ${data['npv']:,.2f}")
print(f"Premium: {data['premium_pct']:.2f}% of notional")
print(f"Delta: {data['delta']:.2f}")
print(f"Vega: {data['vega']:.2f}")Response (April 2026):
npv
Net present value of the cap in the notional currency
premium_pct
NPV as a percentage of notional
strike_rate
The cap strike (ATM forward if omitted)
delta
Rate sensitivity (sum across all caplets)
vega
Volatility sensitivity (sum across all caplets)
vol_type
Volatility model used (sabr_calibrated for SOFR, flat for others)
caplets
Array of per-caplet pricing detail
Use Case: OTM Cap with Custom Strike
Price the same cap with a 4.50% strike (out-of-the-money):
Output (April 2026):
The 4.50% cap costs $32k vs $103k for ATM -- reflecting the lower probability of SOFR exceeding 4.50%.
Pricing caps for clients? Use the API to generate indicative pricing across multiple strikes and tenors in seconds.
Use Case: Amortising Cap with a Notional Schedule
To price a cap on an amortising loan, send a POST request with notional as a list: one amount per caplet, in order. This example prices a 3Y quarterly SOFR cap starting in 3 months at a 4.00% strike, on $10M paying down $500k a quarter:
Response (October 2026):
Each caplet carries its own notional, and premium_pct is measured against the first amount in the list. The caplets array above shows 2 of 12 for brevity. To check how many amounts the schedule needs, price it once with a single notional and read num_caplets.
Use Case: Visualising the Caplet Breakdown
Each caplet represents one reset period. Plotting NPVs and forward rates shows where value concentrates:

Near-term caplets (where forwards exceed the strike) carry more intrinsic value. Later caplets derive value from time value as forwards converge toward the strike.
Caplet Response Fields
accrual_start / accrual_end
The period the caplet covers
forward_rate
Implied forward rate for that period (%)
strike
The strike rate (%)
normal_vol_bps
Normal (Bachelier) implied volatility in basis points
npv
Present value of this caplet
delta
Rate sensitivity of this caplet
vega
Volatility sensitivity of this caplet
discount_factor
Discount factor to the payment date
accrual_fraction
Year fraction for the accrual period
First 4 caplets of the 3Y ATM SOFR cap (April 2026):
Jul--Oct 2026
3.66%
75.67
$6,298
0.672
Oct 2026--Jan 2027
3.63%
81.89
$7,891
0.592
Jan--Apr 2027
3.59%
83.68
$7,969
0.550
Apr--Jul 2027
3.55%
85.85
$9,002
0.525
Volatility Smile Models
The vol_smile parameter controls how implied volatility varies with strike:
auto (default)
SABR smile for SOFR (calibrated from market data), flat ATM vol for others
flat
ATM swaption vol for all strikes -- simpler, no skew
sabr
User-provided SABR parameters. Requires sabr_rho and sabr_nu
Parameters
index
Yes
Rate index (e.g., SOFR, SONIA, 3M EURIBOR)
start_date
Yes
Cap start date (0D for spot, or YYYY-MM-DD)
maturity_date
Yes
Cap maturity (3Y, 5Y, or YYYY-MM-DD)
strike_rate
No
Strike as percentage (e.g., 4.5). Omit for ATM
cap_or_floor
No
cap (default) or floor
notional
No
Notional amount. Default: 10,000,000. With POST, a list of amounts, one per caplet
frequency
No
Caplet frequency (1M, 3M, 6M). Default: 3M
valuation_time
No
Historical timestamp (ISO 8601) for reproducibility
vol_smile
No
auto (default), flat, or sabr
sabr_rho
No
SABR correlation (-1 to 1). Required for vol_smile=sabr
sabr_nu
No
SABR vol-of-vol (> 0). Required for vol_smile=sabr
Related Endpoints
The underlying swap rate
Forward rates for the cap period
Discount factors
The full swap curve
Need an API key? 📩 support@bluegamma.io | 📅 Book a call
Last updated
Was this helpful?

