Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(@desktop/wallet): handle Paraswap price impact error #15875

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Jul 29, 2024

Fixes #15542

What does the PR do

Handle "Price Impact Too High" error. Swap platforms return this when the requested swap will make the price of the token change more than X% (that means the swap is large compared to the available liquidity. https://help.crypto.com/en/articles/7891394-what-is-price-impact)

image
https://www.figma.com/design/TS0eQX9dAZXqZtELiwKIoK/Swap---Milestone-1?node-id=6012-83789&t=X4WCo5OrN3M9B2Se-0

@status-im-auto
Copy link
Member

status-im-auto commented Jul 29, 2024

Jenkins Builds

Click to see older builds (14)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 797ef44 #1 2024-07-29 21:21:58 ~6 min macos/aarch64 🍎dmg
✔️ 797ef44 #1 2024-07-29 21:22:30 ~7 min tests/nim 📄log
797ef44 #1 2024-07-29 21:29:17 ~13 min tests/ui 📄log
✔️ 797ef44 #1 2024-07-29 21:31:03 ~15 min linux-nix/x86_64 📦tgz
✔️ 797ef44 #1 2024-07-29 21:33:46 ~18 min linux/x86_64 📦tgz
✔️ 797ef44 #1 2024-07-29 21:38:43 ~23 min macos/x86_64 🍎dmg
✔️ 797ef44 #1 2024-07-29 21:47:06 ~31 min windows/x86_64 💿exe
✔️ 6ede5ef #2 2024-08-07 20:30:51 ~5 min macos/aarch64 🍎dmg
✔️ 6ede5ef #2 2024-08-07 20:32:30 ~6 min tests/nim 📄log
✔️ 6ede5ef #2 2024-08-07 20:34:43 ~8 min macos/x86_64 🍎dmg
6ede5ef #2 2024-08-07 20:39:39 ~13 min tests/ui 📄log
✔️ 6ede5ef #2 2024-08-07 20:40:41 ~15 min linux-nix/x86_64 📦tgz
✔️ 6ede5ef #2 2024-08-07 20:41:16 ~15 min linux/x86_64 📦tgz
✔️ 6ede5ef #2 2024-08-07 20:56:49 ~31 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ de96e94 #3 2024-08-08 00:00:59 ~4 min macos/aarch64 🍎dmg
✔️ de96e94 #3 2024-08-08 00:03:04 ~6 min tests/nim 📄log
✔️ de96e94 #3 2024-08-08 00:03:55 ~7 min macos/x86_64 🍎dmg
de96e94 #3 2024-08-08 00:08:56 ~12 min tests/ui 📄log
✔️ de96e94 #3 2024-08-08 00:12:13 ~15 min linux/x86_64 📦tgz
✔️ de96e94 #3 2024-08-08 00:12:48 ~16 min linux-nix/x86_64 📦tgz
✔️ de96e94 #3 2024-08-08 00:28:12 ~31 min windows/x86_64 💿exe
de96e94 #4 2024-08-08 01:19:40 ~12 min tests/ui 📄log
✔️ 58e356c #4 2024-08-08 01:27:47 ~4 min macos/aarch64 🍎dmg
✔️ 58e356c #4 2024-08-08 01:30:10 ~6 min tests/nim 📄log
✔️ 58e356c #4 2024-08-08 01:30:57 ~7 min macos/x86_64 🍎dmg
✔️ 58e356c #4 2024-08-08 01:36:07 ~12 min linux-nix/x86_64 📦tgz
58e356c #5 2024-08-08 01:36:27 ~12 min tests/ui 📄log
✔️ 58e356c #4 2024-08-08 01:39:30 ~15 min linux/x86_64 📦tgz
✔️ 58e356c #6 2024-08-08 01:50:00 ~12 min tests/ui 📄log
✔️ 58e356c #4 2024-08-08 01:52:36 ~28 min windows/x86_64 💿exe

@@ -1428,11 +1429,13 @@ QtObject {
readonly property string paraswapSwapContractAddress: "0xDEF171Fe48CF0115B1d80b88dc8eAB59176FEe57"
readonly property string termsAndConditionParaswapUrl: "https://files.paraswap.io/tos_v4.pdf"

// TOOD #15874: Unify with WalletUtils router error code handling
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@Khushboo-dev-cpp Khushboo-dev-cpp left a comment

Choose a reason for hiding this comment

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

LGTM! Perhaps we want to add a UT for this?

@dlipicar dlipicar force-pushed the feat/handle-paraswap-price-impact-error branch from 797ef44 to 6ede5ef Compare August 7, 2024 20:25
@status-im-auto
Copy link
Member

@dlipicar dlipicar force-pushed the feat/handle-paraswap-price-impact-error branch from 6ede5ef to de96e94 Compare August 7, 2024 23:56
@dlipicar dlipicar force-pushed the feat/handle-paraswap-price-impact-error branch from de96e94 to 58e356c Compare August 8, 2024 01:23
@dlipicar dlipicar merged commit c0e5111 into master Aug 8, 2024
9 checks passed
@dlipicar dlipicar deleted the feat/handle-paraswap-price-impact-error branch August 8, 2024 02:14
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.

Swap - Cannot get a quote for the pair USDT - SNT and error message displays
5 participants