Libraries

Functionalities used by other contracts

DiverLiquidityAmounts

getLiquidityFromCs

Computes the amount of liquidity to be received by the pool, for a given amount of collateral and price range

function getLiquidityFromCs(
        uint160 sqrtRatioX96,
        uint160 sqrtRatioAX96,
        uint160 sqrtRatioBX96,
        uint256 amount
    )
        internal
        pure
        returns (uint128 liquidity)

Params:

Returns:

getLiquidityFromSToken

Computes the amount of liquidity to be received by the pool, for a given amount of Spear or Shield tokens and price range

function getLiquidityFromSToken(uint160 sqrtRatioAX96, uint160 sqrtRatioBX96, uint256 amount) internal pure returns (uint128 liquidity)

Params:

Returns:

CallbackValidation

Provides validation for callbacks from battle

verifyCallback

Verifies the arena address of the battle

function verifyCallback(address arenaAddr, BattleKey memory battleKey) internal view

Params:

Last updated