forked from WTFAcademy/WTF-Dapp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IPoolManager.sol
51 lines (43 loc) · 1.32 KB
/
IPoolManager.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
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.24;
pragma abicoder v2;
interface IPoolManager {
struct PoolKey {
address token0;
address token1;
uint32 index;
}
function getPools() external view returns (PoolKey[] memory pools);
function getTokens() external view returns (address[] memory tokens);
function getTokenPools(
address token
) external view returns (PoolKey[] memory pools);
struct PoolInfo {
// the current protocol fee as a percentage of the swap fee taken on withdrawal
// represented as an integer denominator (1/x)%
uint8 feeProtocol;
// tick range
int24 tickLower;
int24 tickUpper;
// the current tick
int24 tick;
// the current price
uint160 sqrtPriceX96;
}
function getPoolInfo(
address token0,
address token1,
uint32 index
) external view returns (PoolInfo memory poolInfo);
struct CreateAndInitializeParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint160 sqrtPriceX96;
}
function createAndInitializePoolIfNecessary(
CreateAndInitializeParams calldata params
) external payable returns (address pool, uint32 index);
}