View source: R/risk-free-rate.R
scrape_cmt_data | R Documentation |
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)
scrape_cmt_data(url = NULL)
url |
|
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
...
## Scrape the CMT data for the current month: scrape_cmt_data()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.