Skip to content

Commit

Permalink
feat: usda preparation (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec authored Mar 25, 2024
1 parent ffa1c5d commit 2a94ffd
Show file tree
Hide file tree
Showing 36 changed files with 149 additions and 122 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/Docs-EUR-USD-swap.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/Docs-Transmuter-Rebalancing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/Docs-USDA-burn-redeem.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/Docs-stUSD-Yield-Sources.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/Docs-usda-User-Interactions.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,42 @@ coverY: -82

[Angle](https://app.angle.money) is a decentralized, capital efficient and over-collateralized stablecoin protocol composed of smart contracts running on open blockchains.

{% embed url="https://www.youtube.com/embed/DDoY_CUrd7M" %}

It can be used to issue stablecoins designed to maintain the value of the assets they are pegged to.

The protocol consists of several different modules, or sets of smart contracts, from which stablecoins can be issued or minted.
The protocol consists of several different modules, or facilitators, from which stablecoins can be issued or minted.
Key modules include a [Borrowing module](borrowing-module/) allowing to borrow Angle stablecoins by providing collateral and a price stability module called [Transmuter](transmuter/README.md) that facilitates the exchange of stable assets for Angle stablecoins.

Additionally, the protocol is engaged into [Direct Deposit Modules](other/amo.md), also known as Algorithmic Market Operations (AMOs), which play a crucial role in boosting the liquidity of its stablecoins across various protocols.
Additionally, the protocol is engaged into [Algorithmic Market Operations](other/amo.md) (AMOs), also known as Direct Deposit Modules, which play a crucial role in boosting the liquidity of the stablecoins across various protocols.

Angle earns a yield from all these modules, and part of it is automatically allocated [through savings products](savings/README.md) to stablecoin holders, so they can also earn a native yield on their assets.

In this document, we provide a detailed breakdown of the various components that constitute the Angle Protocol.
In this documentation, we provide a detailed breakdown of the various components that constitute the Angle Protocol.

### [Stablecoins](stablecoins.md)

Angle is so far behind one stablecoin, **EURA** (previously agEUR), pegged to the value of the Euro - €. EURA holders can stake their stablecoins for **stEUR** in order to earn a native € yield.
Angle is so far behind two independent stablecoins:

- **EURA** (previously agEUR), pegged to the value of the Euro - €. EURA holders can stake their stablecoins for **stEUR** in order to earn a native € yield.
- **USDA**: pegged to the value of the Dollar - $. USDA holders can stake their stablecoins for **stUSD** in order to earn a native $ yield.

{% hint style="info" %}
EURA used to be known as agEUR but was rebranded in March 2024.
{% endhint %}

### [Borrowing module](borrowing-module/)
While they leverage the same infrastructure and sets of smart contracts, Angle stablecoins are independent of one another with fully segregated reserves.

Angle Borrowing module is deployed on multiple EVM compatible networks beyond Ethereum (like Polygon or Optimism). It allows users to deposit collateral and borrow Angle stablecoins (debt) against their collateral. It is designed to enable getting leverage on almost any asset through an agToken loan, or to simply let people get access to stablecoins while keeping their exposure to a volatile asset or to a yield-bearing token.
![Angle stablecoins independence](./.gitbook/assets/Docs-Angle-stablecoins-independence.jpg)

### [Transmuter](transmuter/)

Transmuter is deployed on Ethereum. It works as a basket of different stablecoins that can be used to mint Angle stablecoins. Thanks to its dynamic fee model and its internal circuit breakers, the system is able to autonomously control its exposures to the assets it has in reserves and guarantee that the backing of each stablecoin is properly diversified. It is on top of that a trustless system that lets anyone and at any time (including during black swan events) redeem Angle stablecoins for a portion of the assets in the backing.

It is designed as a resilient improvement over the price stability module systems of protocols like [Maker](https://makerdao.com/en/) that showed their limits during the USDC depeg situation in March 2023.

### [Borrowing module](borrowing-module/)

Angle Borrowing module allows users to deposit collateral and borrow Angle stablecoins (debt) against their collateral. It is designed to enable getting leverage on almost any asset through a stablecoin loan, or to simply let people get access to stablecoins while keeping their exposure to a volatile asset or to a yield-bearing token.

### [Savings](savings/)

Angle Savings system is what allows Angle stablecoin holders to earn a native yield based on the returns generated by the protocol on its assets. It does not come with any extra composability risk, and there are no additional trust assumption between owning an Angle stablecoin and its staked version.
Expand All @@ -49,6 +54,10 @@ Angle Savings system is what allows Angle stablecoin holders to earn a native yi

Angle is not limited to these key components. It has notably a complex [bridge infrastructure](other/cross-chain.md) designed to facilitate the cross-chain liquidity of its stablecoins. It also natively supports [flash loans](other/flash-loans.md) for its stablecoins.

Globally, each stablecoin of the protocol combines different modules/facilitators which are all controlled by the protocol governance. [This page](./stablecoins.md) introduces in more details which modules are live for which stablecoin.

![Facilitators composability](./.gitbook/assets/Docs-Stablecoin-minters-composability.jpg)

### 🗳 Governance

Angle is a decentralized protocol governed by [a DAO](governance/angle-dao.md) encapsulating all holders of a governance token called veANGLE. Holders of the token have voting powers to propose and make changes to the underlying code of the Angle Protocol.
Expand All @@ -63,16 +72,16 @@ There is a technical doc for developers and advanced users to understand how Ang
The protocol's smart contracts have undergone several audits by Chainsecurity, Sigma Prime, and Code4rena. You can find the different audit reports [here](resources/audits/).
{% endhint %}

## 🖼 Branding

If you're writing an article, creating designs and animations about Angle, check out this [assets page](https://anglemoney.notion.site/Angle-Media-Assets-be211b3e9d7d4fb9965048825c88f66c?pvs=4) with all the visual elements about the Angle brand, including logos, icons and images.

## 📱 Side Products

Some products developed for the Angle Protocol have been released as standalone products so that anyone can take advantage of them.

This is notably the case of [🥨 Merkl](merkl/introduction.md), an incentive framework for AMMs with concentrated liquidity (like Uniswap V3) ran by Angle Labs.

## 🖼 Branding

If you're writing an article, creating designs and animations about Angle, check out this [assets page](https://anglemoney.notion.site/Angle-Media-Assets-be211b3e9d7d4fb9965048825c88f66c?pvs=4) with all the visual elements about the Angle brand, including logos, icons and images.

## ✏️ [Contributing to this doc](https://github.com/AngleProtocol/angle-docs)

This documentation portal is maintained by Angle Labs, Inc. It is built to be the up-to-date source of truth for Angle Protocol production contracts and for Angle Labs products. If there is anything unclear or out of date, please [submit a pull request](https://github.com/AngleProtocol/angle-docs) to the `angle-docs` repository.
8 changes: 4 additions & 4 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
- [🔗 Quick Links](links.md)
- [📒 Glossary](global-glossary.md)
- [🎓 Guides](guides/README.md)
- [💱 Buy EURA](guides/app-guides/agEUR/swap.md)
- [💰 Get stEUR](guides/app-guides/agEUR/stEUR.md)
- [🏦 Borrow](guides/app-guides/agEUR/borrow.md)
- [🌉 Bridge](guides/app-guides/agEUR/bridge.md)
- [💱 Buy Angle stablecoins](guides/app-guides/swap.md)
- [💰 Use Angle Savings products](guides/app-guides/savings.md)
- [🏦 Borrow](guides/app-guides/borrow.md)
- [🌉 Bridge](guides/app-guides/bridge.md)
- [💰 Buy ANGLE](guides/app-guides/ANGLE/buy.md)
- [🔒 Lock](guides/app-guides/ANGLE/lock.md)

Expand Down
4 changes: 2 additions & 2 deletions borrowing-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ It is based on a **debt mechanism**, similar to the one used by Maker with DAI.

This module can be deployed across different EVM compatible networks and work for any kind of stablecoin of the protocol.

It is also designed to work hands in hands with the other protocol's modules. agEUR, which can also be minted by the protocol's Transmuter module is for instance fully interoperable between both modules.
It is also designed to work hands in hands with the other protocol's modules. EURA, which can also be minted by the protocol's Transmuter module is for instance fully interoperable between both modules.

{% hint style="info" %}
Smart contract addresses associated to the Borrowing module on different chains and for the different stablecoins of the protocol can be found [here](https://developers.angle.money/overview/smart-contracts).
Expand All @@ -32,7 +32,7 @@ Smart contract addresses associated to the Borrowing module on different chains

**Improved position management:** Users can easily transfer their debt from one position to another without having to actually transfer collateral between these positions. All positions in this system are composable NFTs.

**Cross-chain compatibility:** The Borrowing module can scale to a wide range of different networks and stablecoins. This allows governance to easily deploy it on networks like layer 2s where transactions are more affordable than on the Ethereum mainnet. Each instance of the Borrowing module is independent and relies on different parameters chosen by governance. For instance, for a same collateral asset on two chains, there may be different amount of agEUR that can be issued on each network: this allows to make sure that liquidations remain profitable on a network based on the available liquidity.
**Cross-chain compatibility:** The Borrowing module can scale to a wide range of different networks and stablecoins. This allows governance to easily deploy it on networks like layer 2s where transactions are more affordable than on the Ethereum mainnet. Each instance of the Borrowing module is independent and relies on different parameters chosen by governance. For instance, for a same collateral asset on two chains, there may be different amount of EURA that can be issued on each network: this allows to make sure that liquidations remain profitable on a network based on the available liquidity.

{% hint style="info" %}
[This section](vaults/) presents in greater details vaults in Angle Borrowing Module.
Expand Down
6 changes: 3 additions & 3 deletions borrowing-module/vaults/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Support for yield-bearing tokens as collateral thus makes Angle Borrowing module

### Composable actions

With an opened vault, there are many different actions that can be performed beyond borrowing stablecoins: adding collateral, removing collateral from it, repaying the agToken debt. All these actions can be combined with one another in a single transaction, which notably allows for capital efficient interactions with Angle vaults.
With an opened vault, there are many different actions that can be performed beyond borrowing stablecoins: adding collateral, removing collateral from it, repaying the stablecoin debt. All these actions can be combined with one another in a single transaction, which notably allows for capital efficient interactions with Angle vaults.

{% hint style="info" %}
For more details on how to combine transactions in a modular way with the protocol, you can check [this page](https://developers.angle.money/borrowing-module-contracts/smart-contract-docs/vaultmanager) of our developers documentation.
Expand Down Expand Up @@ -98,15 +98,15 @@ The higher the collateral ratio, the "safer" the vault, as the price decline of

Additionally, each vault type has its own **collateral factor** (CF) parameter. It dictates the minimum collateral ratio allowed for vaults of this type. If this ratio drops below this quantity defined by the CF (1/CF more precisely), the vault risks being liquidated.

For example, if the CF of a vault type is at 2/3, or 150% of min collateral ratio, users need to deposit at least x1.5 more than what they want to borrow. In practice, this means that users wanting to borrow 1,000 agEUR need to deposit at least 1,500€ of ETH for example. If the value of their ETH deposit drops, pushing their CR below 150%, they are in risk of getting liquidated.
For example, if the CF of a vault type is at 2/3, or 150% of min collateral ratio, users need to deposit at least x1.5 more than what they want to borrow. In practice, this means that users wanting to borrow 1,000 EURA need to deposit at least 1,500€ of ETH for example. If the value of their ETH deposit drops, pushing their CR below 150%, they are in risk of getting liquidated.

### Isolated positions & debt transfer

#### Various Collateral Types

There is one different smart contract per collateral type in Angle Borrowing module: these contracts are called `VaultManager` contracts. There could be for the same collateral asset different `VaultManager` contracts, corresponding to different parameters.

For instance, we could imagine for the same agToken ETH as a collateral with a minimum collateral ratio of 150% and a 1% interest rate on borrows and ETH with a minimum collateral ratio of 120% and an interest rate of 3%.
For instance, we could imagine for the same stablecoin ETH as a collateral with a minimum collateral ratio of 150% and a 1% interest rate on borrows and ETH with a minimum collateral ratio of 120% and an interest rate of 3%.

#### Isolated positions & NFTs

Expand Down
4 changes: 2 additions & 2 deletions borrowing-module/vaults/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ It's important to keep in mind that this fee can be changed by governance, and c

### Repay Fee

Similarly than at mint, the protocol can charge a fee to users repaying their debt towards the protocol. In practice, this means that, for agEUR, a user repaying 110 agEUR of debt would have to bring 111.1 agEUR if there is a 1% repaying fee.
Similarly than at mint, the protocol can charge a fee to users repaying their debt towards the protocol. In practice, this means that, for EURA, a user repaying 110 EURA of debt would have to bring 111.1 EURA if there is a 1% repaying fee.

As for the mint fee, the repay fee is most often set to 0, and you should check the [analytics](https://analytics.angle.money) to check whether there has been updates.

Expand All @@ -80,7 +80,7 @@ This debt increase through fees may happen at four (optional) moments:

1. When minting stablecoins if there is a **mint fee**
2. During the life of the vault if stablecoins are borrowed, through the **stability fee**
3. When repaying an agToken debt if there is a **repay fee**
3. When repaying a stablecoin debt if there is a **repay fee**
4. When a liquidation happens, through the **liquidation surcharge**

## Bad debt
Expand Down
2 changes: 1 addition & 1 deletion borrowing-module/vaults/liquidations.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Liquidations in this Borrowing module are designed to be the most borrower frien

### Health Factor

Each vault has its own collateral ratio (`CR`). Together with the collateral factor (`CF`), they are used to compute the health factor of an open vault. For example, for a vault with 160€ worth of collateral and 100 agEUR borrowed, if the collateral factor is 2/3:
Each vault has its own collateral ratio (`CR`). Together with the collateral factor (`CF`), they are used to compute the health factor of an open vault. For example, for a vault with 160€ worth of collateral and 100 EURA borrowed, if the collateral factor is 2/3:

$$
\texttt{HF = CR * CF} \\ \texttt{HF} = 160/100 * 2/3 = 1.07
Expand Down
Loading

0 comments on commit 2a94ffd

Please sign in to comment.