{"id":25828174,"url":"https://github.com/risktoollib/rtl","last_synced_at":"2025-04-09T22:16:41.130Z","repository":{"id":37771491,"uuid":"230527896","full_name":"risktoollib/RTL","owner":"risktoollib","description":"R package for commodities and finance analytics. Sister python package details below.","archived":false,"fork":false,"pushed_at":"2025-02-26T12:54:05.000Z","size":187441,"stargazers_count":30,"open_issues_count":2,"forks_count":8,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-09T22:16:36.233Z","etag":null,"topics":["analytics","api","commodities","commodities-api","finance","genscape","morningstar","python","r","risk-management"],"latest_commit_sha":null,"homepage":"","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/risktoollib.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-27T22:39:09.000Z","updated_at":"2025-02-26T12:54:08.000Z","dependencies_parsed_at":"2023-02-18T06:45:30.226Z","dependency_job_id":null,"html_url":"https://github.com/risktoollib/RTL","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risktoollib%2FRTL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risktoollib%2FRTL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risktoollib%2FRTL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/risktoollib%2FRTL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/risktoollib","download_url":"https://codeload.github.com/risktoollib/RTL/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248119288,"owners_count":21050755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","api","commodities","commodities-api","finance","genscape","morningstar","python","r","risk-management"],"created_at":"2025-02-28T17:24:08.181Z","updated_at":"2025-04-09T22:16:41.109Z","avatar_url":"https://github.com/risktoollib.png","language":"R","readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n\u003c!-- badges: start --\u003e\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/RTL)](https://cran.r-project.org/package=RTL)\n[![metacran downloads](https://cranlogs.r-pkg.org/badges/RTL)](https://cran.r-project.org/package=RTL)\n[![R-CMD-check](https://github.com/risktoollib/RTL/workflows/R-CMD-check/badge.svg)](https://github.com/risktoollib/RTL/actions)\n\u003c!-- badges: end --\u003e \n\n## Overview\n\nRTL is a purposely designed for traders, analysts and risk practitioners in Commodities and Finance. It also supports delivery of Finance classes from one of the creator also in Academics at the [Alberta School of Business](https://www.ualberta.ca/en/business/index.html).\n\nSend feedback to `pcote@ualberta.ca`. We welcome feedback, suggestions and collaboration.\n\n### Energy Markets Reference Data\n\n+ `expiry_table`: NYMEX and ICE contracts expiry tables.\n+ `holidaysOil`: Holiday calendars for NYMEX and ICE.\n+ `tradeCycle`: US and Canadian crude oil trading calendars.\n+ `tickers_eia`: Mapping of EIA tickers to crude and refined products markets for building supply demand balances.\n+ `eiaStorageCap`: Historical EIA crude storage capacity by PADD.\n+ `eiaStocks`: Sample data set of EIA.gov stocks for key commodities.\n\n### Swap Pricing and Contract Roll Adjustement\n\n+ `rolladjust()` adjusts continuous contracts returns for roll adjustments using `expiry_table`.\n+ `swapCOM()` computes Calendar Month Average commodity swap prices. \n+ `swapInfo()` returns all information required to price first line futures contract averaging swap or CMA physical trade, including a current month instrument with prior settlements. \n+ `swapIRS()` computes IRS swap prices. \n\n### Charting\n\n+ `chart_fwd_curves()`: plots historical forward curves, a useful feature to understand the pricing dynamics of a market. \n+ `chart_zscore()` supports seasonality adjusted analysis of residuals, particularly useful when dealing with commodity stocks and/or days demand time series with trends as well as non-constant variance across seasonal periods.\n+ `chart_eia_steo()` and `chart_eia_sd()` return either a chart or dataframe of supply demand balances from the EIA.\n+ `chart_spreads()` to generate specific contract spreads across years e.g. ULSD March/April. Requires Morninstar credentials.\n+ ...\n\n### APIs\n\nValid credentials for commercial API services are required. \n\n#### Genscape\n\n[Genscape API ](https://developer.genscape.com/) functions:\n\n+ `getGenscapeStorageOil()`.\n+ `getGenscapePipeOil()`.\n\n#### Morningstar Commodities\n\n[Morningstar Marketplace API](https://mp.morningstarcommodity.com/marketplace/) functions:\n\n+ `getPrice()`, `getPrices()` and `getCurve()` using your own Morningstar credentials. Current feeds included:\n\n  + ICE_EuroFutures and ICE_EuroFutures_continuous.\n  + CME_NymexFutures_EOD and CME_NymexFutures_EOD_continuous.\n  + CME_NymexOptions_EOD.\n  + CME_CbotFuturesEOD and CME_CbotFuturesEOD_continuous.\n  + CME_Comex_FuturesSettlement_EOD and CME_Comex_FuturesSettlement_EOD_continuous.\n  + LME_AskBidPrices_Delayed.\n  + CME_CmeFutures_EOD and CME_CmeFutures_EOD_continuous.\n  + CME_STLCPC_Futures.\n  + ICE_NybotCoffeeSugarCocoaFutures and ICE_NybotCoffeeSugarCocoaFutures_continuous.\n  + Morningstar_FX_Forwards.\n  + ... see `?getPrice` for up to date selection and examples.\n\n### GIS Dataset\n\n#### EIA\n\n+ crudepipelines \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/CrudeOil_Pipelines_US_EIA.zip\")`\n+ refineries \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/Petroleum_Refineries_US_EIA.zip\")`\n+ productspipelines \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/PetroleumProduct_Pipelines_US_EIA.zip\")`\n+ productsterminals \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/PetroleumProduct_Terminals_US_EIA.zip\")`\n+ ngpipelines \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/NaturalGas_InterIntrastate_Pipelines_US_EIA.zip\")`\n+ ngstorage \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/PetroleumProduct_Terminals_US_EIA.zip\")`\n+ nghubs \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/NaturalGas_TradingHubs_US_EIA.zip\")`\n+ lngterminals \u003c- `getGIS(url = \"https://www.eia.gov/maps/map_data/Lng_ImportExportTerminals_US_EIA.zip\")`\n+ `tradeHubs` has North Americas crude oil trading hubs (WIP).\n\n#### Alberta Oil Sands, Petroleum and Natural Gas\n\n+ AB \u003c- `getGIS(url = \"https://gis.energy.gov.ab.ca/GeoviewData/OS_Agreements_Shape.zip\")`\n\n### Interest Rates\n\n+ `usSwapIR`: Sample data set output of `getIRswapCurve`.\n+ `usSwapCurves`: Sample data set output of `RQuantlib::DiscountCurve()`.\n\n## Python\n\nA python version of RTL for most functions is available at https://pypi.org/project/risktools/.\n\n## Installation\n\n**Latest Package**\n`devtools::install_github(\"risktoollib/RTL\")`\n\n**CRAN Stable**\n`install.packages(\"RTL\")`\n\n\n\n\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisktoollib%2Frtl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frisktoollib%2Frtl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frisktoollib%2Frtl/lists"}