Skip to content

Commit

Permalink
GITBOOK-52: chore/incorporate-MU04-changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Raetsch authored and gitbook-bot committed Dec 19, 2023
1 parent 60ebe02 commit a25cad5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 31 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.
38 changes: 13 additions & 25 deletions developers/deployments/addresses.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion developers/smart-contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ The contracts can be found in the [mento-protocol/mento-core](https://github.com

Here you will find everything from an overview to a detailed technical reference. 

<figure><img src="../../.gitbook/assets/image (11).png" alt=""><figcaption><p>Mento Smart Contracts</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/Screenshot 2023-12-12 at 14.37.20.png" alt=""><figcaption><p>Mento Smart Contracts</p></figcaption></figure>

2 changes: 1 addition & 1 deletion protocol-concepts/asset-exchanges/bipoolmanager.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Exchange provider with two-asset virtual automated market maker poo

# BiPoolManager

The **BiPoolManager** is an [exchange provider ](exchange-providers.md)that generalizes the [vAMM](bipoolmanager.md#vamm) implementation in Mento v1's Exchanges. It manages asset pools containing a pair of Mento assets, which can be either stable-to-collateral or stable-to-stable. A pool can be configured to use either a constant sum or a constant product pricing function via [pricing modules.](bipoolmanager.md#pricing-modules)
The **BiPoolManager** is an [exchange provider ](exchange-providers.md)that generalizes the [vAMM](bipoolmanager.md#vamm) implementation previously used in Mento v1's Exchanges. It manages asset pools containing a pair of Mento assets, which can be either stable-to-collateral or stable-to-stable. A pool can be configured to use either a constant sum or a constant product pricing function via [pricing modules.](bipoolmanager.md#pricing-modules)

### vAMM

Expand Down
2 changes: 1 addition & 1 deletion protocol-concepts/asset-exchanges/trading-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Mento stability mechanism relies on the ability to contract and expand the supply of Mento stable assets by allowing everyone to exchange stable assets with the Reserve against collateral assets and the other way around. The rate of expansion and contraction (i.e. _volume that can be traded in a unit of time_) is highly dependent on the **volatility** and the **liquidity** of the collateral in the pair. For example, when trading cUSD for Celo with the Reserve, the amount that we can trade between two vAMM bucket updates has to be significantly lower than the amount we are able to trade when trading cUSD against USDC. This is done in order to protect against oracle manipulation risk, which is greatly reduced when trading cUSD against USDC.

In Mento V1 the vAMM bucket sizes have two distinct uses: (1) they enable price finding between oracle updates and (2) they act as an effective trading limit by introducing slippage. This works quite well but it makes it hard to fine-tune the slippage function. Introducing trading limits, allows us to use the bucket sizes only for price finding. This means we can increase the bucket sizes, thus reducing the average slippage between two oracle updates, while still limiting the amount that can be traded between two bucket updates.
In Mento V1 the vAMM bucket sizes had two distinct uses: (1) they enabled price finding between oracle updates and (2) they acted as an effective trading limit by introducing slippage. This worked quite well but made it hard to fine-tune the slippage function. Introducing trading limits, allows us to use the bucket sizes only for price finding. This means we can increase the bucket sizes, thus reducing the average slippage between two oracle updates, while still limiting the amount that can be traded between two bucket updates.

In a broader sense, we can also apply the trading limits to safeguard the protocol by enforcing daily or global limits. Governance can configure trading limits on a specific combination of token and exchange – for example, a limit can be set on the amount of cUSD that flows in the cUSD/CELO exchange, while another limit can be set on the amount of cUSD that flows through the cUSD/USDC exchange. Each token and exchange combination can have two **time-based limits** (**L0** and **L1**) and one **global limit** (**LG**).&#x20;

Expand Down
4 changes: 2 additions & 2 deletions protocol-concepts/governance/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Rate Feed identifiers are the [report targets for oracles](../../developers/smar
2. Setting the [reference rate for exchanges. ](../../developers/smart-contracts/bipoolmanager.md#poolexchange)
3. Configuring circuit breakers in the [breaker box](../../developers/smart-contracts/breakerbox.md).

<table><thead><tr><th width="143.33333333333331">RateFeed</th><th width="295">ID</th><th>Explanation</th></tr></thead><tbody><tr><td>CELO/USD</td><td>0x765DE816845861e75A25fCA122bb6898B8B1282a</td><td>The <a href="https://explorer.celo.org/mainnet/address/0x765DE816845861e75A25fCA122bb6898B8B1282a">cUSD contract address</a></td></tr><tr><td>CELO/EUR</td><td>0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73</td><td>The <a href="https://explorer.celo.org/mainnet/address/0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73">cEUR contract address</a></td></tr><tr><td>CELO/BRL</td><td>0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787</td><td>The <a href="https://explorer.celo.org/mainnet/address/0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787">cREAL contract address</a></td></tr><tr><td>USDC/USD</td><td>0xA1A8003936862E7a15092A91898D69fa8bCE290c</td><td><code>address(uint160(uint256(keccak256("USDCUSD"))))</code></td></tr><tr><td>USDC/EUR</td><td>0x206B25Ea01E188Ee243131aFdE526bA6E131a016</td><td><code>address(uint160(uint256(keccak256("USDCEUR"))))</code></td></tr><tr><td>USDC/BRL</td><td>0x25F21A1f97607Edf6852339fad709728cffb9a9d</td><td><code>address(uint160(uint256(keccak256("USDCBRL"))))</code></td></tr><tr><td>EUROC/EUR</td><td>0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B</td><td><code>address(uint160(uint256(keccak256("EUROCEUR"))))</code></td></tr></tbody></table>
<table><thead><tr><th width="143.33333333333331">RateFeed</th><th width="295">ID</th><th>Explanation</th></tr></thead><tbody><tr><td>CELO/USD</td><td>0x765DE816845861e75A25fCA122bb6898B8B1282a</td><td>The <a href="https://explorer.celo.org/mainnet/address/0x765DE816845861e75A25fCA122bb6898B8B1282a">cUSD contract address</a></td></tr><tr><td>CELO/EUR</td><td>0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73</td><td>The <a href="https://explorer.celo.org/mainnet/address/0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73">cEUR contract address</a></td></tr><tr><td>CELO/BRL</td><td>0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787</td><td>The <a href="https://explorer.celo.org/mainnet/address/0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787">cREAL contract address</a></td></tr><tr><td>CELO/XOF</td><td>0x73F93dcc49cB8A239e2032663e9475dd5ef29A08</td><td>The <a href="https://explorer.celo.org/mainnet/address/0x73F93dcc49cB8A239e2032663e9475dd5ef29A08">eXOF contract address </a></td></tr><tr><td>USDC/USD</td><td>0xA1A8003936862E7a15092A91898D69fa8bCE290c</td><td><code>address(uint160(uint256(keccak256("USDCUSD"))))</code></td></tr><tr><td>USDC/EUR</td><td>0x206B25Ea01E188Ee243131aFdE526bA6E131a016</td><td><code>address(uint160(uint256(keccak256("USDCEUR"))))</code></td></tr><tr><td>USDC/BRL</td><td>0x25F21A1f97607Edf6852339fad709728cffb9a9d</td><td><code>address(uint160(uint256(keccak256("USDCBRL"))))</code></td></tr><tr><td>EUROC/EUR</td><td>0x26076B9702885d475ac8c3dB3Bd9F250Dc5A318B</td><td><code>address(uint160(uint256(keccak256("EUROCEUR"))))</code></td></tr><tr><td>EUROC/XOF</td><td>0xed35e46b095197da30ddffa5b91d386886d5ce0d</td><td><code>address(uint160(uint256(keccak256("EUROCXOF"))))</code></td></tr><tr><td>EUR/XOF</td><td>0x40dc8528167557353fdcd98548ab2139a670dd0b</td><td><code>address(uint160(uint256(keccak256("EURXOF"))))</code></td></tr></tbody></table>

### Exchange IDs

Expand All @@ -28,4 +28,4 @@ exchangeId = keccak256(
);
```

<table><thead><tr><th width="176.33333333333331">Exchange</th><th>ID</th><th>Explanation</th></tr></thead><tbody><tr><td>cUSD/CELO</td><td>0x3135b662c38265d0655177091f1b647b4fef511103d06c016efdf18b46930d2c</td><td><code>keccak256(abi.encodePacked("cUSD", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cEUR/CELO</td><td>0xb73ffc6b5123de3c8e460490543ab93a3be7d70824f1666343df49e219199b8c</td><td><code>keccak256(abi.encodePacked("cEUR", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cREAL/CELO</td><td>0xed0528e42b9ecae538aab34b93813e08de03f8ac4a894b277ef193e67275bbae</td><td><code>keccak256(abi.encodePacked("cREAL", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cUSD/USDC</td><td>0x0d739efbfc30f303e8d1976c213b4040850d1af40f174f4169b846f6fd3d2f20</td><td><code>keccak256(abi.encodePacked("cUSD", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cEUR/USDC</td><td>0xf418803158d881fda22694067bf6479476cec22ecfeeca2f6a65a6259bdbb9c0</td><td><code>keccak256(abi.encodePacked("cEUR", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cREAL/USDC</td><td>0x40c8472edd23f2976b0503db2692e8f06f0eb52db690e84697cad36a6b44e2df</td><td><code>keccak256(abi.encodePacked("cREAL", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cEUR/EUROC</td><td>0xfca6d94b46122eb9a4b86cf9d3e1e856fea8a826d0fc26c5baf17c43fbaf0f48</td><td><code>keccak256(abi.encodePacked("cEUR", "axlEUROC", "ConstantSum"))</code></td></tr></tbody></table>
<table><thead><tr><th width="176.33333333333331">Exchange</th><th>ID</th><th>Explanation</th></tr></thead><tbody><tr><td>cUSD/CELO</td><td>0x3135b662c38265d0655177091f1b647b4fef511103d06c016efdf18b46930d2c</td><td><code>keccak256(abi.encodePacked("cUSD", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cEUR/CELO</td><td>0xb73ffc6b5123de3c8e460490543ab93a3be7d70824f1666343df49e219199b8c</td><td><code>keccak256(abi.encodePacked("cEUR", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cREAL/CELO</td><td>0xed0528e42b9ecae538aab34b93813e08de03f8ac4a894b277ef193e67275bbae</td><td><code>keccak256(abi.encodePacked("cREAL", "CELO", "ConstantProduct"))</code></td></tr><tr><td>eXOF/CELO</td><td>0x269dcbdbc07fff1a4aaab9c7c03b3f629cd9bbed49aa0efebab874e4da1ffd07</td><td><code>keccak256(abi.encodePacked("eXOF", "CELO", "ConstantProduct"))</code></td></tr><tr><td>cUSD/USDC</td><td>0x0d739efbfc30f303e8d1976c213b4040850d1af40f174f4169b846f6fd3d2f20</td><td><code>keccak256(abi.encodePacked("cUSD", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cEUR/USDC</td><td>0xf418803158d881fda22694067bf6479476cec22ecfeeca2f6a65a6259bdbb9c0</td><td><code>keccak256(abi.encodePacked("cEUR", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cREAL/USDC</td><td>0x40c8472edd23f2976b0503db2692e8f06f0eb52db690e84697cad36a6b44e2df</td><td><code>keccak256(abi.encodePacked("cREAL", "axlUSDC", "ConstantSum"))</code></td></tr><tr><td>cEUR/EUROC</td><td>0xfca6d94b46122eb9a4b86cf9d3e1e856fea8a826d0fc26c5baf17c43fbaf0f48</td><td><code>keccak256(abi.encodePacked("cEUR", "axlEUROC", "ConstantSum"))</code></td></tr><tr><td>eXOF/EUROC</td><td>0xcc68743c58a31c4ec3c56bca3d579409b4e2424e5f37e54a85f917b22af74e7c</td><td><code>keccak256(abi.encodePacked("eXOF", "axlEUROC", "ConstantSum"))</code></td></tr></tbody></table>
4 changes: 3 additions & 1 deletion protocol-concepts/oracles.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Oracles usually consist of an off-chain client and one or multiple on-chain smar

Oracles on Celo for Mento are an essential part of the stability mechanism. The protocol uses the reported rates to allow the exchange of Mento collateral with stable assets at correct market prices. For this, the oracles report one exchange rate, internally also referenced as rate feed, for each exchange pair.&#x20;

<figure><img src="../.gitbook/assets/image (2).png" alt=""><figcaption><p>How the protocol uses oracles</p></figcaption></figure>


<figure><img src="../.gitbook/assets/Screenshot 2023-12-12 at 14.03.17.png" alt=""><figcaption><p>How the protocol uses oracles</p></figcaption></figure>

0 comments on commit a25cad5

Please sign in to comment.