IValantisHOTModule

Git Source

Functions

initialize

initialize function to delegate call onced the beacon proxy is deployed, for initializing the valantis module. who can call deposit and withdraw functions.

function initialize(
    address pool_,
    uint256 init0_,
    uint256 init1_,
    uint24 maxSlippage_,
    address metaVault_
) external;

Parameters

NameTypeDescription
pool_addressaddress of the valantis sovereign pool.
init0_uint256initial amount of token0 to provide to valantis module.
init1_uint256initial amount of token1 to provide to valantis module.
maxSlippage_uint24allowed to manager for rebalancing the inventory using swap.
metaVault_addressaddress of the meta vault

setALMAndManagerFees

set HOT and initialize manager fees function.

function setALMAndManagerFees(
    address alm_,
    address oracle_
) external;

Parameters

NameTypeDescription
alm_addressaddress of the valantis HOT ALM.
oracle_addressaddress of the oracle used by the valantis HOT module.

setPriceBounds

fucntion used to set range on valantis AMM

function setPriceBounds(
    uint160 _sqrtPriceLowX96,
    uint160 _sqrtPriceHighX96,
    uint160 _expectedSqrtSpotPriceLowerX96,
    uint160 _expectedSqrtSpotPriceUpperX96
) external;

Parameters

NameTypeDescription
_sqrtPriceLowX96uint160lower bound of the range in sqrt price.
_sqrtPriceHighX96uint160upper bound of the range in sqrt price.
_expectedSqrtSpotPriceLowerX96uint160expected upper limit of current spot price (to prevent sandwich attack and manipulation).
_expectedSqrtSpotPriceUpperX96uint160expected lower limit of current spot price (to prevent sandwich attack and manipulation).

swap

function to swap token0->token1 or token1->token0 and then change inventory.

function swap(
    bool zeroForOne_,
    uint256 expectedMinReturn_,
    uint256 amountIn_,
    address router_,
    uint160 expectedSqrtSpotPriceUpperX96_,
    uint160 expectedSqrtSpotPriceLowerX96_,
    bytes calldata payload_
) external;

Parameters

NameTypeDescription
zeroForOne_boolboolean if true token0->token1, if false token1->token0.
expectedMinReturn_uint256minimum amount of tokenOut expected.
amountIn_uint256amount of tokenIn used during swap.
router_addressaddress of smart contract that will execute swap.
expectedSqrtSpotPriceUpperX96_uint160upper bound of current price.
expectedSqrtSpotPriceLowerX96_uint160lower bound of current price.
payload_bytesdata payload used for swapping.

pool

function used to get the valantis hot pool.

function pool() external view returns (ISovereignPool);

alm

function used to get the valantis hot alm/ liquidity module.

function alm() external view returns (IHOT);

maxSlippage

function used to get the max slippage that can occur during swap rebalance.

function maxSlippage() external view returns (uint24);

oracle

function used to get the oracle that will be used to proctect rebalances.

function oracle() external view returns (IOracleWrapper);

Events

LogSetALM

event LogSetALM(address alm);

LogInitializePosition

event LogInitializePosition(uint256 amount0, uint256 amount1);

LogSwap

event LogSwap(
    uint256 oldBalance0,
    uint256 oldBalance1,
    uint256 newBalance0,
    uint256 newBalance1
);

Errors

NoNativeToken

error NoNativeToken();

OnlyPool

error OnlyPool(address caller, address pool);

AmountsZeros

error AmountsZeros();

NotImplemented

error NotImplemented();

ExpectedMinReturnTooLow

error ExpectedMinReturnTooLow();

MaxSlippageGtTenPercent

error MaxSlippageGtTenPercent();

NotDepositedAllToken0

error NotDepositedAllToken0();

NotDepositedAllToken1

error NotDepositedAllToken1();

OnlyMetaVaultOwner

error OnlyMetaVaultOwner();

ALMAlreadySet

error ALMAlreadySet();

SlippageTooHigh

error SlippageTooHigh();

NotEnoughToken0

error NotEnoughToken0();

NotEnoughToken1

error NotEnoughToken1();

SwapCallFailed

error SwapCallFailed();

OverMaxDeviation

error OverMaxDeviation();

WrongRouter

error WrongRouter();