/kr-challenge

Primary LanguageJupyter Notebook

Keyrock Challenge

Install

It is highly recommended that you use rye for managing the project. You will also need to have just installed locally.

When it's installed, run:

just install

This will:

  1. Install the rye project
  2. Install the recommended hooks

Running

You can either look at the jupyter notebook under './notebook.ipynb' Or, you can look at the code under ./src/challenge/__init__.py which you can also run via rye run dev

There are some helpers methods that you can use:

  1. just dev will run rye run dev but watch for .py file changes with nodemon (You'll need to install it)
  2. just rs_dev will run the pyo3 project, making sure that on ever .rs change (again watched with nodemon) maturin will run with the release flag
  3. just local_docker will spin docker containers for grafana and clickhouse.

Please note that the grafana dashboard will be auto generated for you. It will be lacking the data as clickhouse would be empty, until you run the commands.

Getting the Data

There are 2 ways of getting the data:

  1. You either use the saved files commited under ./data/*.parquet
  2. Or, you download them yourself. Please look at the ./src/challenge/challenge.py file for more info

Grafana dashboard

Grafana is hosted on http://localhost:8000. The user is admin and password is pass.

There are 2 dashboards created for you:

  1. The Data Analysis dashboard shows the historical data from 1inch and binance
  2. The Backtest dashboard shows the PnL over time, positions taken, and other relevant backtest info

Please note that the data for these dashboards is pre-filled in the simulation.