After full router-sdk support lands, deadline will be an optional parameter for swaps. In cases when it is omitted, resulting transactions can be anywhere from 1-5k gas cheaper, because of the calldata reduction associated with not passing it. So, we should consider omitting this parameter for specific swaps to save gas. The biggest (5k) savings are when the transaction would otherwise be able to bypass multicall, but beacuse of deadline has to use more expensive encoding, so possibly we could limit this feature to that case.
This is related to #2141, however the goal of that change would be to reduce transaction failures in cases when failure due to deadline is not desired.
Notes: we have two options on how to integrate this
Manual setting to omit the tx deadline. Include a tooltip that explains you can save some gas by omitting the tx deadline. This could be a toggle ("Omit tx deadline") or a setting in the tx deadline field such as MAX_INT
Potentially we could predict a very high success rate (i.e. a typical USDC:DAI swap) and autmoatically omit the tx deadline in that scenario. (#2141)
After full
router-sdk
support lands, deadline will be an optional parameter for swaps. In cases when it is omitted, resulting transactions can be anywhere from 1-5k gas cheaper, because of the calldata reduction associated with not passing it. So, we should consider omitting this parameter for specific swaps to save gas. The biggest (5k) savings are when the transaction would otherwise be able to bypassmulticall
, but beacuse of deadline has to use more expensive encoding, so possibly we could limit this feature to that case.This is related to #2141, however the goal of that change would be to reduce transaction failures in cases when failure due to deadline is not desired.