Package 'dataonderivatives'

Title: Easily Source Publicly Available Data on Derivatives
Description: Post Global Financial Crisis derivatives reforms have lifted the veil off over-the-counter (OTC) derivative markets. Swap Execution Facilities (SEFs) and Swap Data Repositories (SDRs) now publish data on swaps that are traded on or reported to those facilities (respectively). This package provides you the ability to get this data from supported sources.
Authors: Imanuel Costigan [aut, cre]
Maintainer: Imanuel Costigan <[email protected]>
License: GPL-2
Version: 0.4.0
Built: 2024-12-08 04:31:23 UTC
Source: https://github.com/imanuelcostigan/dataonderivatives

Help Index


Get Bloomberg SEF data

Description

The Bloomberg Swap Execution Facility (SEF) offers customers the ability to execute derivative instruments across a number of different asset classes. It is required to make publicly available price, trading volume and other trading data. It publishes this data on its website. I have reverse engineered the JavaScript libraries used by its website to call the Bloomberg Application Service using POST requests to a target URL.

Usage

bsef(start, end = start, asset_class)

Arguments

start

the date from which data is required as Date or DateTime object. Only the year, month and day elements of the object are used. Must be of length one.

end

the date for which data is required as Date or DateTime object. Only the year, month and day elements of the object are used. Must be of length one. Defaults to the start date.

asset_class

the asset class for which you would like to download trade data. Valid inputs are "CR" (credit), "IR" (rates), "EQ" (equities), "FX" (foreign exchange), "CO" (commodities) and must be a string.

Value

a tibble containing the requested data, or an empty tibble if data is unavailable

References

Bloomberg SEF data

Examples

## Not run: 
bsef(as.Date("2021-05-12"), as.Date("2021-05-14"), "IR")

## End(Not run)

Get CME SDR data

Description

The CME Swap Data Repository (SDR) is a registered U.S. swap data repository that allows market participants to fulfil their public disclosure obligations under U.S. legislation. CME is required to make publicly available price, trading volume and other trading data. It publishes this data on an FTP site. Column specs are inferred from all records in the file (i.e. guess_max is set to Inf when calling readr::read_csv).

Usage

cme(date, asset_class, show_col_types = FALSE)

Arguments

date

the date for which data is required as Date or DateTime object. It will only use the year, month and day elements to determine the set of trades to return. It will return the set of trades for the day starting on date.

asset_class

the asset class for which you would like to download trade data. Valid inputs are "IR" (rates), "FX" (foreign exchange), "CO" (commodities). This must be a string.

show_col_types

if FALSE (default), do not show the guessed column types. If TRUE always show the column types, even if they are supplied. If NULL only show the column types if they are not explicitly supplied by the col_types argument.

Value

a tibble containing the requested data, or an empty tibble if data is unavailable

References

CME SDR

Examples

## Not run: 
cme(as.Date("2015-05-06"), "CO")

## End(Not run)

Get DDR data

Description

The DTCC Data Repository is a registered U.S. swap data repository that allows market participants to fulfil their public disclosure obligations under U.S. legislation. This function will give you the ability to download trade-level data that is reported by market participants. Column specs are inferred from all records in the file (i.e. guess_max is set to Inf when calling readr::read_csv).

Usage

ddr(date, asset_class, show_col_types = FALSE)

Arguments

date

the date for which data is required as Date or DateTime object. Only the year, month and day elements of the object are used and it must of be length one.

asset_class

the asset class for which you would like to download trade data. Valid inputs are "CR" (credit), "IR" (rates), "EQ" (equities), "FX" (foreign exchange), "CO" (commodities). This must be a string.

show_col_types

if FALSE (default), do not show the guessed column types. If TRUE always show the column types, even if they are supplied. If NULL only show the column types if they are not explicitly supplied by the col_types argument.

Value

a tibble that contains the requested data. If no data exists on that date, an empty tibble is returned.

References

DDR Real Time Dissemination Platform

Examples

## Not run: 
ddr(as.Date("2017-05-25"), "IR") # Not empty
ddr(as.Date("2020-12-01"), "CR") # Not empty

## End(Not run)