Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/developer/crvusd/amm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Each market deploys its own AMM from a blueprint contract. Source code is availa
:::

:::info[Contract Versions]
The AMM (LLAMMA) contract is shared across all Controller versions. Unlike the Controller, the AMM API has remained stable — the same contract is used by both crvUSD mint markets and Llamalend markets. For version details, see the [crvUSD Overview](./overview.md#controller--amm-versions).
The AMM (LLAMMA) contract is shared across all Controller versions. Unlike the Controller, the AMM API has remained stable — the same contract is used by both crvUSD mint markets and LlamaLend v1 markets. LlamaLend v2 uses a separately deployed AMM implementation; see the [v2 AMM reference](../llamalend-v2/amm.md).
:::

:::info Getting familiar with LLAMMA
Expand Down
18 changes: 9 additions & 9 deletions docs/developer/crvusd/controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Each market deploys its own Controller from a blueprint contract. Source code is
:::

:::info[Contract Versions]
This page documents **Controller V3** (Vyper 0.3.10), the current blueprint used for new crvUSD mint markets and all Llamalend markets. Where the API differs from earlier versions, both implementations are shown in tabs.
This page documents **Controller V3** (Vyper 0.3.10), the current blueprint used for new crvUSD mint markets and **LlamaLend v1** markets. LlamaLend v2 uses a separate Vyper 0.4.3 `LendController`; see the [v2 reference](../llamalend-v2/lend-controller.md). Where the API differs from earlier versions, both implementations are shown in tabs.

| Version | Vyper | Markets |
|---------|-------|---------|
| V1 | 0.3.7 | sfrxETH (v1), wstETH, WBTC, WETH |
| V2 | 0.3.9 | sfrxETH (v2), tBTC |
| **V3** | **0.3.10** | **weETH, cbBTC, LBTC + all Llamalend** |
| **V3** | **0.3.10** | **weETH, cbBTC, LBTC + LlamaLend v1** |

For full version details, see the [crvUSD Overview](./overview.md#controller--amm-versions).
:::
Expand All @@ -36,9 +36,9 @@ For full version details, see the [crvUSD Overview](./overview.md#controller--am
Minting crvUSD is only possible with whitelisted collateral approved by the DAO. Users provide collateral, which is deposited into LLAMMA according to the number of bands chosen. crvUSD is **backed by the assets provided as collateral**. The system does not actually mint crvUSD — tokens are "pre-minted" to the Controller from which they can be borrowed.

</DocCard>
<DocCard title="Curve Lending Markets" icon="vyper" link="../lending/overview" linkText="Lending Overview">
<DocCard title="LlamaLend v1 Markets" icon="vyper" link="../lending/overview" linkText="Legacy reference">

In lending markets, any token composition is possible as long as one of the assets is crvUSD. Unlike the minting system, borrowed assets are **not minted but provided by lenders** who deposit into an [ERC-4626 Vault](../lending/contracts/vault.md), where they earn interest.
In LlamaLend v1 markets, one asset must be crvUSD. Unlike the minting system, borrowed assets are **not minted but provided by lenders** who deposit into an [ERC-4626 Vault](../lending/contracts/vault.md), where they earn interest. LlamaLend v2 supports any ERC-20 pair.

</DocCard>
</DocCardGrid>
Expand All @@ -59,7 +59,7 @@ $$LTV = 100\% - \text{loan\_discount} - 100 \cdot \frac{N}{2 \cdot A}$$

:::info[V3 Only — Extra Health Buffer]

Controller V3 allows users to set [`extra_health`](#extra_health) via [`set_extra_health`](#set_extra_health) before creating a loan. This adds a health buffer when entering soft liquidation. Available in weETH, cbBTC, LBTC markets and all Llamalend markets.
Controller V3 allows users to set [`extra_health`](#extra_health) via [`set_extra_health`](#set_extra_health) before creating a loan. This adds a health buffer when entering soft liquidation. Available in weETH, cbBTC, LBTC markets and LlamaLend v1 markets.

:::

Expand Down Expand Up @@ -870,7 +870,7 @@ def deposit_range(user: address, amount: uint256, n1: int256, n2: int256):

:::info[V3 Only]

Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and all Llamalend markets.
Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and LlamaLend v1 markets.

:::

Expand Down Expand Up @@ -912,7 +912,7 @@ extra_health: public(HashMap[address, uint256])

:::info[V3 Only]

Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and all Llamalend markets.
Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and LlamaLend v1 markets.

:::

Expand Down Expand Up @@ -960,7 +960,7 @@ def set_extra_health(_value: uint256):

:::info[V3 Only]

Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and all Llamalend markets.
Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and LlamaLend v1 markets.

:::

Expand Down Expand Up @@ -1001,7 +1001,7 @@ False

:::info[V3 Only]

Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and all Llamalend markets.
Introduced in Controller V3 (Vyper 0.3.10). Available in weETH, cbBTC, LBTC markets and LlamaLend v1 markets.

:::

Expand Down
12 changes: 6 additions & 6 deletions docs/developer/crvusd/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The `FlashLender.vy` contract allows users to take out a flash loan for `crvUSD`

## Controller & AMM Versions

The crvUSD mint markets use several iterations of the Controller and AMM (LLAMMA) contracts. Each version was deployed as a new **blueprint** — existing markets are not affected when a new implementation is set. Llamalend later adopted the V3 blueprint, so all Llamalend markets share the same Controller/AMM version as the latest crvUSD markets.
The crvUSD mint markets use several iterations of the Controller and AMM (LLAMMA) contracts. Each version was deployed as a new **blueprint** — existing markets are not affected when a new implementation is set. **LlamaLend v1** adopted the V3 blueprint, so its markets share the same Controller/AMM version as the latest crvUSD markets. LlamaLend v2 uses a separate Vyper 0.4.3 modular architecture.

### Version Matrix

Expand All @@ -87,7 +87,7 @@ The crvUSD mint markets use several iterations of the Controller and AMM (LLAMMA
| **V3** | 0.3.10 | `0xe3e...415` ([Etherscan](https://etherscan.io/address/0xe3e3Fb7E9f48d26817b7210C9bD6B22744790415)) | `0x2B7...e9` ([Etherscan](https://etherscan.io/address/0x2B7e624bdb839975d56D8428d9f6A4cf1160D3e9)) | [b0240d8](https://github.com/curvefi/curve-stablecoin/tree/b0240d844c9e60fdab78b481a556a187ceee3721) |

:::info
V3 is the **current blueprint** set on the Controller Factory. It is also the version used by all [Llamalend](../lending/overview.md) markets.
V3 is the **current blueprint** set on the Controller Factory. It is also the version used by [LlamaLend v1](../lending/overview.md) markets; see [LlamaLend v2](../llamalend-v2/overview.md) for the newer lending architecture.
:::

### Market → Version Mapping
Expand All @@ -113,13 +113,13 @@ V3 is the **current blueprint** set on the Controller Factory. It is also the ve

#### V2 → V3

V3 is a significant upgrade that was developed alongside Llamalend. The same blueprint is shared by crvUSD mint markets and all Llamalend lending markets.
V3 is a significant upgrade that was developed alongside LlamaLend v1. The same blueprint is shared by crvUSD mint markets and LlamaLend v1 lending markets.

- **Compiler upgrade**: Vyper 0.3.9 → 0.3.10.
- **Delegated loan creation**: `create_loan`, `borrow_more`, `repay`, and `liquidate` accept an optional `_for` parameter, allowing approved operators to manage loans on behalf of users. See [`approve`](./controller.md#approve).
- **Extra health buffer**: Users can set [`extra_health`](./controller.md#extra_health) via [`set_extra_health`](./controller.md#set_extra_health), adding a health buffer when entering soft liquidation.
- **Extended borrow**: New [`borrow_more_extended`](./controller.md#borrow_more_extended) function supporting callback-based leverage.
- **Arbitrary-decimal tokens**: The Controller now handles tokens with any number of decimals (not just 18), with rounding adjusted in favor of existing borrowers. This was necessary for Llamalend's flexible token support.
- **`collect_fees()` disabled for lending**: In Llamalend markets, admin fees are zero and all interest goes to vault depositors.
- **Arbitrary-decimal tokens**: The Controller now handles tokens with any number of decimals (not just 18), with rounding adjusted in favor of existing borrowers. This was necessary for LlamaLend v1's flexible token support.
- **`collect_fees()` disabled for lending**: In LlamaLend v1 markets, admin fees are zero and all interest goes to vault depositors. LlamaLend v2 has separately configurable admin percentages.
- **Native ETH transfers removed**: Automatic ETH wrapping is permanently disabled for safety.
- **`check_lock` / `save_rate`**: New external helpers used by the Vault contract in Llamalend.
- **`check_lock` / `save_rate`**: New external helpers used by the Vault contract in LlamaLend v1.
15 changes: 13 additions & 2 deletions docs/developer/documentation-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Additionally, Curve has launched its own stablecoin, **crvUSD**, and **Curve Len

This documentation outlines the technical implementation of the core Curve protocol and related smart contracts. It may be useful for contributors to the Curve codebase, third-party integrators, or technically proficient users of the protocol.

:::warning[LlamaLend v1 is deprecated]

LlamaLend v1 markets are being phased out and no new v1 markets will be deployed. Use [LlamaLend v2](./llamalend-v2/overview.md) for all new markets and integrations.

:::

:::tip[Resources for Non-Technical Users]

Non-technical users might prefer the **[User Docs](/user/introduction)** site as it offers more general insights and information.
Expand Down Expand Up @@ -41,9 +47,14 @@ Over-collateralized USD stablecoin powered by a unique liquidating algorithm ([L
Savings version of crvUSD. An ERC-4626 compliant Vault that earns yield from crvUSD interest fees, with cross-chain oracle support.

</DocCard>
<DocCard title="Llamalend" link="./lending/overview" linkText="Getting started">
<DocCard title="LlamaLend v2" link="./llamalend-v2/overview" linkText="Getting started">

Permissionless isolated lending markets for any ERC-20 pair, with ERC-4626 vaults, a LendFactory, Configurator, and LLAMMA soft liquidations.

</DocCard>
<DocCard title="LlamaLend v1 (legacy)" link="./lending/overview" linkText="Legacy reference">

Permissionless lending markets to borrow or lend crvUSD against any asset with a proper oracle. Powered by Curve's unique liquidation algorithm, [LLAMMA](./crvusd/amm.md).
Historical reference for the earlier crvUSD-paired lending contracts. Use the v2 reference for new integrations.

</DocCard>
<DocCard title="Fees" link="./fees/overview" linkText="Getting started">
Expand Down
8 changes: 7 additions & 1 deletion docs/developer/lending/contracts/controller-llamma.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ import DocCard, { DocCardGrid } from '@site/src/components/DocCard'

# LLAMMA and Controller

:::warning

This page documents the LlamaLend v1 Controller V3 and AMM contracts. For LlamaLend v2, use the [LendController](../../llamalend-v2/lend-controller.md) and [AMM](../../llamalend-v2/amm.md) references.

:::

:::vyper[`AMM.vy` & `Controller.vy`]

The source code for both contracts, `AMM.vy` and `Controller.vy`, can be found on [GitHub](https://github.com/curvefi/curve-stablecoin/tree/lending/contracts). The contracts are written using [Vyper](https://github.com/vyperlang/vyper) version `0.3.10`.

:::

Llamalend uses **Controller V3** — the same blueprint that powers the latest crvUSD mint markets (weETH, cbBTC, LBTC). The Controller and AMM contracts originated in the crvUSD system and were extended for lending use. For a full version history including the evolution from crvUSD V1 through V3, see the [crvUSD Overview](../../crvusd/overview.md#controller--amm-versions).
LlamaLend v1 uses **Controller V3** — the same blueprint that powers the latest crvUSD mint markets (weETH, cbBTC, LBTC). The Controller and AMM contracts originated in the crvUSD system and were extended for lending use. For a full version history including the evolution from crvUSD V1 through V3, see the [crvUSD Overview](../../crvusd/overview.md#controller--amm-versions).

Because Curve Lending operates very similarly to the system for minting crvUSD, both `Controller.vy` and `AMM.vy` can be used for lending markets. To ensure full compatibility with both systems, **several modifications were made in V3**:

Expand Down
7 changes: 7 additions & 0 deletions docs/developer/lending/contracts/leverage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Building Leverage

:::warning

This page covers LlamaLend v1 leverage integrations. Validate v2 compatibility against the [LlamaLend v2 contracts](../../llamalend-v2/overview.md) before reusing a zap or callback flow.

:::

There are multiple ways on how to create automated leverage for lending markets:

- v1: using the [Curve Pools](../../crvusd/leverage/leverage-zap.md)
Expand Down
7 changes: 7 additions & 0 deletions docs/developer/lending/contracts/mp-overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import DocCard, { DocCardGrid } from '@site/src/components/DocCard'

# Monetary Policies: Overview

:::warning

These are LlamaLend v1 monetary-policy contracts. LlamaLend v2 markets configure a policy through the [Configurator](../../llamalend-v2/configurator.md).

:::

Lending markets use monetary policies to determine interest rates. Each market has its own policy contract.

*Currently, there are two different kinds of policy contracts in use:*
Expand Down
6 changes: 6 additions & 0 deletions docs/developer/lending/contracts/oneway-factory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# OneWay Lending Factory

:::warning

This is the LlamaLend v1 factory. For new LlamaLend v2 markets, use the [LendFactory reference](../../llamalend-v2/lend-factory.md).

:::

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Expand Down
7 changes: 7 additions & 0 deletions docs/developer/lending/contracts/oracle-overview.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import DocCard, { DocCardGrid } from '@site/src/components/DocCard'

# Lending Oracles: Overview

:::warning

These oracle contracts are documented for LlamaLend v1. For LlamaLend v2 market configuration, see the [Configurator](../../llamalend-v2/configurator.md).

:::

*There are two main contracts for lending oracles:*

<DocCardGrid>
Expand Down
6 changes: 6 additions & 0 deletions docs/developer/lending/contracts/vault.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Vault

:::warning

This page documents the LlamaLend v1 Vault. For the v2 ERC-4626 implementation, see the [LlamaLend v2 Vault reference](../../llamalend-v2/vault.md).

:::

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

Expand Down
11 changes: 9 additions & 2 deletions docs/developer/lending/overview.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Curve Lending: Overview
Curve lending allows the **creation of permissionless lending/borrowing markets to borrow crvUSD against any token, or to borrow any token against crvUSD in an isolated mode**, powered by **LLAMMA** for soft-liquidations. All markets are **isolated** from each other and do not intertwine.
# LlamaLend v1: Legacy Overview

:::warning

This section documents **LlamaLend v1** contracts, including the crvUSD-pair requirement and the Vyper 0.3.x Controller/AMM design. LlamaLend v1 markets are being phased out: **no new v1 markets will be deployed**. Any new market must use [LlamaLend v2](../llamalend-v2/overview.md).

:::

LlamaLend v1 allowed the **creation of permissionless lending/borrowing markets to borrow crvUSD against any token, or to borrow any token against crvUSD in an isolated mode**, powered by **LLAMMA** for soft-liquidations. Existing markets are **isolated** from each other and do not intertwine.

The **borrowable liquidity is provided by willing lenders**through [Vaults](./contracts/vault.md), which are [ERC4626](https://ethereum.org/en/developers/docs/standards/tokens/erc-4626/) contracts with some additional methods for convenience.

Expand Down
Loading