Submitted by Daniel526
The absence of a properly set sqrtPriceLimitX96 allows swaps to execute at prices far beyond expected limits, exposing the contract to unfavorable trade outcomes. The function is also likely to fail at runtime due to a mismatch in struct field names (amountIn instead of amount).
In the _getQuoteAndDirection function, the amountIn parameter is incorrectly used for constructing the QuoteExactInputSingleWithPoolParams struct. Additionally, the sqrtPriceLimitX96 parameter is hardcoded to 0, potentially leading to unintended behavior in price-constrained swaps.
The QuoteExactOutputSingleWithPoolParams struct implementation:
Update _getQuoteAndDirection to correctly reference the struct fields and provide configurable sqrtPriceLimitX96 if needed:
Shaneson (Lambo.win) confirmed and commented:
