# How CDP Work

<figure><img src="/files/ZxefLrhNbqgHHNU3K6cg" alt=""><figcaption></figcaption></figure>

Core actions

* **Open position** - Create a CDP by depositing supported collateral then borrow USDB.
* **Deposit more collateral** to existing position - Increase CR(Collateral Ratio) by increase collateral value.
* **Withdraw collateral from** existing position - Take partial collateral out, only if your position remains healthy(CR>MCR) after the change.
* **Borrow more USDB** - Draw more USDB liquidity against your collateral.
* **Repay** - Two ways
  * **Repay with USDB** - Use USDB you hold to repay debt.
  * **Repay with collateral** - Sell a portion of collateral into USDB to repay debt (available only for certain assets with sufficient DEX liquidity).
* **Close position** - Fully repay outstanding debt; withdraw remaining collateral.

> Rule of thumb: After every action, your position must satisfy **CR >= MCR** for that collateral type.

***

### Fees

* **No one-time borrow fee.**
* **Fixed borrow interest rate.**  Interest Rates for different collateral type are listed on [**Markets**](https://www.bucketprotocol.io/market).(Interest accrues in **real time)**

***

### Risk metrics

* **Collateral Ratio (CR)**\
  CR = Collateral Value / Debt value

  \= (Collateral Price \* Collateral Amount) / (initial Borrow Amount + Accrued Interest Fee)
* **Minimum Collateral Ratio (MCR)** \
  Each collateral has a fixed MCR requirement. If your **CR < MCR**, the position becomes eligible for liquidation.
* **Liquidation price** For a given debt and collateral value\
  Liquidation Price = (MCR \* Debt) / Collateral Amount

### Mint caps

* **Mint caps** exist per collateral to help manage market depth during liquidations and reduce slippage risk in extreme conditions.

### Example

**Assumptions:**

* SUI price: $5.00 per SUI
* Collateral: 1,000 SUI ($5000)
* SUI MCR Requirement = 110%&#x20;

**Max borrow at open :**\
Debt\_max = Collateral Value / MCR = 5,000 / 110% \~= 4,545.45 USDB

**If you borrow 4,000 USDB:**

* Entry CR = 5,000 / 4,000 \* 100%= 125%
* Liquidation price:

  \= (MCR \* Debt) / Collateral Amount

  \= (110% \* 4,000) / 1,000

  \= $4.40 per SUI
* If SUI falls near $4.40, your CR would approach 110% and the position could be liquidated.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bucketprotocol.io/mechanism/how-cdp-work.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
