Current Behavior
The _swapExactIn() function in UniswapV3SwapConnectors applies an additional hardcoded 1% slippage reduction on top of the amountOutMin parameter that callers already provide.
Code location: Lines ~651 in UniswapV3SwapConnectors.cdc
// Slippage/min out on EVM units (adjust factor to your policy)
let slippage = 0.01 // 1%
let minOutUint = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(
amountOutMin * (1.0 - slippage),
erc20Address: outToken
)
Expected Behavior
The function should respect the amountOutMin parameter as provided by the caller without applying additional slippage. Callers are responsible for calculating their own acceptable slippage tolerance.
Problem
This creates double slippage protection:
Example Scenario
- User queries swap: 100 USDC → ~50 FLOW
- User accepts 2% slippage:
minAcceptable = 50.0 * 0.98 = 49.0 FLOW
- User calls
swap() with amountOutMin = 49.0
- Contract applies extra 1%:
49.0 * 0.99 = 48.51 FLOW
- Result: Total slippage is ~2.98% instead of the user's intended 2%
What are you currently working on that this is blocking?
No response