Closed langnavina97 closed 1 month ago
I have one question, 1Are we only adding enable tokens checks, because if we are adding price oracle token, I though there will be some price check or something, to tackle any ,manipulation
Here in this function - https://github.com/Velvet-Capital/Velvet-v4/blob/414b8e6e94a68f765bd6a9c1b1aac653ad8ae33b/contracts/wrappers/algebra/PositionManagerAlgebraAbstract.sol#L349
We will be always passing the value - _params._amountIn > 0, then it will never move in else condition
if (_params._amountIn > 0) {
(balance0, balance1) = _swapTokenToToken(_params);
}
also we have -
ISwapRouter.ExactInputSingleParams memory params = ISwapRouter
.ExactInputSingleParams({
tokenIn: _params._tokenIn,
tokenOut: _params._tokenOut,
recipient: address(this),
deadline: block.timestamp,
amountIn: _params._amountIn,
amountOutMinimum: 0, // @todo add slippage control
limitSqrtPrice: 0
});
This will be just for one token to other, right?
I have one question, 1Are we only adding enable tokens checks, because if we are adding price oracle token, I though there will be some price check or something, to tackle any ,manipulation
Only enabled tokens can be added to make sure there is a price oracle.. verifySwap will verify the swap
if (_params._amountIn > 0) {
If the swap amount is zero it means the fees were returned in the correct ratio, then we only verify if the ratio is correct.. then no swap is required
Added our Chainlink oracle to verify the swap when fees are being swapped to reinvest into the external position