> For the complete documentation index, see [llms.txt](https://docs.arenas.fi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arenas.fi/arenas/credit-delegation.md).

# Credit Delegation Module (CDM)

The **Credit Delegation Module (CDM)** is the **only contract Arenas deploys**. It connects two external systems — **Aave v3** (Base) for liquidity and **Atomica** (Base) for credit — so a supplier can put idle Aave collateral to work in Atomica financing pools.

***

### What it does

The CDM automates the **borrow-from-Aave, supply-to-Atomica** strategy in one place:

1. A supplier keeps collateral on **Aave v3** (earning Aave’s base supply yield).
2. They **delegate borrowing power** to the CDM using Aave’s standard credit-delegation interface.
3. The CDM **borrows from Aave** against that delegated power and **supplies the liquidity into Atomica** pools.
4. Because Atomica’s supply yield exceeds the Aave borrow rate, the supplier earns the **spread** as bonus yield — on top of the base Aave yield they keep.

```mermaid
flowchart LR
    S[Supplier] -->|1. supply collateral| Aave[(Aave v3 · Base)]
    S -->|2. approveDelegation| CDM[Arenas CDM]
    CDM -->|3. borrow onBehalfOf| Aave
    CDM -->|4. supply| Atomica[(Atomica pools · Base)]
    Atomica -->|spread / yield| S
```

***

### Aave credit delegation (the mechanism it builds on)

The CDM uses Aave’s native credit delegation — nothing forked or reimplemented:

* The supplier (**delegator**) calls `approveDelegation` on the relevant Aave **`VariableDebtToken`**, authorizing the CDM (**delegatee**) for an amount.
* The CDM calls `borrow` on the Aave **`Pool`** with the delegator’s address as `onBehalfOf`.
* Aave’s own rules still apply: eMode category must match, and a borrow that would push the delegator’s **health factor** below the liquidation threshold reverts. Collateral must be supplied before the borrow executes.

***

### Risk

This is a **leveraged** position. The borrowed amount accrues Aave interest, the delegator’s Aave collateral remains subject to Aave’s health-factor and liquidation rules, and the Atomica financing carries credit risk. The bonus only holds while Atomica yield exceeds the Aave borrow cost. See the [Aave Market](/arenas/aave-market.md) strategy and [Atomica Risks](/atomica/atomica-risks.md).

***

> **Not affiliated with Aave.** Aave v3 is a permissionless public good; Arenas uses its publicly available liquidity and the standard credit-delegation interface. Aave is one optional, external liquidity source — not the Arenas engine.
