Skip to content

Timeout estimate shows total window duration, not remaining time #20

@Grizouforever

Description

@Grizouforever

Description

In src/pages/SwapDetailPage.tsx (~lines 263-268), the timeout block estimate is computed as:

formatBlockEstimate(
  parseInt(swap.timeoutBlock) - parseInt(swap.initiatedBlock),
)

This computes timeoutBlock - initiatedBlock, which is the total swap window from start to expiry. It does not represent how much time remains. A user viewing a swap that was initiated 100 blocks ago with a 120-block window would see "~20 min" on the timeout line, but the actual remaining time is only a few blocks.

The label currently says window, which is ambiguous. There is no currentBlock available in the page's data model to compute true remaining time.

Steps to Reproduce

  1. Open a swap detail page for an active swap.
  2. Observe the timeout block estimate in parentheses next to the timeout block number.
  3. The displayed estimate reflects the total window duration (timeoutBlock - initiatedBlock), not the remaining time.

Expected Behavior

The label should make clear this is the total window duration, not remaining time — or ideally compute timeoutBlock - currentBlock once a current block value is available.

Actual Behavior

The label reads window implying it is remaining time, which misleads users who are monitoring an active swap near expiry.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions