Allow deadline to be omitted
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.5k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked router-sdk source at src/swapRouter.ts#L47 and read related issue #2141 to understand the differing goals. Then locate the interface's swap transaction encoding and determine which cases can omit deadline. Done means the supported cases are defined and the resulting transactions preserve the intended behavior while reducing calldata.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- blockchain
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100