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.
Name | Type | Description |
---|---|---|
id | uint256 | An identifier for the receipt |
oracleVersion | uint256 | The oracle version associated with the action |
amount | uint256 | The amount involved in the action, when the action is ADD_LIQUIDITY , this value represents the amount of settlement tokenswhen the action is REMOVE_LIQUIDITY , this value represents the amount of CLB tokens |
recipient | address | The address of the recipient of the action |
action | LpAction | An enumeration representing the type of LP action performed (ADD_LIQUIDITY or REMOVE_LIQUIDITY) |
tradingFeeRate | int16 | The 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:
Name Type Description self struct LpReceipt The LpReceipt struct. Return Values:
Name Type Description [0] uint256 The ID of the CLBToken contract.