Skip to content

Data Migration Scripts Setup

This guide focuses on the prerequisites and setup required to run the account state and trade migration scripts that mock trade related data from Deribit and hydrate our MySQL and Big Query for general testing. They can be used for quality control, smoke tests, integration tests and more. The purpose of this data is to be able to mock and "visualize" certain state in the databases that would be otherwise difficult to do manually.

Diagrams of how the scripts work can be found in the documentation directory.

ARB Market Data: Please be aware that for ARB markets, we actually query XRP from deribit and use it as out "mock" trade data since it is close in price to ARB.

Prerequisites

Please follow instructions in the sql readme as well as the bq readme for proper connection setup.

Prior to running scripts, a prisma client must be initialized. Run the following in the terminal:

   yarn prisma generate --schema=libs/connections-ts/prisma/schema.prisma

Running Scripts

Each script is run seperately. You can run them using the following command:

   yarn ts-node --project libs/mockData/tsconfig.json -r tsconfig-paths/register libs/mockData/test/file-name.ts

When the script is finished, use control + c to exit in terminal. PLEASE READ EACH SCRIPT CAREFULLY BEFORE RUNNING. See comments at the top of each script.

NOTE: The latest BigQuery schema can be found here and the latest MySQL schema can be found here


This documentation is generated from the service README. For the most up-to-date information, refer to the original README