-
Notifications
You must be signed in to change notification settings - Fork 110
Conversation
change feels hefty, the odds of losing an ERC20 are so slim. The most minimally invasive change to the sdk IMO is to add a bool parameter to If we must be this thorough this looks fiiiiiine i guess 😏 but wouldnt want the sdk to get too out of hand with trying to every last unlikely case. |
src/entities/protocols/uniswap.ts
Outdated
@@ -53,6 +68,11 @@ export class UniswapTrade implements Command { | |||
encode(planner: RoutePlanner, _config: TradeConfig): void { | |||
let payerIsUser = true | |||
|
|||
let safetyMode = this.options.safetyMode ?? SafetyModes.Normal | |||
let inputETHSweep = safetyMode == SafetyModes.InputOutputSweeps || safetyMode == SafetyModes.AllSweeps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we rename to shouldSweepETH
and shouldSweepIntermediateTokens
for readability, know it's a bool flag
per slack convo: could we enforce a certain slippage instead of sweeping erc20 tokens on intermediate swaps?? if so, the changes could possibly go in swapRouter.ts?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slippage in lieau of sweeping interediate?? arguably safer bc we could get back some random ERC20, but still have bad slippage on the trade.......right?
No description provided.