Skip to content

feat: show failed destination swap#2284

Open
gsteenkamp89 wants to merge 7 commits intomasterfrom
feat/gsteenkamp/failed-destination-swap
Open

feat: show failed destination swap#2284
gsteenkamp89 wants to merge 7 commits intomasterfrom
feat/gsteenkamp/failed-destination-swap

Conversation

@gsteenkamp89
Copy link
Contributor

@gsteenkamp89 gsteenkamp89 commented Feb 3, 2026

closes FE-95

Morivation

In cases where the destination swap failed, we need to inform the user that they received the bridge token and it's amount.
This solution is a bit hacky since we rely on both the deposit/status endpoint for the initial status of the fill, then we use the /deposit endpoint for more detail, ie the amount received in the bridge token.
In future PR's we should consider removing reliance on the status endpoint altogether and simply use the more data-rich /deposit endpoint.

Examples

Failed swap (USDT => ACX)
Link

Screenshot 2026-02-04 at 11 48 11

Success (USDC => USDT)
Link

Screenshot 2026-02-04 at 11 48 18

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
@vercel
Copy link

vercel bot commented Feb 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
app-frontend-v3 Ready Ready Preview, Comment Feb 5, 2026 3:45pm
sepolia-frontend-v3 Ready Ready Preview, Comment Feb 5, 2026 3:45pm

Request Review

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
@gsteenkamp89 gsteenkamp89 marked this pull request as ready for review February 4, 2026 09:36
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
@linear
Copy link

linear bot commented Feb 4, 2026

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
0xjorgen
0xjorgen previously approved these changes Feb 5, 2026
Copy link
Contributor

@0xjorgen 0xjorgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Clean implementation for handling failed destination swaps. The actionsSucceeded === false check is correct per indexer logic.

nit: Line 303 in DepositTimesCard.tsx - the non-null assertion (finalOutputAmountUsd!) could be avoided by adding it to the conditional check above.

textColor="light-100"
/>
<Text color="grey-400">
(${formatUSD(finalOutputAmountUsd!)})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this crash if finalOutputAmountUsd is undefined?

Copy link
Contributor Author

@gsteenkamp89 gsteenkamp89 Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it might, good catch!

@0xjorgen 0xjorgen self-requested a review February 5, 2026 08:33
@0xjorgen 0xjorgen dismissed their stale review February 5, 2026 08:34

Found issues while testing

Copy link
Contributor

@0xjorgen 0xjorgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got this error when briding same assets

{
    "type": "AcrossApiError",
    "code": "INVALID_PARAM",
    "status": 400,
    "message": "Query param 'refundOnOrigin' must be 'true' for same-asset bridge swaps.",
    "param": "refundOnOrigin",
    "id": "lrbxq-1770280421988-eea295f2c127"
}
Image

@0xjorgen
Copy link
Contributor

0xjorgen commented Feb 5, 2026

I also get

{
    "error": "DepositNotFoundException",
    "message": "Deposit not found given the provided constraints"
}

when bridging from usdc(eth) to usdt(arb)
Screenshot 2026-02-05 at 08 43 32 UTC@2x

@gsteenkamp89
Copy link
Contributor Author

I also get

{
    "error": "DepositNotFoundException",
    "message": "Deposit not found given the provided constraints"
}

when bridging from usdc(eth) to usdt(arb) Screenshot 2026-02-05 at 08 43 32 UTC@2x

Is the error here that the deposit actually succeeded?

@gsteenkamp89
Copy link
Contributor Author

I got this error when briding same assets

{
    "type": "AcrossApiError",
    "code": "INVALID_PARAM",
    "status": 400,
    "message": "Query param 'refundOnOrigin' must be 'true' for same-asset bridge swaps.",
    "param": "refundOnOrigin",
    "id": "lrbxq-1770280421988-eea295f2c127"
}
Image

Ah I did not know this was a restriction 🤔

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Copy link
Contributor

0xjorgen commented Feb 6, 2026

Yeah, it feels like this should be handled on the api side. not client-side logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants