Skip to content

Commit

Permalink
πŸ“œ Add documentation to MinimumDepositController (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
truefibot committed Feb 9, 2023
1 parent 46f1499 commit 00cfb14
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
# 🦐 Minimum deposit controller

## Overview
The minimum-deposit controller is built based on the default deposit controller from carbon-contracts and it is designed to give the portfolio manager the ability to set the minimum value that lenders can deposit.

Minimum deposit value is first initialized by the manager in the `initialize` function and can be changed by calling `setMinimumDeposit` or `configure` function.

## Affected Methods
```solidity
function onDeposit(
address,
uint256 assets,
address
) external view returns (uint256, uint256)
```
Called by TrancheVault in the `deposit` function. Checks if deposit is greater or equal to minimum deposit value and returns number of shares that lender should get and deposit fee that lender should pay.

```solidity
function onMint(
address,
uint256 shares,
address
) external view returns (uint256, uint256)
```
Called by TrancheVault in the `mint` function. Checks if amount of shares converted to assets is greater or equal to minimum deposit value and returns number of assets that should be transferred and deposit fee that lender should pay.

```solidity
function setMinimumDeposit(uint256 newMinimumDeposit) public
```
Sets minimum deposit value and emits event with changed value.

```solidity
function configure(
uint256 newCeiling,
uint256 newFeeRate,
uint256 newMinimumDeposit,
ILenderVerifier newLenderVerifier,
DepositAllowed memory newDepositAllowed
) external
```
Allows the manager to change multiple parameters in the deposit controller (ceiling, fee rate, minimum deposit, lender verifier and allowance for deposit).

0 comments on commit 00cfb14

Please sign in to comment.