BunkerModule

Git Source

Inherits: IArrakisLPModule, IArrakisLPModuleID, IBunkerModule, PausableUpgradeable, ReentrancyGuardUpgradeable

State Variables

id

bytes32 public constant id =
    0xce98d8396fff0b5125f78c5c5878c5c82596417dec23d9d52e0ed2377d14b9b8;

metaVault

IArrakisMetaVault public metaVault;

token0

IERC20Metadata public token0;

token1

IERC20Metadata public token1;

_guardian

address internal immutable _guardian;

Functions

onlyMetaVault

modifier onlyMetaVault();

onlyGuardian

modifier onlyGuardian();

constructor

constructor(address guardian_);

initialize

initialize function to delegate call onced the beacon proxy is deployed, for initializing the bunker module.

function initialize(address metaVault_) external initializer;

Parameters

NameTypeDescription
metaVault_addressaddress of the meta vault.

pause

function used to pause the module.

only callable by guardian

function pause() external onlyGuardian;

unpause

function used to unpause the module.

only callable by guardian

function unpause() external onlyGuardian;

initializePosition

function initializePosition(bytes calldata) external;

withdraw

function used by metaVault to withdraw tokens from the strategy.

function withdraw(
    address receiver_,
    uint256 proportion_
)
    public
    virtual
    onlyMetaVault
    nonReentrant
    returns (uint256 amount0, uint256 amount1);

Parameters

NameTypeDescription
receiver_addressaddress that will receive tokens.
proportion_uint256the proportion of the total position that need to be withdrawn.

Returns

NameTypeDescription
amount0uint256amount of token0 withdrawn.
amount1uint256amount of token1 withdrawn.

withdrawManagerBalance

function used by metaVault or manager to get manager fees.

function withdrawManagerBalance()
    external
    returns (uint256 amount0, uint256 amount1);

Returns

NameTypeDescription
amount0uint256amount of token0 sent to manager.
amount1uint256amount of token1 sent to manager.

setManagerFeePIPS

function used to set manager fees.

function setManagerFeePIPS(uint256) external;

managerBalance0

function used to get manager token0 balance.

amount of fees in token0 that manager have not taken yet.

function managerBalance0() external view returns (uint256 fees0);

Returns

NameTypeDescription
fees0uint256amount of token0 that manager earned.

managerBalance1

function used to get manager token1 balance.

amount of fees in token1 that manager have not taken yet.

function managerBalance1() external view returns (uint256 fees1);

Returns

NameTypeDescription
fees1uint256amount of token1 that manager earned.

validateRebalance

function used to validate if module state is not manipulated before rebalance.

function validateRebalance(IOracleWrapper, uint24) external view;

totalUnderlyingAtPrice

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

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

Returns

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

totalUnderlying

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

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

Returns

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

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.

managerFeePIPS

function used to get manager fees.

function managerFeePIPS() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256managerFeePIPS amount of token1 that manager earned.

guardian

function used to get the address that can pause the module.

function guardian() external view returns (address);

Returns

NameTypeDescription
<none>addressguardian address of the pauser.