scrape_cmt_data: Scrape the CMT data form the US Treasury website

View source: R/risk-free-rate.R

scrape_cmt_dataR Documentation

Scrape the CMT data form the US Treasury website

Description

According to the 2019 VIX whitepaper, "the risk-free interest rates, R1 and R2, are yields based on U.S. Treasury yield curve rates (commonly referred to as "Constant Maturity Treasury", rates or CMTs), to which a cubic spline is applied to derive yields on the expiration dates of relevant SPX options. As such, the VIX Index calculation may use different risk-free interest rates for near- and next-term options. Note in this example, T2 uses a value of 900 for Settlement day, which reflects the 4:00 p.m. ET expiration time of the next-term SPX Weeklys options."

This data can be retrieved from the US Treasury website (link works as of 2020-10-14)

Usage

scrape_cmt_data(url = NULL)

Arguments

url

character scalar an URL to the US Treasury website. Defaults to the complete dataset. Also accepts links from this website with other selections than "All", see e.g. the example.

Value

Returns a data.table containing the following columns:

  • Date (date) - the day of the observation

  • maturity A (numeric, decimal) - the CMT rate for the respective maturity in decimal

  • ...

Examples


## Scrape the CMT data for the current month:
scrape_cmt_data()


m-g-h/R.MFIV documentation built on July 4, 2022, 3:35 a.m.