🌐 No-Code Collateralization Ratio Risk Calculator using Parabola.io | Covalent

TLDR; Parabola.io allows you to build data workflows with no code. An application of Covalent’s API is that it can be imported into Parabola to allow users to create data-rich applications on top of it, such as one with MakerDAO collateralization ratios.

🌐 No-Code Collateralization Ratio Risk Calculator using Parabola.io

Jul 27, 2020

TLDR; Parabola.io allows you to build data workflows with no code. An application of Covalent’s API is that it can be imported into Parabola to allow users to create data-rich applications on top of it, such as one with MakerDAO collateralization ratios.

A walkthrough of how to build your own MakerDAO collateralization ratio risk calculator using Parabola.

Understanding MakerDAO collateralization ratios

One of the applications of Covalent is that it can calculate the collatorization ratio risk of any of the current assets that you hold.

MakerDAO is the protocol behind the Dai stablecoin, a stablecoin implemented as an ERC20 token on the blockchain and designed to maintain 1:1 parity with the US dollar. The value of Dai is backed by collateral which is locked up in a smart contract, the Maker collateral vault. The Dai stablecoin is therefore created by users borrowing against locked collateral and destroyed when loans are repaid.

The debt-to-collateral ratio is the ratio of debt to collateral that the system allows. For example, with Maker, the Maker governance only allows what is considered to be a safe ratio. Borrowers who allow their positions to fall below the safe ratio risk forced liquidation, wherein a part of this collateral is sold at a discount in order to pay back their loan.

Using Parabola, you can develop a collaterization ratio risk calculator for MakerDAO that calculates what the warning threshold is and allows you to act accordingly if your assets are at risk.

Build a collaterization ratio risk calcuator using Parabola

Here are the steps that you can take to build a collaterization ratio risk calculator that warns you if you are dangerously close to being liquidated using Parabola, with no code required.

1. Covalent API Import

First, use a GET request in Parabola to import Covalent’s API:

Import Covalent's API using a GET request.

Then, using a demo.eth wallet, open up SafeKeep to run the UI. Enter the demo.eth wallet into SafeKeep, and use Maker to run the data. You should see the IDs of the different coins in the wallet displayed, as well as the safe ratio and the minimum liquidation ratio (min_liq_ratio). The coin IDs should be displayed on Parabola as well as on SafeKeep.

Viewing the Maker Vault and CDP data on SafeKeep.
Viewing the safe ratio and min_liq_ratio data on Parabola.

2. Apply Math Filter

Using a Math filter on Parabola, you can create a new column in the API called warncratio, which is equal to min_liq_ratio * 1.2. The warning that is built on Parabola notifies users if their current collaterization ratio is within 20% of the warning ratio.

Viewing the warncratio column in Parabola.

3. Apply If/Else Logic

Next, apply if/else login in Parabola and create a new column called warn. If the ratio is less than the warncratio, users will be notified that they are risking forced liqudidation. The warn column returns yes if this condition is true, and no if this condition is false.

Viewing the if/else logic and warn column in Parabola.

4. Apply Row Filter

Now, apply a Row filter to include rows in the warn column only if they equal yes. Users should only get an email notification with a warning if their assets are at risk of forced liquidation.

Viewing the row filter logic in Parabola.

5. Email Attachment Feature

Lastly, implement the email attacment feature on Parabola to attach any of the rows where the row column equals yes into an email sent directly to any user’s email inbox:

Viewing the email attachment on Parabola.

Natasha Khimji

Research Intern, Covalent

Join our newsletter

Subscribe to get news about our upcoming products and company milestones.