ILBPair
Required interface of LBPair contract
MintArrays
struct MintArrays {
uint256[] ids;
bytes32[] amounts;
uint256[] liquidityMinted;
}
DepositedToBins
event DepositedToBins(address indexed sender, address indexed to, uint256[] ids, bytes32[] amounts)
WithdrawnFromBins
event WithdrawnFromBins(address indexed sender, address indexed to, uint256[] ids, bytes32[] amounts)
CompositionFees
event CompositionFees(address indexed sender, uint24 id, bytes32 totalFees, bytes32 protocolFees)
CollectedProtocolFees
event CollectedProtocolFees(address indexed feeRecipient, bytes32 protocolFees)
Swap
event Swap(
address indexed sender,
address indexed to,
uint24 id,
bytes32 amountsIn,
bytes32 amountsOut,
uint24 volatilityAccumulator,
bytes32 totalFees,
bytes32 protocolFees
)
StaticFeeParametersSet
event StaticFeeParametersSet(
address indexed sender,
uint16 baseFactor,
uint16 filterPeriod,
uint16 decayPeriod,
uint16 reductionFactor,
uint24 variableFeeControl,
uint16 protocolShare,
uint24 maxVolatilityAccumulator
)
FlashLoan
event FlashLoan(
address indexed sender,
ILBFlashLoanCallback indexed receiver,
uint24 activeId,
bytes32 amounts,
bytes32 totalFees,
bytes32 protocolFees
)
OracleLengthIncreased
event OracleLengthIncreased(address indexed sender, uint16 oracleLength)
ForcedDecay
event ForcedDecay(address indexed sender, uint24 idReference, uint24 volatilityReference)
initialize
function initialize(
uint16 baseFactor,
uint16 filterPeriod,
uint16 decayPeriod,
uint16 reductionFactor,
uint24 variableFeeControl,
uint16 protocolShare,
uint24 maxVolatilityAccumulator,
uint24 activeId
) external override onlyFactory
getFactory
function getFactory() external view override returns (ILBFactory factory)
getTokenX
function getTokenX() external pure override returns (IERC20 tokenX)
getTokenY
function getTokenY() external pure override returns (IERC20 tokenY)
getBinStep
function getBinStep() external pure override returns (uint16)
getReserves
function getReserves() external view override returns (uint128 reserveX, uint128 reserveY)
getActiveId
function getActiveId() external view override returns (uint24 activeId)
getBin
function getBin(uint24 id) external view override returns (uint128 binReserveX, uint128 binReserveY)
getNextNonEmptyBin
function getNextNonEmptyBin(bool swapForY, uint24 id) external view override returns (uint24 nextId)
getProtocolFees
function getProtocolFees() external view returns (uint128 protocolFeeX, uint128 protocolFeeY)
getStaticFeeParameters
function getStaticFeeParameters() external view returns (uint16 baseFactor, uint16 filterPeriod, uint16 decayPeriod, uint16 reductionFactor, uint24 variableFeeControl, uint16 protocolShare, uint24 maxVolatilityAccumulator)
getVariableFeeParameters
function getVariableFeeParameters() external view returns (uint24 volatilityAccumulator, uint24 volatilityReference, uint24 idReference, uint40 timeOfLastUpdate)
getOracleParameters
function getOracleParameters() external view returns (uint8 sampleLifetime, uint16 size, uint16 activeSize, uint40 lastUpdated, uint40 firstTimestamp)
getOracleSampleAt
function getOracleSampleAt(uint40 lookupTimestamp) external view returns (uint64 cumulativeId, uint64 cumulativeVolatility, uint64 cumulativeBinCrossed)
getPriceFromId
function getPriceFromId(uint24 id) external pure returns (uint256 price)
getIdFromPrice
function getIdFromPrice(uint256 price) external pure returns (uint24 id)
getSwapIn
function getSwapIn(uint128 amountOut, bool swapForY) external view returns (uint128 amountIn, uint128 amountOutLeft, uint128 fee)
getSwapOut
function getSwapOut(uint128 amountIn, bool swapForY) external view override returns (uint128 amountInLeft, uint128 amountOut, uint128 fee)
swap
function swap(bool swapForY, address to) external override nonReentrant returns (bytes32 amountsOut)
flashLoan
function flashLoan(ILBFlashLoanCallback receiver, bytes32 amounts, bytes calldata data) external override nonReentrant
mint
function mint(address to, bytes32[] calldata liquidityConfigs, address refundTo) external override nonReentrant returns (bytes32 amountsReceived, bytes32 amountsLeft, uint256[] memory liquidityMinted)
burn
function burn(address from, address to, uint256[] calldata ids, uint256[] calldata amountsToBurn) external override nonReentrant checkApproval(from, msg.sender) returns (bytes32[] memory amounts)
collectProtocolFees
function collectProtocolFees() external override nonReentrant onlyProtocolFeeRecipient returns (bytes32 collectedProtocolFees)
increaseOracleLength
function increaseOracleLength(uint16 newLength) external override
setStaticFeeParameters
function setStaticFeeParameters(
uint16 baseFactor,
uint16 filterPeriod,
uint16 decayPeriod,
uint16 reductionFactor,
uint24 variableFeeControl,
uint16 protocolShare,
uint24 maxVolatilityAccumulator
) external override onlyFactory
forceDecay
function forceDecay() external override onlyFactory
Last updated