Liquidity
Functions
replenishRewards
function replenishRewards(ReplenishParam memory params) internal returns (uint256 output);
getPrice
function getPrice(address pool) internal view returns (uint256 price);
getPriceV2
function getPriceV2(address pool, address tokenAddress) internal view returns (uint256 price);
tickToPrice
function tickToPrice(int24 tick) internal pure returns (uint256 price);
priceToTick
function priceToTick(uint256 price) internal pure returns (int24 tick);
sqrtPriceX96ToPrice
function sqrtPriceX96ToPrice(uint160 sqrtPrice) internal pure returns (uint256 price);
priceToSqrtPriceX96
function priceToSqrtPriceX96(uint256 price) internal pure returns (uint160 sqrtPriceX96);
getBpsDiff
function getBpsDiff(uint256 price1, uint256 price2) internal pure returns (uint256 diff);
_getPriceRevertOnTwap
function _getPriceRevertOnTwap(IUniswapV3Pool pool) internal view returns (uint256 currentPrice);
_getTwapPrice
function _getTwapPrice(IUniswapV3Pool pool) internal view returns (uint256 twapPrice, uint256 currentPrice);
_getSwapInfo
function _getSwapInfo() private view returns (SwapInfo memory swapInfo);
swapWethToReth
function swapWethToReth(uint256 amountIn, address recipient) internal returns (uint256 rethOut);
balancerSwap
Perform a swap via Balancer
function balancerSwap(uint256 amount, address recipient) private returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount of ETH to swap |
recipient | address | The recipient of the output tokens |
Structs
SwapInfo
struct SwapInfo {
uint256 twapPrice;
uint256 currentPriceUni100;
uint256 currentPriceUni500;
uint256 currentPricePancake500;
uint256 triedFlags;
address router;
uint24 fee;
}