Uniswap / Uniswap/interface

Allow deadline to be omitted

Open
#2,924 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

improvement p1
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.