How to Check a Swap Transaction Deadline Before You Sign

A swap can revert and still burn gas. You signed leftover calldata whose on-chain deadline was already past, or the window was too short for a block. To check a swap transaction deadline before signing, find the Unix timestamp on the live quote, in the wallet prompt, or in decoded calldata. Convert it to seconds. Sign only if that cutoff is still ahead with room for inclusion. If it is not, refresh. Do not patch old data.
Summary: A quote timer and an on-chain swap deadline are not the same clock. Read the quote TTL separately from the Unix seconds encoded in the transaction. On YiFi, an expired rateId returns RATE_EXPIRED after five minutes; that is not the router cutoff. Convert the timestamp, compare it with now, and sign only a fresh payload whose window can still include the tx.
YiFi Swap is a non-custodial aggregator: you keep the keys; YiFi is the interface and router, not a bank. Smart Routing ranks DEX pools (on-chain vending machines of tokens), CEX-style desks, and private liquidity. How-it-works docs: select → review quote → confirm (sign or send to a deposit address) → track. Quotes are indicative under the YiFi Swap Terms of Use. Check the live estimate. Quote lines live in how to read a crypto swap quote.
Separate a stale quote timer from the on-chain swap deadline

An indicative quote is a preview, not a reserved fill. Calldata is the packed instruction list the wallet is about to send. The quote timer answers “is this estimate still current?” The on-chain deadline answers “after which Unix second will the router refuse the swap?”
On the YiFi Swap API, optional rateId from GET /v1/quote is a snapshot. Missing or expired rateId returns HTTP 400 RATE_EXPIRED with a TTL of five minutes. That is quote TTL, not the DEX router cutoff. RATE_EXPIRED is an HTTP error before you spend gas. UniswapV2Router: EXPIRED is an on-chain revert after inclusion; native gas can still be spent.
| Clock | Plain meaning | What to do |
|---|---|---|
| Quote expiry / rateId TTL | Estimate still treated as current. YiFi API: RATE_EXPIRED after 5 minutes. | Refresh the quote. Do not treat this as the router cutoff. |
| On-chain transaction deadline | Unix seconds after which the router reverts (EXPIRED / Transaction too old). | Find, convert, and compare with now before you sign. |
| Minimum received | Worst output you still accept while the tx waits. Not a timer. | Confirm the floor. Do not confuse it with the deadline. |
Other quote clocks (LI.FI validUntil, 0x RFQ) are not a YiFi retail default in minutes. Do split the three rows before you open the wallet. Don’t sign because the quote card still looks pretty.
Find the deadline in the swap UI, wallet prompt, or decoded calldata

Open official YiFi Swap. Enter the pair, amount, source chain, and destination chain. Wait for a fresh quote. Do not sign from a tab that sat open, or from an urgent DM.
First name the rail. engine=dex is on-chain: you sign. engine=cex or private is off-chain: you send the exact asset and amount to a one-time deposit address. Off-chain hops usually have no Uniswap-style deadline in calldata. Read the quote window and provider expirationTime. Send only inside that window. Do not hunt for a Unix field that is not there.
On a DEX hop, look in three places: settings minutes remaining (a hint, not proof), the wallet prompt (deadline, expiry, expiresAt, validUntil), then decoded calldata. On Uniswap v2 swapExact* helpers, deadline is the last uint256.
Uniswap docs treat the deadline as a timestamp after which a pending swap is no longer valid. Uniswap’s UI (updated 11 May 2026) lets traders set that window in minutes: default 30 minutes, range 1 minute – 3 days (4,320 minutes). That is Uniswap’s UI, not a YiFi default. A closed Uniswap interface issue showed 5 minutes in settings while calldata still stored creation plus 30 minutes. Decode this payload. Don’t copy another product’s minutes onto YiFi.
Convert the Unix timestamp and judge whether the remaining window can still include the tx

A Unix timestamp is seconds since 1 January 1970. Router deadlines are almost always 10-digit seconds, not 13-digit milliseconds. Browser Date.now() is milliseconds; Uniswap SDK examples divide by 1,000. If you see 13 digits, you are looking at ms, not a v2/v3 deadline.
LI.FI’s failed-tx guide walks a real word: deadline 0x6951e2e0 equals 1,766,974,176. The mined block timestamp was 1,766,975,579. That is 1,403 seconds late, about 23 minutes. The router rejected it. Remaining window is deadline minus now in seconds. If that number is already zero or negative, do not sign.
A deadline is an upper bound, not a promise of inclusion. A pending tx in the mempool (the waiting room before a block) can still mine after the cutoff and revert. Uniswap docs pair the deadline with min output; the timestamp does not replace that floor. v2 reverts with EXPIRED; v3 uses Transaction too old; a zero deadline on v3 always reverts. Do convert hex to decimal seconds and compare with now. Don’t sign a past stamp, a 13-digit ms value, or a zero deadline.
YiFi does not publish a retail default in minutes. Other UI defaults (Route fun 10 minutes, ShibaSwap 20, Uniswap SDK example 20) are those products. Read the timestamp on this payload.
Reject leftover calldata; refresh the quote instead of stretching the deadline
Leftover calldata is yesterday’s packed swap still sitting in a tab, a JSON dump, or a wallet queue. Peach’s aggregator docs are blunt: extending an old JSON deadline field does not extend signed authorization. Do not edit calls, amounts, recipient, or deadline. After expiry, request a new quote.
Should you lengthen the deadline so the swap goes through? Not as the first move. Uniswap’s UI guidance: too short fails and burns gas; too long leaves more time for an unexpected price. LI.FI’s debug note for stale-quote slippage is to re-quote and execute within 60–90 seconds of quoting. That is LI.FI guidance, not a YiFi rule. Do request a new quote and keep minimum received. Don’t patch hex or reuse data that already failed.
If explorer later shows Fail with EXPIRED or Transaction too old, stop. Do not resend the same data. Use how to troubleshoot a reverted crypto swap after Fail.
Pre-sign checklist: deadline, minimum received, destination, then sign on /swap
Run this pass on a fresh payload only. Minimum received is the floor you still accept if the market moves while the tx waits. Do not widen slippage first so it goes through; that percent lives in how to set slippage tolerance before you sign. Confirm destination token, chain, and wallet together.
Workflow: Official Swap → fresh quote → quote timer ≠ deadline → find the field → convert Unix seconds → remaining window vs inclusion → reject leftover → min received + destination → sign.
- Step 1: Open official YiFi Swap. Enter pair, amount, and both chains. Wait for a fresh quote.
- Step 2: Split the quote timer from the on-chain deadline. Off-chain: read expirationTime, not a Uniswap Unix field.
- Step 3: On a DEX hop, find deadline in settings, the wallet prompt, then decoded calldata (v2: last uint256).
- Step 4: Convert hex to decimal Unix seconds (10 digits, not 13-digit ms). Compare with now. If past or too tight, stop.
- Step 5: Reject leftover calldata. Do not stretch an old JSON deadline. Request a new quote.
- Step 6: Check minimum received is still acceptable. Confirm destination token, chain, and wallet.
- Step 7: Sign only this fresh payload. If Fail later reads EXPIRED, do not resend the same data.
When the checklist is green, open YiFi Swap again, rebuild the quote, and sign only then.
Do: Sign a payload whose deadline is still in the future with room for a block. Don’t: Stretch leftover calldata or treat a long deadline as a promise that the swap will land.
Frequently asked questions
Is quote expiry the same as the transaction deadline?
Refresh the quote when the card or TTL lapses. On YiFi, an expired rateId returns RATE_EXPIRED after five minutes. Still decode the on-chain deadline; it is a separate Unix cutoff after inclusion.
What happens if the deadline already passed?
Do not sign. Request a new quote. If you already sent it, the router should revert with EXPIRED or Transaction too old; tokens typically stay, but gas can still be spent. Do not resend the same data.
Should I lengthen the deadline so the swap goes through?
Refresh the quote and keep minimum received. Uniswap notes that too short fails and burns gas, while too long leaves more time for price drift. Stretching leftover calldata is not a new authorization.
How do I read the deadline in wallet hex?
Decode the deadline argument. On v2 swapExact* it is the last uint256. Convert hex to decimal Unix seconds and compare with now (example: 0x6951e2e0 equals 1,766,974,176).
Do CEX or off-chain routes have this deadline?
Check the quote window and provider expirationTime. Off-chain hops usually have no Uniswap router deadline. Send only inside that window to the given deposit address.
If the swap reverts as EXPIRED, did my tokens leave?
Confirm Fail on the explorer for the chain you signed, then requote. On a typical DEX revert the swap is undone and the input stays, but native gas is still paid. Do not send a second swap while anything is still pending.
Why do some UIs say 30 minutes and SDK snippets say 20?
Read the timestamp on this payload. Those minutes are that product’s defaults (Uniswap UI 30, SDK example 20, ShibaSwap 20, Route fun 10). YiFi does not publish a retail default in minutes.