Types

Common

BattleKey

Info struct containing a pool's specifications

struct BattleKey {
    address collateral;
    string underlying;
    uint256 expiries;
    uint256 strikeValue;
}

Params:

Fee

Info struct representing the fee ratios used in a battle

struct Fee {
    uint256 transactionFee;
    uint256 protocolFee;
    uint256 exerciseFee;
}

Params:

GrowthX128

Info struct tracking the cumulative amounts of fees and deltas of collateral, Spear and Shield tokens involved in transactions

struct GrowthX128 {
    uint256 fee;
    uint256 collateralIn;
    uint256 spearOut;
    uint256 shieldOut;
}

Params:

Owed

Info struct tracking the amounts of fees and deltas of collateral, Spear and Shield tokens that are owed to a position

struct Owed {
    uint128 fee;
    uint128 collateralIn;
    uint128 spearOut;
    uint128 shieldOut;
}

Params:

TickInfo

Info struct tracking the state of a tick

struct TickInfo {
    uint128 liquidityGross;
    int128 liquidityNet;
    GrowthX128 outside;
    bool initialized;
}

Params:

PositionInfo

Info struct tracking the state of a position

struct PositionInfo {
    uint128 liquidity;
    GrowthX128 insideLast;
}

Params:

Enums

LiquidityType

Tracks the type of liquidity used by the LP

enum LiquidityType {
    COLLATERAL,
    SPEAR,
    SHIELD
}

Outcome

Tracks the status of a battle

enum Outcome {
    ONGOING, 
    SPEAR_WIN, 
    SHIELD_WIN 
}

TradeType

Tracks the type of trade

enum TradeType {
    BUY_SPEAR,
    BUY_SHIELD
}

TradeTypes

TradeCache

Represents cached trade information

struct TradeCache {
    uint256 feeProtocol;
}

Params:

TradeState

Represents the state of the trade

struct TradeState {
    uint256 amountSpecifiedRemaining;
    uint256 amountCalculated;
    uint160 sqrtPriceX96;
    int24 tick;
    GrowthX128 global;
    uint128 protocolFee;
    uint128 liquidity;
    uint256 transactionFee;
}

Params:

StepComputations

Info struct used in computing the result of swapping some amount in, or amount out, given the parameters of the swap.

struct StepComputations {
    uint160 sqrtPriceStartX96;
    int24 tickNext;
    bool initialized;
    uint160 sqrtPriceNextX96;
    uint256 amountIn;
    uint256 amountOut;
    uint256 feeAmount;
    int24 tickLower;
    int24 tickUpper;
}

Params:

Last updated