Skip to content

Latest commit

 

History

History
91 lines (70 loc) · 8.56 KB

File metadata and controls

91 lines (70 loc) · 8.56 KB

Web Application allowing to find Option RICs

Example Code Disclaimer: ALL EXAMPLE CODE IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS FOR ILLUSTRATIVE PURPOSES ONLY. REFINITIV MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THE EXAMPLE CODE, OR THE INFORMATION, CONTENT, OR MATERIALS USED IN CONNECTION WITH THE EXAMPLE CODE. YOU EXPRESSLY AGREE THAT YOUR USE OF THE EXAMPLE CODE IS AT YOUR SOLE RISK.

Project Overview

Currently one cannot directly access expired options through a single API call. To get historical data on options, one will need to reconstruct options Refinitiv Identification Codes (RIC) following the logic of RIC construction rules and the rules specified by the exchange where the option is traded. The current project is a React Web app which allows to reconstruct/find option RICs on equities and indices, including the ones which are expired.

The current version covers the following exchanges:

  • US OPRA - refer to RULES7, RULES2, RULES3, RULES4 in Workspace, and Guideline for strikes above 10000 in MyRefinitiv.
  • EUREX - refer to RULES2, RULES3, RULES4 in Workspace, and general option RIC structure in MyRefinitiv.
  • Osaka Exchange - refer to RULES2, RULES3, RULES4 in Workspace, and RIC structure for Osaka exchange in MyRefinitiv.
  • Stock Exchange of Hong Kong - refer to RULES2, RULES3, RULES4 in Workspace, and RIC structure for HK exchange in MyRefinitiv.
  • Hong Kong Future Exchange - refer to RULES2, RULES3, RULES4 in Workspace, and RIC structure for HK exchange in MyRefinitiv.
  • Intercontinental Exchange (ICE) - refer to RULES2, RULES3, RULES4 in Workspace, and general option RIC structure in MyRefinitiv.

In the scope of this project we use the Refinitiv Data Library for Typescript in the Backend to retrieve options data and prices. In the Frontend we use Refinitiv Element Framework for Refinitiv UI elements and Workspace SDK to ensure the interoperability between our Web App and Refinitiv Workspace.

Supported Web Browsers

The example supports Chrome/Microsoft Edge (Chrome-based version), Firefox, and IE11 (based on the WebSocket and Web Workers browser supported platform).

Prerequisite

This example requires the following dependencies software.

  1. Node.js runtime which also includesnpm package manager - tested on 18.15.0,
  2. MongoDB Community Edition - tested on 6.0.5.

The project is build using Node.js in backend and React.js the frontend. We are using MongoDB to store reconstructed options RICs and metadata. The project includes complete TypeScript source codes, a simple Express.js web server application file, CSS files, and all required static dependencies. All dynamic dependencies for compiling and building source files are defined in package.json files respectively for backend and for the frontent. These dependencies can be installed via npm install command.

Project Structure

The project includes the following files and folders:

  • backend/folder
    • src/folder
      • APIRequests/folder - folder includes functions for requesting data from Refinitiv APIs, particularly it uses the historical pricing, symbol conversion and search (with navigators) capabilities of RD Library for Typescript.
      • Common/folder - folder contains the session.ts file which will allow the creating and opening API sessions for data requests.
      • getRICExchanges/folder - folder includes separate functions to construct RICs from the abovementioned 6 exchanges.
      • helper/folder - folder contains helper functions for getting experation month for OPRA traded options and check the reconstructed RICs.
      • models/folder - folder includes a function which defines mongoose schema for storing reconstructed RICs and metadata.
      • routes/folder - folder contains express routes for the web application.
      • schemas/folder - folder contains a Joi schema for the form we are using to construct option RIC.
      • utils/folder - folder contains utility functions for catching async requests and handling express errors.
      • app.ts - application file to connect to MongoDb and run the server
      • getOptionRIC.ts - main function which is called after submitting RIC constructer request. This function first checks in which exchanges options on the required asset are traded and calls the respective exchange specific functions for RIC construction.
      • session.config.json - file to store API credentials for opening API session.
    • package.json - project's NPM dependencies file for the backend
    • rdplibconfig.prod.json - rdp configuration file
    • tsconfig.json - typescript configuration file for the backend
  • frontent/folder
    • public/folder - folder contains public html file
    • src/folder
      • components/folder - folder contains web application pages, including the main pages and footer, header.
      • helper/folder - folder contains helper functions to create datatables, charts and handle click, delete events. Additionally, it contains workspace-sdk-services.ts file which initializes side by side service and defines functions to open and/or broadcast Refinitiv Workspace pages.
      • app.css - CSS file for the project
      • index.tsx - file to create the React root element and render React pages.
      • reportWebVitals.ts
      • session.config.json - file to store API credentials for opening API SxSSession.
    • package.json - project's NPM dependencies file for the frontend
    • tsconfig.json - typescript configuration file for the frontend

How to run this example application

  1. Make sure you have installed the dependency software, such as Node JS and Mongo DB.

  2. Unzip or download the example project folder into a directory of your choice

  3. Run $> npm install in the command prompt to install all the dependencies required to run the sample in a subdirectory called node_modules/. Please note that you will need to run $> npm install in both backend and frontend folders to install dependencies for thw backend and frontend respectively. npm command display

  4. Connect to a MongoDB deployment following the guide here. mongo connect display

  5. Initialize the backend - navigate to root/backend/src folder in the command prompt and run npx nodemon app.ts backend initialized display

  6. Start the frontend to launch the app - navigate to root/frontend folder in the command prompt and Run npm run build in the command prompt then run npx serve -s build -p 8080 to serve the application on port 8080. npm run build display

  7. Open application in localhost:8080: app screen display

References

For further details, please check out the following resources:

For any questions related to this article or the used APIs, please use the Developer Community Q&A Forum.