-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #483 from centrifuge/develop
Merge fixes + new content to main
- Loading branch information
Showing
43 changed files
with
248 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
id: guides | ||
order: 2 | ||
title: Guides | ||
contributors: <NunoAlexandre:[email protected]> | ||
--- | ||
|
||
# Investing into a Liquidity Pool | ||
|
||
This guide will teach you how to find the correct liquidity pool instance to invest in, how to invest and get the respective tranche tokens in return, and how the whole system flows behind the scenes. | ||
|
||
## Deployed Contracts | ||
|
||
Pick the contracts deployed on the network you want to invest from. | ||
You will need them on the `Step 2.` below. | ||
|
||
- **Ethereum** | ||
- `PoolManager` - `0x78E9e622A57f70F1E0Ec652A4931E4e278e58142` | ||
- `Circle USDC` - `0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48` | ||
|
||
## Steps | ||
|
||
1. ERC20 Approval | ||
|
||
The user should call the ERC20 approval on the investment currency (e.g. USDC on Ethereum) to allow the Liquidity Pools contract to manage those funds for them. | ||
|
||
2. Pick the correct `LiquidityPool` instance | ||
|
||
With the appropriate `PoolManager` contract instance, call the following: | ||
|
||
**`PoolManager.getLiquidityPool(poolId, trancheId, currency)`** | ||
|
||
**NOTES**: | ||
|
||
- The `currency` param should be the `USDC` token address in the respective network. | ||
- The `LiquidityPool` offers an interface based on [EIP-7540](https://eips.ethereum.org/EIPS/eip-7540), an extension of [EIP-4626](https://eips.ethereum.org/EIPS/eip-4626) | ||
|
||
3. Invest into a LiquidityPool | ||
|
||
Now that you have the LiquidityPool instance at hand, you can invest into it by calling: | ||
|
||
**`LiquidityPool.requestDeposit(uint256 amount, address receiver)`** | ||
|
||
Once submitted, the `amount` is locked on the escrow contract. | ||
|
||
Then, the pool issuer needs to fulfill this request. | ||
|
||
Once that's done, yield starts to accrue immediately, and the user can claim their tranche tokens. | ||
|
||
4. Claim the tranche tokens | ||
|
||
Once the request from step 3 is fulfilled, the user can claim their tranche tokens equivalent to `y` by calling: | ||
|
||
**`LiquidityPool.mint(uint256 y, address receiver)`** | ||
|
||
**NOTE**: `y` needs to be ≤ `maxDeposit`. The user can find that amount by calling **`LiquidityPool.maxDeposit`**. | ||
|
||
## Overview | ||
|
||
Behind the scenes, this is what takes place on steps 2 and 3: | ||
|
||
![Liquidity Pools - Investment Flow](./images/lp-investment-flow.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ contributors: <Dennis Wellmann:[email protected]> | |
|
||
## Introduction | ||
|
||
User-mintable NFTs are a critical part of the Centrifuge ecosystem. Minting an NFT from a Centrifuge [Document](https://developer.centrifuge.io/docs/overview/protocol-architecture/) allows a user to [draw loans](https://centrifuge.io/technology/tinlake/) against the NFT asset, or simply provides a way to easily transact in privacy-preserving way with a document asset. This flow can be seen in the image below: | ||
User-mintable NFTs are a critical part of the Centrifuge ecosystem. Minting an NFT from a Centrifuge [Document](https://docs.centrifuge.io/build/p2p-node/#documents-within-the-protocol) allows a user to [draw loans](https://docs.centrifuge.io/getting-started/securitization/#on-chain-securitization) against the NFT asset, or simply provides a way to easily transact in privacy-preserving way with a document asset. This flow can be seen in the image below: | ||
|
||
![Centrifuge architecture](./images/mint-flow.jpeg) | ||
|
||
|
@@ -39,7 +39,7 @@ proofs = new bytes32[][](5); | |
... | ||
``` | ||
|
||
The verification method can be found in our optimised [Merkle Verifier](https://github.com/centrifuge/privacy-enabled-erc721/blob/develop/src/merkle.sol) contract. | ||
The verification method can be found in our optimised [Merkle Verifier](https://github.com/centrifuge/privacy-enabled-erc721) contract. | ||
|
||
An example of an NFT with one proof which can be minted using methods from the precise-proofs library is as follows: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.