# CDP

## Opening a CDP

In this section, you will learn how to open a CDP, via the web application.

{% hint style="info" %}
A wallet can only have one CDP opened for a given type of iAsset.

For example, **Wallet A** can only open 1 iUSD CDP and 1 iBTC CDP.&#x20;
{% endhint %}

### Summary

Opening a CDP requires to: (1) deposit some amount of ADA collateral and (2) input a collateral ratio. In exchange, some amount of iAsset will be minted (e.g.: opening a CDP for iBTC requires depositing ADA, in exchange the user will receive iBTC).

{% hint style="info" %}
The collateral ratio influences: (1) the amount of iAsset that will be minted, and (2) the risk of liquidation.&#x20;

The higher the collateral ratio, the fewer iAsset minted, but the lower the risk of liquidation is. On the contrary, the lower the collateral ratio, the more iAsset minted, but the higher the risk of liquidation.&#x20;
{% endhint %}

### Detail

{% hint style="info" %}
Ratios to know:\
Redemption Ratio: The ratio at which a CDP under this value is available for redemption.\
\
Maintenance Ratio: The ratio at which a user can open their CDP and the minimum CR that a user can have to mint tokens or adjust their position.\
\
Liquidation Ratio: The ratio at which a CDP is available for liquidation.
{% endhint %}

1\. From the Dashboard page, click on the **Open Position** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FjJ39SE5YNnUqT9fHECQq%2FCDP%2001%20Open%20Position%20-%20Dashboard.png?alt=media&#x26;token=c264913a-cbe8-44b0-b37c-6e5bdcd35260" alt=""><figcaption><p>Indigo Web App - Dashboard - Open Position</p></figcaption></figure>

2\. In the Open Position page you can either:

* Option A: let the web app choose for you the amount of iAsset to be minted; or
* Option B: choose the amount of iAsset to be minted.

{% tabs %}
{% tab title="Option A" %}

* Input a collateral amount or click on one of the button below to pre-fill the input field based on the ADA balance of the connected wallet.
* Input a collateral ratio or select one of the pre-defined value.

This will result in the amount of iAsset to be automatically computed.
{% endtab %}

{% tab title="Option B" %}

* Input a collateral ratio or select one of the pre-defined value.
* Input an iAsset amount

This will result in the collateral amount to be automatically computed.
{% endtab %}
{% endtabs %}

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FIOUtR7AWsYjdPxtATsQp%2FCDP%2002%20-%20Open%20Position.png?alt=media&#x26;token=aa29182f-1af9-4417-a807-7cec4e9fb04d" alt=""><figcaption><p>Indigo Web App - Open Position</p></figcaption></figure>

3\. Tick the checkbox, and click on the **Open Position** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, you will receive the minted iAssets in your wallet.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2Fqx8uLk7045tOAxDYrXSc%2FCDP%2003%20-%20Open%20Position%20-%20Sign.png?alt=media&#x26;token=249d934f-6986-44a7-b1b0-bdecc176adb3" alt=""><figcaption><p>Indigo Web App - Open Position - Sign Transaction</p></figcaption></figure>

## Depositing Collateral

In this section, you will learn how to deposit collateral to an existing CDP, via the web application.

### Summary

Once we have opened a CDP, you can interact with it in different ways; one of which is to deposit more collateral.

{% hint style="info" %}
Depositing more collateral into a CDP will increase its collateral ratio; this helps to keep the CDP healthy and lowers the risk of the CDP being liquidated.
{% endhint %}

### Detail

1\. From the Dashboard page, click on the **Manage** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FfSpowdiGVxcqDYLpzfRW%2FCDP%2004%20Manage%20Position%20-%20Dashboard.png?alt=media&#x26;token=09d652b6-aa97-4751-a94c-f8bef4fc4eff" alt=""><figcaption><p>Indigo Web App - Dashboard - Manage Position</p></figcaption></figure>

2\. Input the collateral amount you wish to deposit or click on one of the button below to pre-fill the input field based on the ADA balance of the connected wallet.

{% hint style="info" %}
Inputting different amount of collateral will automatically update the Collateral Ratio and Total Collateral values in the **Result** section.&#x20;

These values can be compared with the ones displayed in the **Current Position** section on the right side of the web page.&#x20;
{% endhint %}

3\. Tick the checkbox, and click on the **Deposit Collateral** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, your CDP will have a higher ADA collateral amount, and its collateral ratio will have increased.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FOsbWqy2KplzxzB1fLmyw%2FCDP%2004%20-%20Deposit.png?alt=media&#x26;token=1dffdebd-2e14-4e48-bda3-af631f5e4c94" alt=""><figcaption><p>Indigo Web App - Deposit Collateral</p></figcaption></figure>

## Withdrawing Collateral

In this section, we will learn how to withdraw collateral from an existing CDP, via the web application.

### Summary

Withdrawing collateral from a CDP means that you will take out a portion of the collateral that was deposited in the CDP.

{% hint style="info" %}
Withdrawing collateral from a CDP will decrease its collateral ratio, which in turn will increase the risk of the CDP being liquidated.

A Protocol Fee of 2% is incurred when withdrawing collateral, which is computed according to the amount of collateral to be withdrawn.
{% endhint %}

### Detail

1\. From the Dashboard page, click on the **Manage** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FfSpowdiGVxcqDYLpzfRW%2FCDP%2004%20Manage%20Position%20-%20Dashboard.png?alt=media&#x26;token=09d652b6-aa97-4751-a94c-f8bef4fc4eff" alt=""><figcaption><p>Indigo Web App - Dashboard</p></figcaption></figure>

2\. Input the collateral amount you wish to withdraw or click on one of the button below to pre-fill the input field based on the ADA balance of the connected wallet.

{% hint style="info" %}
Inputting different amount of collateral will automatically update the **Collateral Ratio** and **Total Collateral** values in the **Result** section.&#x20;

These values can be compared with the ones displayed in the **Current Position** section on the right side of the web page.&#x20;
{% endhint %}

3\. Tick the checkbox, and click on the **Withdraw Collateral** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, your CDP will have a lower ADA collateral amount, and its collateral ratio will have decreased.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FyzWg2sYetrqffhnaM7nq%2FCDP%2005%20-%20Withdraw.png?alt=media&#x26;token=f6af1477-3acc-4754-9e75-1984d47975d9" alt=""><figcaption><p>Indigo Web App - Withdraw Collateral</p></figcaption></figure>

## Minting iAssets

In this section, you will learn how to mint additional iAssets from an existing CDP, via the web application.

### Summary

Minting iAssets allows you to obtain more iAssets from an existing CDP. The amount of iAssets that can be minted depends on the current amount of collateral deposited in the CDP.

{% hint style="info" %}
Minting iAssets from a CDP will decrease its collateral ratio, which in turn will increase the risk of the CDP being liquidated.
{% endhint %}

### Detail

1\. From the Dashboard page, click on the **Manage** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FfSpowdiGVxcqDYLpzfRW%2FCDP%2004%20Manage%20Position%20-%20Dashboard.png?alt=media&#x26;token=09d652b6-aa97-4751-a94c-f8bef4fc4eff" alt=""><figcaption><p>Indigo Web App - Dashboard</p></figcaption></figure>

2\. Input the amount of iAssets you wish to mint or click on one of the button below to pre-fill the input field based on the current amount of collateral deposited in the CDP.

{% hint style="info" %}
Inputting different amount of iAssets will automatically update the **Collateral Ratio** and **Total Debt** values in the **Result** section.&#x20;

These values can be compared with the ones displayed in the **Current Position** section on the right side of the web page.&#x20;
{% endhint %}

3\. Tick the checkbox, and click on the **Mint iAsset** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, you will receive the requested amount of iAssets, and your CDP will have a lower collateral ratio.&#x20;

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2Fws1zyMRH6aLLHlkeIYxd%2FCDP%2006%20-%20Mint.png?alt=media&#x26;token=5b15f8f1-aaf2-400d-a29f-d57a78feeb78" alt=""><figcaption><p>Indigo Web App - Mint iAssets</p></figcaption></figure>

## Burning an iAsset

In this section, you will learn how to burn iAssets from an existing CDP, via the web application.

### Summary

Burning iAssets allows you to repay your debt. The amount of iAssets that can be burnt depends on the amount of iAssets you minted under the CDP.

{% hint style="info" %}
Burning iAssets from a CDP will increase its collateral ratio; this helps to keep the CDP healthy and lowers the risk of the CDP being liquidated.
{% endhint %}

### Detail

1\. From the Dashboard page, click on the **Manage** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FfSpowdiGVxcqDYLpzfRW%2FCDP%2004%20Manage%20Position%20-%20Dashboard.png?alt=media&#x26;token=09d652b6-aa97-4751-a94c-f8bef4fc4eff" alt=""><figcaption><p>Indigo Web App - Dashboard</p></figcaption></figure>

2\. Input the amount of iAssets you wish to burn or click on one of the button below to pre-fill the input field based on total amount of debt you owe (i.e.: the total amount of iAssets you minted under the CDP).

{% hint style="info" %}
Inputting different amount of iAssets will automatically update the **Collateral Ratio** and **Total Debt** values in the **Result** section.&#x20;

These values can be compared with the ones displayed in the **Current Position** section on the right side of the web page.
{% endhint %}

3\. Tick the checkbox, and click on the **Burn iAsset** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, you will have fewer iAssets in your wallet and your CDP will have a higher collateral ratio.&#x20;

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FAyqV8lwW4HmwwNf0Xwzv%2FCDP%2007%20-%20Burn.png?alt=media&#x26;token=1e8beba6-4407-42e3-b821-2fa1d921ab0b" alt=""><figcaption><p>Indigo Web App - Burn iAssets</p></figcaption></figure>

## Closing a CDP

In this section, you will learn how to close a CDP, via the web application.

### Summary

Closing a CDP allows you repay your debt in full and retrieve the total amount of collateral deposited under the CDP. Closing a CDP is final. If you wish to mint more iAssets, you will need to re-open a CDP.

{% hint style="info" %}
A Protocol Fee of 2% is incurred when closing a CDP, which is computed according to the total amount of collateral in the CDP. The collected fee will be distributed to INDY stakers.

If you do not have enough iAssets to close your CDP, you can buy more iAssets on a DEX.
{% endhint %}

### Detail

1\. From the Dashboard page, click on the **Manage** button.

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FfSpowdiGVxcqDYLpzfRW%2FCDP%2004%20Manage%20Position%20-%20Dashboard.png?alt=media&#x26;token=09d652b6-aa97-4751-a94c-f8bef4fc4eff" alt=""><figcaption><p>Indigo Web App - Dashboard</p></figcaption></figure>

2\. Input the total amount of iAssets you had minted, or click on the **100%** button below to automatically fill the input field.

{% hint style="info" %}
The **Result** section will automatically update and state that you are closing your CDP.&#x20;
{% endhint %}

3\. Tick the checkbox, and click on the **Close CDP** button. You will be prompted to sign the transaction. Once the transaction is validated on the blockchain, you will have repaid your debt and will have received the total amount of collateral you had deposited.&#x20;

<figure><img src="https://20369032-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnyeBVQAS0X1aGXABzyhK%2Fuploads%2FFGcMT2EbShpfdtxoHXu5%2FCDP%2008%20-%20Close.png?alt=media&#x26;token=a640f1ed-3c8b-4255-a113-c19316f1dde0" alt=""><figcaption><p>Indigo Web App - Close CDP</p></figcaption></figure>
