Postgres Database

Postgres database instance used in the Risk Engine

Introduction

We use Postgres as our online datasource for the Risk Engine services.

It is deployed as a managed instance in GCP SQL.

Schemas

So far, there are 2 schemas created in the risk engine postgres database:

  • airflow: This is the backend schema for Apache Airflow; we generally interact with airflow through the frontend interface or command line and this database is strictly reserved to airflow operations. Except when doing airflow migration or other maintenance, we should never touch it. See airflow documentation for more details.

  • ds_models: This schema stores feature engineering outputs and DS model's outputs. The features and scores go into different tables grouped by model purpose (collateral, loan&policy, etc.) More details on the important tables in the dedicated section.

ds_models

So far, this schema has only 2 tables.

ds_models.tokens

This one is only filled with BTC and ETH so far.

ds_models.tokens

ds_models.collateral_features

ds_models.collateral_features

Features are associated to:

  • a group and a version, for example ITB=IntoTheBlock version 0.0.1 feature engineering code in the screenshot above;

  • a token;

  • a particular date.

These features are generated daily by an airflow DAG.

Last updated