0xNODES
Search…
IAMMIntegration
Standard interface for an AMM yield integration contract compatible with the Kernel.
An AMMIntegration support the configuration of multiple pools at the system integration level.
An integration implementing IAMMIntegration MUST NOT use poolID 0. The system recognizes an integration as an IAMMIntegration when the poolID > 0.
1
// SPDX-License-Identifier: GPL-2.0
2
pragma solidity 0.8.4;
3
4
interface IAMMIntegration {
5
struct Pool {
6
address tokenA;
7
address tokenB;
8
uint256 positionID; // Used for Uniswap V3
9
}
10
11
/// Events
12
event CreatePool(address indexed tokenA, address indexed tokenB, uint32 poolID);
13
event YieldHarvested(uint32 poolID);
14
event Deposit(address token, uint256 amount, uint32 poolID);
15
event HarvestYieldError(uint32 indexed poolID);
16
17
event TransferBetweenPools(uint32 source, uint32 destination, uint256[] amounts, address[] tokens);
18
19
/// @dev IMPORTANT: poolID must start at 1 for all amm integrations. A poolID of 0 is used to designate a non amm integration.
20
21
/// @param token The address of the deposited token
22
/// @param amount The amount of token being deposited
23
/// @param poolID The id of the pool to deposit into
24
function deposit(
25
address token,
26
uint256 amount,
27
uint32 poolID
28
) external;
29
30
/// @param token the token to withdraw
31
/// @param amount The amount of token in the pool to withdraw
32
/// @param poolID the pool to withdraw from
33
function withdraw(
34
address token,
35
uint256 amount,
36
uint32 poolID
37
) external;
38
39
/// @dev Deploys all the tokens for the specified pools
40
function deploy(uint32 poolID) external;
41
42
/// @dev Harvests token yield from the integration
43
function harvestYield() external;
44
}
45
Copied!
Copy link