Skip to main content

Types.sol

CLAIM_USER

bytes4 CLAIM_USER

CLAIM_KEEPER

bytes4 CLAIM_KEEPER

CLAIM_TP

bytes4 CLAIM_TP

CLAIM_SL

bytes4 CLAIM_SL

PositionMode

enum PositionMode {
Normal,
OpenDisabled,
CloseDisabled,
Suspended
}

LiquidityMode

enum LiquidityMode {
Normal,
AddDisabled,
RemoveDisabled,
Suspended
}

DisplayMode

enum DisplayMode {
Normal,
Suspended,
Deprecating,
Deprecated
}

OpenPositionInfo

struct OpenPositionInfo {
uint256 id;
uint256 openVersion;
int256 qty;
uint256 openTimestamp;
uint256 takerMargin;
uint256 makerMargin;
uint256 tradingFee;
}

The OpenPositionInfo struct represents a opened trading position.

NameTypeDescription
iduint256The position identifier
openVersionuint256The version of the oracle when the position was opened
qtyint256The quantity of the position
openTimestampuint256The timestamp when the position was opened
takerMarginuint256The amount of collateral that a trader must provide
makerMarginuint256The margin amount provided by the maker.
tradingFeeuint256The trading fee associated with the position.

ClosePositionInfo

struct ClosePositionInfo {
uint256 id;
uint256 closeVersion;
uint256 closeTimestamp;
}

The ClosePositionInfo struct represents a closed trading position.

NameTypeDescription
iduint256The position identifier
closeVersionuint256The version of the oracle when the position was closed
closeTimestampuint256The timestamp when the position was closed

ClaimPositionInfo

struct ClaimPositionInfo {
uint256 id;
uint256 entryPrice;
uint256 exitPrice;
int256 realizedPnl;
uint256 interest;
bytes4 cause;
}

The ClaimPositionInfo struct represents a claimed position information.

NameTypeDescription
iduint256The position identifier
entryPriceuint256The entry price of the position
exitPriceuint256The exit price of the position
realizedPnlint256The profit or loss of the claimed position.
interestuint256The interest paid for the claimed position.
causebytes4The description of being claimed.

PendingPosition

struct PendingPosition {
uint256 openVersion;
int256 totalQty;
uint256 totalMakerMargin;
uint256 totalTakerMargin;
}

Represents a pending position within the LiquidityBin

NameTypeDescription
openVersionuint256The oracle version when the position was opened.
totalQtyint256The total quantity of the pending position.
totalMakerMarginuint256The total maker margin of the pending position.
totalTakerMarginuint256The total taker margin of the pending position.

ClosingPosition

struct ClosingPosition {
uint256 closeVersion;
int256 totalQty;
uint256 totalEntryAmount;
uint256 totalMakerMargin;
uint256 totalTakerMargin;
}

Represents the closing position within an LiquidityBin.

NameTypeDescription
closeVersionuint256The oracle version when the position was closed.
totalQtyint256The total quantity of the closing position.
totalEntryAmountuint256The total entry amount of the closing position.
totalMakerMarginuint256The total maker margin of the closing position.
totalTakerMarginuint256The total taker margin of the closing position.

PendingLiquidity

struct PendingLiquidity {
uint256 oracleVersion;
uint256 mintingTokenAmountRequested;
uint256 burningCLBTokenAmountRequested;
}

A struct representing pending liquidity information.

NameTypeDescription
oracleVersionuint256The oracle version of pending liqudity.
mintingTokenAmountRequesteduint256The amount of settlement tokens requested for minting.
burningCLBTokenAmountRequesteduint256The amount of CLB tokens requested for burning.

ClaimableLiquidity

struct ClaimableLiquidity {
uint256 mintingTokenAmountRequested;
uint256 mintingCLBTokenAmount;
uint256 burningCLBTokenAmountRequested;
uint256 burningCLBTokenAmount;
uint256 burningTokenAmount;
}

A struct representing claimable liquidity information.

NameTypeDescription
mintingTokenAmountRequesteduint256The amount of settlement tokens requested for minting.
mintingCLBTokenAmountuint256The actual amount of CLB tokens minted.
burningCLBTokenAmountRequesteduint256The amount of CLB tokens requested for burning.
burningCLBTokenAmountuint256The actual amount of CLB tokens burned.
burningTokenAmountuint256The amount of settlement tokens equal in value to the burned CLB tokens.

LiquidityBinStatus

struct LiquidityBinStatus {
uint256 liquidity;
uint256 freeLiquidity;
uint256 binValue;
int16 tradingFeeRate;
}

A struct representing status of the liquidity bin.

NameTypeDescription
liquidityuint256The total liquidity amount in the bin
freeLiquidityuint256The amount of free liquidity available in the bin.
binValueuint256The current value of the bin.
tradingFeeRateint16The trading fee rate for the liquidity.