Mean Finance
Search…
Terminating a Position
When you are done with your position, you can terminate it. This action will send the caller both the unswapped and swapped balance, and then it will destroy the position.
Please take into account that this action is irreversible. Once you terminate your position, you'll need to create a new one.
1
pragma solidity 0.8.6;
2
3
import '@mean-finance/dca-v1/contracts/interfaces/IDCAPair.sol';
4
5
contract MyContract {
6
7
IDCAPair public immutable pair;
8
9
constructor(IDCAPair _pair) {
10
pair = _pair;
11
}
12
13
/// @notice Terminates the position and sends all unswapped and swapped balance to the caller
14
/// @param _dcaId The position's id
15
function terminate(uint256 _dcaId) external {
16
pair.terminate(_dcaId);
17
}
18
}
Copied!
Last modified 3mo ago
Copy link