Fetching a Swap Rate
Use the /swap_rate endpoint to calculate the par rate for a vanilla interest rate swap, given an index, start/maturity, and leg conventions.
import requests
url = "https://api.bluegamma.io/v1/swap_rate"
headers = {"x-api-key": "your_api_key_here"}
params = {
"index": "SOFR",
"start_date": "0D", # Today
"maturity_date": "10Y", # 10 years from today
"fixed_leg_frequency": "1Y",
"floating_leg_frequency": "1Y",
"fixed_leg_day_count": "Actual360",
"floating_leg_day_count": "Actual360"
}
response = requests.get(url, headers=headers, params=params)
print(response.json())curl -X GET "https://api.bluegamma.io/v1/swap_rate?index=SOFR&start_date=0D&maturity_date=10Y&fixed_leg_frequency=1Y&floating_leg_frequency=1Y&fixed_leg_day_count=Actual360&floating_leg_day_count=Actual360" \
-H "x-api-key: your_api_key_here"Last updated
Was this helpful?

