This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
IICHIVault.sol
112 lines (76 loc) · 2.93 KB
/
IICHIVault.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
interface IICHIVault is IERC20, IERC20Metadata {
function ichiVaultFactory() external view returns (address);
function pool() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function allowToken0() external view returns (bool);
function allowToken1() external view returns (bool);
function fee() external view returns (uint24);
function tickSpacing() external view returns (int24);
function currentTick() external view returns (int24);
function twapPeriod() external view returns (uint32);
function affiliate() external view returns (address);
function baseLower() external view returns (int24);
function baseUpper() external view returns (int24);
function limitLower() external view returns (int24);
function limitUpper() external view returns (int24);
function deposit0Max() external view returns (uint256);
function deposit1Max() external view returns (uint256);
function maxTotalSupply() external view returns (uint256);
function hysteresis() external view returns (uint256);
function getTotalAmounts() external view returns (uint256, uint256);
function deposit(uint256, uint256, address) external returns (uint256);
function withdraw(uint256, address) external returns (uint256, uint256);
function rebalance(
int24 _baseLower,
int24 _baseUpper,
int24 _limitLower,
int24 _limitUpper,
int256 swapQuantity
) external;
function setDepositMax(uint256 _deposit0Max, uint256 _deposit1Max) external;
function setAffiliate(address _affiliate) external;
event DeployICHIVault(
address indexed sender,
address indexed pool,
bool allowToken0,
bool allowToken1,
address owner,
uint256 twapPeriod
);
event SetTwapPeriod(address sender, uint32 newTwapPeriod);
event Deposit(
address indexed sender,
address indexed to,
uint256 shares,
uint256 amount0,
uint256 amount1
);
event Withdraw(
address indexed sender,
address indexed to,
uint256 shares,
uint256 amount0,
uint256 amount1
);
event Rebalance(
int24 tick,
uint256 totalAmount0,
uint256 totalAmount1,
uint256 feeAmount0,
uint256 feeAmount1,
uint256 totalSupply
);
event MaxTotalSupply(address indexed sender, uint256 maxTotalSupply);
event Hysteresis(address indexed sender, uint256 hysteresis);
event DepositMax(
address indexed sender,
uint256 deposit0Max,
uint256 deposit1Max
);
event Affiliate(address indexed sender, address affiliate);
}