https://github.com/imanuelcostigan/dataonderivatives
Easily source publicly available data on derivatives
https://github.com/imanuelcostigan/dataonderivatives
cran derivative derivatives r
Last synced: 6 months ago
JSON representation
Easily source publicly available data on derivatives
- Host: GitHub
- URL: https://github.com/imanuelcostigan/dataonderivatives
- Owner: imanuelcostigan
- Created: 2014-09-19T02:38:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T01:02:33.000Z (almost 4 years ago)
- Last Synced: 2025-03-02T00:02:49.827Z (8 months ago)
- Topics: cran, derivative, derivatives, r
- Language: R
- Homepage: http://imanuelcostigan.github.io/dataonderivatives/
- Size: 3.44 MB
- Stars: 37
- Watchers: 12
- Forks: 15
- Open Issues: 6
-
Metadata Files:
- Readme: README.Rmd
Awesome Lists containing this project
README
---
output: github_document
---```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```# OTC derivatives data
Liquidity and pricing in the over-the-counter (OTC) derivative markets have tended to have less transparent than their exchange traded (lit) equivalents. The Bank of International Settlements (BIS) has [published statistics](https://www.bis.org/statistics/derstats.htm) of trading in the OTC markets on a triennial basis. However, representative statistics of volume and pricing data on a more frequent basis has been near impossible to obtain. Post-GFC derivatives reforms have lifted the veil in these markets.
## Swap execution facilities
Some Over-The-Counter (OTC) derivatives have been Made Available for Trade (MAT) by the CTFC. This means they must be traded on [Swap Execution Facilities (SEFs)](https://www.cftc.gov/IndustryOversight/TradingOrganizations/SEF2/index.htm). These SEFs are compelled publish trading volume and prices for these MAT derivatives on a daily basis.
Some of the most widely used SEFs are run by [Bloomberg](https://www.bloomberg.com/professional/product/swap-execution-facility/), [ICAP](https://tpicap.com/tpicap/regulatory-hub/tp-icap-sef), [Tullett Prebon](https://www.tullettprebon.com/swap-execution-facility/) and [Tradeweb](https://www.tradeweb.com/our-markets/market-regulation/sef/) among others.
## Swap data repositories
The key economic terms of traded swaps must be reported to an authorised [Swap Data Repository (SDR)](https://www.cftc.gov/IndustryOversight/DataRepositories/index.htm). Some of the most widely used SDRs are the [DTCC Data Repository](https://www.dtcc.com/repository-and-derivatives-services/repository-services/gtr-north-america), [ICE Trade Vault](https://www.theice.com/technology/post-trade) and the [CME's SDR](https://www.cmegroup.com/trading/global-repository-services/cme-swap-data-repository.html). The [CFTC provides weekly snapshots](https://www.cftc.gov/MarketReports/SwapsReports/index.htm) of data collected by these SDRs on a weekly basis. SDRs domiciled in different regulatory jurisdictions are expected to provide differing levels of data. [U.S. regulations](https://www.cftc.gov/IndustryOversight/DataRepositories/index.htm) compel U.S. domiciled SDRs to provide (anonymised) trade level data to the public while SDRs in other jurisdictions (e.g. in [Europe](https://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2013:052:0033:0036:EN:PDF)) expected far less granular, and typically only aggregated, data.
# dataonderivatives
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://CRAN.R-project.org/package=dataonderivatives)
[](https://github.com/imanuelcostigan/dataonderivatives/actions)
[](https://app.codecov.io/gh/imanuelcostigan/dataonderivatives?branch=master)You can source OTC derivatives data from supported sources. Supported sources include BloombergSEF and several U.S. domiciled SDRs including DTCC's DDR, Bloomberg's SDR and CME. SDRs in other jurisdictions do not provide trade level data and consequently these sources are unsupported. Further sources that provide trade level data will be added over time (and pull requests to that end are welcome).
## Usage
You can download daily trade data executed on the BloombergSEF:
```{r bsef}
library("dataonderivatives")
bsef(as.Date("2021-12-13"), asset_class = "IR")
# Get more than one day's data
bsef(as.Date("2021-12-13"), as.Date("2021-12-17"), asset_class = "IR")
```You can also download the data reported to the DTCC's and CME's SDRs:
```{r ddr}
ddr(as.Date("2021-12-13"), "IR")
cme(as.Date("2021-12-13"), "CO")
```