Skip to content

Commit 2019fc9

Browse files
committed
Add comments for liquidity pools
1 parent 76c56b3 commit 2019fc9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

contracts/LiquidityPool.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
1111
import {ILiquidityPool} from "./interfaces/ILiquidityPool.sol";
1212
import {IBorrower} from "./interfaces/IBorrower.sol";
1313

14+
/// @title Liquidity pool contract holds the liquidity asset and allows solvers to borrow
15+
/// the asset from the pool and to perform an external function call upon providing the MPC signature.
16+
/// It's possible to perform borrowing with swap by the solver (the solver gets the borrowed
17+
/// assets from the pool, swaps them to fill tokens, and then the pool performs the target call).
18+
/// Repayment is done by transferring the assets to the contract without calling any function.
19+
/// Rebalancing is done by depositing and withdrawing assets from this pool by the LIQUIDITY_ADMIN_ROLE.
20+
/// Profit from borrowing is accounted for and can be withdrawn by the WITHDRAW_PROFIT_ROLE.
21+
/// Borrowing can be paused by the WITHDRAW_PROFIT_ROLE before withdrawing the profit.
22+
/// The contract is pausable by the PAUSER_ROLE.
23+
/// @author Tanya Bushenyova <[email protected]>
1424
contract LiquidityPool is ILiquidityPool, AccessControl, EIP712, Pausable {
1525
using SafeERC20 for IERC20;
1626
using ECDSA for bytes32;

contracts/LiquidityPoolAave.sol

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,16 @@ import {IAaveOracle} from "./interfaces/IAaveOracle.sol";
1010
import {IAavePoolDataProvider} from "./interfaces/IAavePoolDataProvider.sol";
1111
import {LiquidityPool} from "./LiquidityPool.sol";
1212

13+
/// @title A version of the liquidity pool contract that uses Aave pool.
14+
/// Deposits of the liquidity token are supplied to Aave as collateral.
15+
/// It's possible to borrow other tokens from Aave pool upon providing the MPC signature.
16+
/// The contract verifies that the borrowing won't put it at risk of liquidation
17+
/// by checking the custom LTV and health factor that should be configured with a safety margin.
18+
/// Repayment to Aave is done by transferring the assets to the contract and calling the repay function.
19+
/// Rebalancing is done by depositing and withdrawing assets from Aave pool by the liquidity admin role.
20+
/// Profit from borrowing and accrued interest from supplying liquidity is accounted for
21+
/// and can be withdrawn by the WITHDRAW_PROFIT_ROLE.
22+
/// @author Tanya Bushenyova <[email protected]>
1323
contract LiquidityPoolAave is LiquidityPool {
1424
using SafeERC20 for IERC20;
1525

0 commit comments

Comments
 (0)