-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathIPoolLenderActions.sol
77 lines (67 loc) · 3.3 KB
/
IPoolLenderActions.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;
/**
* @title Pool Lender Actions
*/
interface IPoolLenderActions {
/*********************************************/
/*** Quote/collateral management functions ***/
/*********************************************/
/**
* @notice Called by lenders to add an amount of credit at a specified price bucket.
* @param amount_ The amount of quote token to be added by a lender.
* @param index_ The index of the bucket to which the quote tokens will be added.
* @param expiry_ Timestamp after which this transaction will revert, preventing inclusion in a block with unfavorable price.
* @return bucketLP_ The amount of `LP` changed for the added quote tokens.
*/
function addQuoteToken(
uint256 amount_,
uint256 index_,
uint256 expiry_
) external returns (uint256 bucketLP_);
/**
* @notice Called by lenders to move an amount of credit from a specified price bucket to another specified price bucket.
* @param maxAmount_ The maximum amount of quote token to be moved by a lender.
* @param fromIndex_ The bucket index from which the quote tokens will be removed.
* @param toIndex_ The bucket index to which the quote tokens will be added.
* @param expiry_ Timestamp after which this transaction will revert, preventing inclusion in a block with unfavorable price.
* @return fromBucketLP_ The amount of `LP` moved out from bucket.
* @return toBucketLP_ The amount of `LP` moved to destination bucket.
* @return movedAmount_ The amount of quote token moved.
*/
function moveQuoteToken(
uint256 maxAmount_,
uint256 fromIndex_,
uint256 toIndex_,
uint256 expiry_
) external returns (uint256 fromBucketLP_, uint256 toBucketLP_, uint256 movedAmount_);
/**
* @notice Called by lenders to claim collateral from a price bucket.
* @param maxAmount_ The amount of collateral (or the number of `NFT` tokens) to claim.
* @param index_ The bucket index from which collateral will be removed.
* @return removedAmount_ The amount of collateral removed.
* @return redeemedLP_ The amount of `LP` used for removing collateral amount.
*/
function removeCollateral(
uint256 maxAmount_,
uint256 index_
) external returns (uint256 removedAmount_, uint256 redeemedLP_);
/**
* @notice Called by lenders to remove an amount of credit at a specified price bucket.
* @param maxAmount_ The max amount of quote token to be removed by a lender.
* @param index_ The bucket index from which quote tokens will be removed.
* @return removedAmount_ The amount of quote token removed.
* @return redeemedLP_ The amount of `LP` used for removing quote tokens amount.
*/
function removeQuoteToken(
uint256 maxAmount_,
uint256 index_
) external returns (uint256 removedAmount_, uint256 redeemedLP_);
/********************************/
/*** Interest update function ***/
/********************************/
/**
* @notice Called by actors to update pool interest rate (can be updated only once in a `12` hours period of time).
*/
function updateInterest() external;
}