ArrakisMetaVault

Git Source

Inherits: IArrakisMetaVault, ReentrancyGuard, Initializable

State Variables

moduleRegistry

address public immutable moduleRegistry;

token0

address public immutable token0;

token1

address public immutable token1;

manager

address public immutable manager;

module

IArrakisLPModule public module;

_whitelistedModules

EnumerableSet.AddressSet internal _whitelistedModules;

Functions

onlyOwnerCustom

modifier onlyOwnerCustom();

onlyManager

modifier onlyManager();

constructor

constructor(
    address moduleRegistry_,
    address manager_,
    address token0_,
    address token1_
);

initialize

function initialize(address module_) external initializer;

setModule

function used to set module

function setModule(
    address module_,
    bytes[] calldata payloads_
) external onlyManager nonReentrant;

Parameters

NameTypeDescription
module_addressaddress of the new module
payloads_bytes[]datas to initialize/rebalance on the new module

whitelistModules

function used to whitelist modules that can used by manager.

we transfer here all tokens to the new module.

function whitelistModules(
    address[] calldata beacons_,
    bytes[] calldata data_
) external onlyOwnerCustom;

Parameters

NameTypeDescription
beacons_address[]array of beacons addresses to use for modules creation.
data_bytes[]array of payload to use for modules creation.

blacklistModules

function used to blacklist modules that can used by manager.

function blacklistModules(address[] calldata modules_)
    external
    onlyOwnerCustom;

Parameters

NameTypeDescription
modules_address[]array of module addresses to be blacklisted.

whitelistedModules

function used to get the list of modules whitelisted.

function whitelistedModules()
    external
    view
    returns (address[] memory modules);

Returns

NameTypeDescription
modulesaddress[]whitelisted modules addresses.

getInits

function used to get the initial amounts needed to open a position.

function getInits()
    external
    view
    returns (uint256 init0, uint256 init1);

Returns

NameTypeDescription
init0uint256the amount of token0 needed to open a position.
init1uint256the amount of token1 needed to open a position.

totalUnderlying

function used to get the amount of token0 and token1 sitting on the position.

function totalUnderlying()
    public
    view
    returns (uint256 amount0, uint256 amount1);

Returns

NameTypeDescription
amount0uint256the amount of token0 sitting on the position.
amount1uint256the amount of token1 sitting on the position.

totalUnderlyingAtPrice

function used to get the amounts of token0 and token1 sitting on the position for a specific price.

function totalUnderlyingAtPrice(uint160 priceX96_)
    external
    view
    returns (uint256 amount0, uint256 amount1);

Parameters

NameTypeDescription
priceX96_uint160price at which we want to simulate our tokens composition

Returns

NameTypeDescription
amount0uint256the amount of token0 sitting on the position for priceX96.
amount1uint256the amount of token1 sitting on the position for priceX96.

_withdraw

function _withdraw(
    address receiver_,
    uint256 proportion_
) internal returns (uint256 amount0, uint256 amount1);

_withdrawManagerBalance

function _withdrawManagerBalance(IArrakisLPModule module_)
    internal
    returns (uint256 amount0, uint256 amount1);

_call

function _call(address module_, bytes memory data_) internal;

_onlyOwnerCheck

function _onlyOwnerCheck() internal view virtual;