Params

Parameters for functions contained in the periphery contracts:

CreateAndInitBattleParams

The parameters for creating and initializing a battle

struct CreateAndInitBattleParams {
    BattleKey bk;
    uint160 sqrtPriceX96;
}

Params:

Name

Type

Description

bk

BattleKey

The battle key containing a pool's specifications

sqrtPriceX96

uint160

The starting sqrtPrice of the pool

AddLiquidityParams

The parameters for adding liquidity to a battle

struct AddLiqParams {
    BattleKey battleKey;
    address recipient;
    int24 tickLower;
    int24 tickUpper;
    LiquidityType liquidityType;
    uint128 amount;
    uint256 deadline;
}

Params:

Name

Type

Description

battleKey

BattleKey

The battle key

recipient

address

The address that receives the NFT

tickLower

int24

The lower tick of the position

tickUpper

int24

The upper tick of the position

liquidityType

LiquidityType

Specifies the type of liquidity seeded to the position is collateral, Spear, or Shield

amount

uint128

The amount of collateral, Spear or Shield to add

deadline

uint256

The deadline of the transaction

TradeParams

Represents the parameters for a trade

struct TradeParams {
    BattleKey battleKey;
    TradeType tradeType;
    uint256 amountSpecified;
    address recipient;
    uint256 amountOutMin;
    uint160 sqrtPriceLimitX96;
    uint256 deadline;
}

Params:

Name

Type

Description

battleKey

BattleKey

The battle key

tradeType

TradeType

The trade type (buy Spear or buy Shield)

amountSpecified

uint256

How much collateral input or SToken output amount to be swapped in/out

recipient

address

The address to receive the output of the swap

amountOutMin

uint256

The minimum amount of Spear or Shield output to receive

sqrtPriceLimitX96

uint160

The maximum/minimum Q64.96 sqrtPrice limit. When reached, the trade is completed

deadline

uint256

The deadline of the transaction

Last updated