Giter Site home page Giter Site logo

deriv-market-datahub's Introduction

deriv-market-datahub

Problem description

We would like to analyze the market data for indices and track daily market changes.

We will leverage the Deriv API to retrieve the necessary market data. The Deriv API provides a way to fetch market data for indices and various other assets. Refer to the API documentation here for more details.

Data of Interest:

  • Dimensions: Symbol, Country, Asset
  • Closing tick Our primary interest is capturing closing tick data for a select group of actively traded symbols, which will be stored in BigQuery.
  • Daily candle data for the past 30 days for each symbol.

Solution

  • The plan is to extract market data, store it in BigQuery for further analysis, and create a dashboard in Data Studio.
  • To start, we will create a data pipeline that fetches the last tick for some active symbols and stores them in GCS (which will act as our data lake). We also plan to store the historical data for the last 30 days for each symbol, then load it into our data warehouse, BigQuery.
  • This data pipeline will be created using Google Cloud Composer, a fully managed workflow orchestration service that empowers you to author, schedule, and monitor pipelines that span across clouds and on-premises data centers.
  • Next, we'll model our data using dbt, a command-line tool that allows data analysts and engineers to effectively transform data in their warehouses.
  • Finally, we will create a dashboard in Data Studio to visualize the data.
  • Check the dashboard here ๐Ÿ“ˆ๐Ÿ“Š.

Prerequisites

A Google Cloud Platform account. If you do not have a GCP account, create one now from here.

Architecture

Check the full architecture here

Architecture

Setup

Terraform

  • run: gcloud auth application-default login

  • Display the project IDs for your Google Cloud projects: gcloud projects list

  • Using the applicable project ID from the previous step, set the default project to the one in which you want to enable the API: gcloud config set project YOUR_PROJECT_ID

  • Display the project Number for your Google Cloud projects: gcloud projects describe YOUR_PROJECT_ID

  • Open terraform/terraform.tfvars in your text editor, and paste in the configuration below. Be sure to replace <PROJECT_ID> with your project's ID, and <PROJECT_NUMBER> project with your project's Number then save the file.

  • Open terraform/variables.tf in your text editor, replace <market_data_bucket> default value with your selected name then save the file. (as bucket names should be unique across all GCP projects)

  • Enable Compute Engine API: gcloud services enable compute.googleapis.com

  • Enable the Cloud Composer API: gcloud services enable composer.googleapis.com

  • Go to the terraform directory: cd terraform

  • Run terraform init to initialize the Terraform configuration.

  • Run terraform plan to view the resources that Terraform will create.

  • Run terraform apply -auto-approve to create the resources.

  • Run terraform show to view the resources that Terraform created.

Composer Note

Due to Quotas limit on the size of environments and amount of workers, you may need to run the dags in batches by enabling them one by one. Avoid running all the dags at once, as it may exceed the worker quota limit and cause the worker environment to fail.

Cleanup

  • Once done run terraform destroy to delete the resources.
  • Make sure to delete any remaining disks, as they are not automatically deleted by Terraform. here
  • Make sure to delete the Bucket created by Terraform. here

deriv-market-datahub's People

Contributors

marloxo avatar omar-binary avatar

Stargazers

Milad Bahrami avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.