Skip to content
LogoLogo

IMakinaXModule

Git Source

Inherits: IMakinaXContext, IMakinaXGovernable, IOracleRegistry, IWeirollComponent, ISwapComponent, IBridgeComponent

Functions

initialize

Initializes the module with the given parameters.

function initialize(MakinaXModuleInitParams calldata params, MakinaXModuleServiceParams calldata serviceParams)
        external;

Parameters

NameTypeDescription
paramsMakinaXModuleInitParamsThe strategy and risk initialization parameters.
serviceParamsMakinaXModuleServiceParamsThe protocol-controlled service initialization parameters.

sweepERC20

Sweeps the entire balance of a given ERC20 token to the Safe.

function sweepERC20(address token) external;

Parameters

NameTypeDescription
tokenaddressThe address of the ERC20 token to sweep.

sweepERC721

Sweeps a given ERC721 token to the Safe.

function sweepERC721(address token, uint256 tokenId) external;

Parameters

NameTypeDescription
tokenaddressThe address of the ERC721 collection to sweep from.
tokenIduint256The id of the ERC721 token to sweep.

sweepERC6909

Sweeps the entire balance of a given ERC6909 token of type id to the Safe.

function sweepERC6909(address token, uint256 id) external;

Parameters

NameTypeDescription
tokenaddressThe address of the ERC6909 token contract.
iduint256The type of the ERC6909 token to sweep.

sweepNative

Sweeps the entire native currency balance (e.g. ETH) to the Safe.

function sweepNative() external;

Structs

MakinaXModuleInitParams

Strategy and risk initialization parameters.

struct MakinaXModuleInitParams {
        address safe;
        IMakinaXGovernable.OperatingMode initialOperatingMode;
        bytes32 initialAllowedInstrRoot;
        uint256 initialMaxPositionIncreaseLossBps;
        uint256 initialMaxPositionDecreaseLossBps;
        uint256 initialInstrCooldownDuration;
        uint256 initialMaxSwapLossBps;
        uint256 initialSwapCooldownDuration;
    }

Properties

NameTypeDescription
safeaddressThe address of the Safe that the module will be connected to.
initialOperatingModeIMakinaXGovernable.OperatingModeThe initial operating mode of the module.
initialAllowedInstrRootbytes32The root of the Merkle tree containing the allowed instructions for the module.
initialMaxPositionIncreaseLossBpsuint256The max allowed value loss (in basis points) for position increases while in WALLED mode.
initialMaxPositionDecreaseLossBpsuint256The max allowed value loss (in basis points) for position decreases while in WALLED mode.
initialInstrCooldownDurationuint256The cooldown duration (in seconds) for position management while in WALLED mode.
initialMaxSwapLossBpsuint256The maximum allowed loss in basis points for swap operations while in FENCED or WALLED mode.
initialSwapCooldownDurationuint256The cooldown duration (in seconds) for swap operations while in FENCED or WALLED mode.

MakinaXModuleServiceParams

Protocol-controlled service initialization parameters.

struct MakinaXModuleServiceParams {
        address initialProvider;
        uint256 initialSwapFeeRate;
    }

Properties

NameTypeDescription
initialProvideraddressThe address of the MakinaX service account.
initialSwapFeeRateuint256The fee rate for swap operations, 1e18 = 100%.