Params

Parameters for functions contained in the core contracts

BattleBurnParams

Params used by burn function in the core Battle contracts

struct BattleBurnParams {
    int24 tickLower;
    int24 tickUpper;
    LiquidityType liquidityType;
    uint128 liquidityAmount;
}

Params:

Name

Type

Description

tickLower

int24

The lower tick boundary of the position for which to burn liquidity

tickUpper

int24

The upper tick boundary of the position for which to burn liquidity

liquidityType

LiquidityType

The chosen liquidity type can be Collateral, Spear, or Shield

liquidityAmount

uint128

The amount of liquidity to be burnt

BattleMintParams

Params used by mint function in the core Battle contracts

struct BattleMintParams {
    address recipient;
    int24 tickLower;
    int24 tickUpper;
    LiquidityType liquidityType;
    uint128 amount;
    uint128 seed;
    bytes data;
}

Params:

Name

Type

Description

recipient

address

The address for which the liquidity will be added

tickLower

int24

The lower tick boundary of the position in which to add liquidity

tickUpper

int24

The upper tick boundary of the position in which to add liquidity

liquidityType

LiquidityType

The chosen liquidity type can be Collateral, Spear, or Shield

amount

uint128

The amount of liquidity to be added

seed

uint128

The token amount provided for the position, of the collateral, Spear or Shield liquidity type

data

bytes

Any data to be passed through to the callback

BattleTradeParams

Params used by trade function in the core Battle contracts

struct BattleTradeParams {
    address recipient;
    TradeType tradeType;
    uint256 amountSpecified;
    uint160 sqrtPriceLimitX96;
    bytes data;
}

Params:

Name

Type

Description

recipient

address

The address to receive the output of the swap

tradeType

TradeType

The type of trade to perform

amountSpecified

uint256

The amount of the swap, which implicitly configures the swap as exact input of collateral or exact output of Spear or Shield token delta

sqrtPriceLimitX96

uint160

The Q64.96 sqrtPrice limit

data

bytes

Any data to be passed through to the callback

ComputeTradeStepParams

Paramaters used for step computations in a trade

struct ComputeTradeStepParams {
    TradeType tradeType;
    uint160 sqrtRatioCurrentX96;
    uint160 sqrtRatioTargetX96;
    uint128 liquidity;
    int256 amountRemaining;
    uint256 unit;
}

Params:

Name

Type

Description

tradeType

TradeType

The type of trade to be executed, whether to BUY_SPEAR or BUY_SHIELD

sqrtRatioCurrentX96

uint160

The current sqrt ratio of the pool

sqrtRatioTargetX96

uint160

The price that cannot be exceeded, from which the direction of the swap is inferred

liquidity

uint128

The usable liquidity

amountRemaining

int256

How much input or output amount is remaining to be swapped in/out

unit

uint256

The token decimal unit, e.g. a token with 18 decimals has a unit of 10**18

CreateBattleParams

The info struct used in the creation of an options pool, ie, a Battle.

struct CreateBattleParams {
    address collateralToken;
    string underlying;
    uint256 expiries;
    uint256 strikeValue;
}

Params:

Name

Type

Description

collateralToken

address

The supported collateral token address for the battle

underlying

string

The underlying asset symbol

expiries

uint256

The of expiry timestamp of the battle

strikeValue

uint256

The value of an option's strike price

DeploymentParams

Parameters used for deploying battles

struct DeploymentParams {
    address arenaAddr;
    BattleKey battleKey;
    address oracleAddr;
    address cOracleAddr;
    Fee fee;
    address spear;
    address shield;
    address manager;
    uint160 sqrtPriceX96;
}

Params:

Name

Type

Description

arenaAddr

address

The address for the arena contract

battleKey

bytes32

The battle Key containing a pool's specifications

oracleAddr

address

The address for the oracle

cOracleAddr

address

the contract address for a chainlink price feed

fee

Fee

The fee structure for the battle

spear

address

The address of the Spear tokens for a pool

shield

address

The address of the Shield tokens for a pool

manager

address

The address for the manager contract

sqrtPriceX96

uint160

The starting sqrt ratio when initiating a battle

ModifyPositionParams

Info struct used to modify position parameters

struct ModifyPositionParams {
    int24 tickLower;
    int24 tickUpper;
    LiquidityType liquidityType;
    int128 liquidityDelta;
}

Params:

Name

Type

Description

tickLower

int24

The lower tick boundary of the position

tickUpper

int24

The upper tick boundary of the position

liquidityType

LiquidityType

The chosen liquidity type can be Collateral, Spear, or Shield

liquidityDelta

int24

The change in liquidity

UpdatePositionParams

Info struct used to update position parameters

struct UpdatePositionParams {
    ModifyPositionParams mpParams;
    int24 tick;
}

Params:

Name

Type

Description

mpParams

ModifyPositionParams

The parameters for modifying the position

tick

int24

The current tick

Last updated