ILBLegacyPair
Required interface of Legacy LBPair contract
Bin
struct Bin {
uint112 reserveX;
uint112 reserveY;
uint256 accTokenXPerShare;
uint256 accTokenYPerShare;
}
PairInformation
struct PairInformation {
uint24 activeId;
uint136 reserveX;
uint136 reserveY;
uint16 oracleSampleLifetime;
uint16 oracleSize;
uint16 oracleActiveSize;
uint40 oracleLastTimestamp;
uint16 oracleId;
struct FeeHelper.FeesDistribution feesX;
struct FeeHelper.FeesDistribution feesY;
}
Debts
struct Debts {
uint256 debtX;
uint256 debtY;
}
Fees
struct Fees {
uint128 tokenX;
uint128 tokenY;
}
MintInfo
struct MintInfo {
uint256 amountXIn;
uint256 amountYIn;
uint256 amountXAddedToPair;
uint256 amountYAddedToPair;
uint256 activeFeeX;
uint256 activeFeeY;
uint256 totalDistributionX;
uint256 totalDistributionY;
uint256 id;
uint256 amountX;
uint256 amountY;
uint256 distributionX;
uint256 distributionY;
}
Swap
event Swap(address sender, address recipient, uint24 id, uint256 amountXIn, uint256 amountYIn, uint256 amountXOut, uint256 amountYOut, uint256 volatilityAccumulated, uint256 feesX, uint256 feesY)
FlashLoan
event FlashLoan(address sender, address recipient, uint256 amountX, uint256 amountY, uint256 feesX, uint256 feesY)
LiquidityAdded
event LiquidityAdded(address sender, address recipient, uint256 id, uint256 minted, uint256 amountX, uint256 amountY, uint256 distributionX, uint256 distributionY)
CompositionFee
event CompositionFee(address sender, address recipient, uint256 id, uint256 feesX, uint256 feesY)
LiquidityRemoved
event LiquidityRemoved(address sender, address recipient, uint256 id, uint256 burned, uint256 amountX, uint256 amountY)
FeesCollected
event FeesCollected(address sender, address recipient, uint256 amountX, uint256 amountY)
ProtocolFeesCollected
event ProtocolFeesCollected(address sender, address recipient, uint256 amountX, uint256 amountY)
OracleSizeIncreased
event OracleSizeIncreased(uint256 previousSize, uint256 newSize)
tokenX
function tokenX() external view returns (contract IERC20)
tokenY
function tokenY() external view returns (contract IERC20)
factory
function factory() external view returns (contract ILBFactory)
getReservesAndId
function getReservesAndId() external view returns (uint256 reserveX, uint256 reserveY, uint256 activeId)
getGlobalFees
function getGlobalFees() external view returns (uint256 feesXTotal, uint256 feesYTotal, uint256 feesXProtocol, uint256 feesYProtocol)
getOracleParameters
function getOracleParameters() external view returns (uint256 oracleSampleLifetime, uint256 oracleSize, uint256 oracleActiveSize, uint256 oracleLastTimestamp, uint256 oracleId, uint256 min, uint256 max)
getOracleSampleFrom
function getOracleSampleFrom(uint256 timeDelta) external view returns (uint256 cumulativeId, uint256 cumulativeAccumulator, uint256 cumulativeBinCrossed)
feeParameters
function feeParameters() external view returns (struct FeeHelper.FeeParameters)
findFirstNonEmptyBinId
function findFirstNonEmptyBinId(uint24 id_, bool sentTokenY) external view returns (uint24 id)
getBin
function getBin(uint24 id) external view returns (uint256 reserveX, uint256 reserveY)
pendingFees
function pendingFees(address account, uint256[] ids) external view returns (uint256 amountX, uint256 amountY)
swap
function swap(bool sentTokenY, address to) external returns (uint256 amountXOut, uint256 amountYOut)
flashLoan
function flashLoan(address to, uint256 amountXOut, uint256 amountYOut, bytes data) external
mint
function mint(uint256[] ids, uint256[] distributionX, uint256[] distributionY, address to) external returns (uint256 amountXAddedToPair, uint256 amountYAddedToPair, uint256[] liquidityMinted)
burn
function burn(uint256[] ids, uint256[] amounts, address to) external returns (uint256 amountX, uint256 amountY)
increaseOracleLength
function increaseOracleLength(uint16 newSize) external
collectFees
function collectFees(address account, uint256[] ids) external returns (uint256 amountX, uint256 amountY)
collectProtocolFees
function collectProtocolFees() external returns (uint256 amountX, uint256 amountY)
setFeesParameters
function setFeesParameters(bytes32 packedFeeParameters) external
forceDecay
function forceDecay() external
initialize
function initialize(contract IERC20 tokenX, contract IERC20 tokenY, uint24 activeId, uint16 sampleLifetime, bytes32 packedFeeParameters) external
Last updated