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

Jupiter - decode "SlippageToleranceExceeded" errors #8303

Open
gomesalexandre opened this issue Dec 6, 2024 · 1 comment · May be fixed by #8433
Open

Jupiter - decode "SlippageToleranceExceeded" errors #8303

gomesalexandre opened this issue Dec 6, 2024 · 1 comment · May be fixed by #8433
Assignees
Labels
bug Something isn't working

Comments

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Dec 6, 2024

Overview

Currently at broadcast time, Jupiter swaps sometimes fail at SlippageToleranceExceeded, i.e these will show up as "Reverted during execution, Slippage Tolerance Exceeded in Phantom", but those can be sent still, however, /api/v1/send will error with 400 and return

{
    "message": "Simulation failed. \nMessage: Transaction simulation failed: Error processing Instruction 3: custom program error: 0x1771. \nLogs: \n[\n  \"Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo consumed 63802 of 130355 compute units\",\n  \"Program LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo success\",\n  \"Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [2]\",\n  \"Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 471 of 64108 compute units\",\n  \"Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success\",\n  \"Program log: AnchorError thrown in programs/jupiter/src/lib.rs:346. Error Code: SlippageToleranceExceeded. Error Number: 6001. Error Message: Slippage tolerance exceeded.\",\n  \"Program log: Left: 155127\",\n  \"Program log: Right: 156589\",\n  \"Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 133535 of 191015 compute units\",\n  \"Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 failed: custom program error: 0x1771\"\n]. \nCatch the `SendTransactionError` and call `getLogs()` on it for full details."
}

We do not parse these errors and display them as raw JSON in the UI, both in swapper error field as well as in the toast

image

This PR is to make things more human-readable by decoding this.

References and additional details

N/A

Acceptance Criteria

  • SlippageToleranceExceeded errors are captured and decoded in a human-readable way, reflected both in swapper as ("Slippage Tolerance Exceeded") and in the toast

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

No response

@NeOMakinG NeOMakinG moved this from Backlog to In progress in ShapeShift Dashboard Dec 16, 2024
@NeOMakinG NeOMakinG self-assigned this Dec 16, 2024
@NeOMakinG NeOMakinG moved this from In progress to Up next / groomed in ShapeShift Dashboard Dec 17, 2024
@0xean 0xean added the bug Something isn't working label Dec 18, 2024
@0xean 0xean moved this from Up next / groomed to In progress in ShapeShift Dashboard Dec 18, 2024
@NeOMakinG
Copy link
Collaborator

For note purposes, as I did spike it a little bit:

  • Those solana errors happens at simulation time, so the handler is inside useTradeExecution and is not the responsibility of the swapper anymore (onFail handler)

We might need to introduce an error interceptor inside onFail to humanize those errors, to be continued

@NeOMakinG NeOMakinG linked a pull request Dec 20, 2024 that will close this issue
1 task
@NeOMakinG NeOMakinG moved this from In progress to In review in ShapeShift Dashboard Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In review
Development

Successfully merging a pull request may close this issue.

3 participants