Skip to main content

LpReceipt.sol

LpAction

The LpAction enum represents the types of LP actions that can be performed.

enum LpAction {
ADD_LIQUIDITY,
REMOVE_LIQUIDITY
}

LpReceipt

struct LpReceipt {
uint256 id;
uint256 oracleVersion;
uint256 amount;
address recipient;
LpAction action;
int16 tradingFeeRate;
}

The LpReceipt struct represents a receipt of an LP action performed.

NameTypeDescription
iduint256An identifier for the receipt
oracleVersionuint256The oracle version associated with the action
amountuint256The amount involved in the action,
when the action is ADD_LIQUIDITY, this value represents the amount of settlement tokens
when the action is REMOVE_LIQUIDITY, this value represents the amount of CLB tokens
recipientaddressThe address of the recipient of the action
actionLpActionAn enumeration representing the type of LP action performed (ADD_LIQUIDITY or REMOVE_LIQUIDITY)
tradingFeeRateint16The trading fee rate associated with the LP action

LpReceiptLib

Provides functions that operate on the LpReceipt struct

clbTokenId

function clbTokenId(struct LpReceipt self) internal pure returns (uint256)

Computes the ID of the CLBToken contract based on the trading fee rate.

  • Parameters:

    NameTypeDescription
    selfstruct LpReceiptThe LpReceipt struct.
  • Return Values:

    NameTypeDescription
    [0]uint256The ID of the CLBToken contract.