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

Display minimum tradeable token quantity and disable swap button if too small #44

Open
secretshardul opened this issue Jun 12, 2021 · 3 comments

Comments

@secretshardul
Copy link
Contributor

Unable to swap USDC for KIN. Users reported issues with some other pairs as well.

I created a KIN SPL account beforehand, but it still fails.

  1. From browser console:
Transaction simulation failed: Error processing Instruction 1: custom program error: 0x66 
    Program 11111111111111111111111111111111 invoke [1]
    Program 11111111111111111111111111111111 success
    Program 22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD invoke [1]
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin invoke [2]
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
    Program log: Instruction: Transfer
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3402 of 162985 compute units
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin consumed 17384 of 173542 compute units
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin success
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin invoke [2]
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
    Program log: Instruction: Transfer
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3402 of 136362 compute units
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]
    Program log: Instruction: Transfer
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3402 of 130123 compute units
    Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin consumed 19451 of 145281 compute units
    Program 9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin success
    Program log: 4ZfIrPLY4R4QJwAAAAAAAIdJYQsAAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADG+nrzvtutOj1l82qryXQxsbvkwtL24OR8pgIDRS9dYQszOKCrLMhB1bAUvGo891YpGHSzGclRfZu/qeTpZh75xvp6877brTo9ZfNqq8l0MbG75MLS9uDkfKYCA0UvXWFL+Ym56BXUNmJn50I5czFKmd7/+oJBhPsNNSUASy49Dg==
    Program log: Custom program error: 0x66
    Program 22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD consumed 85188 of 200000 compute units
    Program 22Y43yTVxuUkoRKdm9thyRhQ3SdgQS7c7kB6UNCiaczD failed: custom program error: 0x66
  1. A 'custom program error 0x66' notification is also displayed.

image

  1. The transaction doesn't show up on Solana explorer
@armaniferrante
Copy link
Contributor

0x66 is the zero swap error, meaning the size of the trade was probably too low. See https://github.com/project-serum/swap/blob/master/programs/swap/src/lib.rs#L723.

Did you try swapping for more?

@secretshardul
Copy link
Contributor Author

0x66 is the zero swap error, meaning the size of the trade was probably too low. See https://github.com/project-serum/swap/blob/master/programs/swap/src/lib.rs#L723.

Did you try swapping for more?

Resolved, token quantity was the issue. Consider this a feature request, that minimum required amounts should be displayed.

@armaniferrante
Copy link
Contributor

Additionally, we should disable the swap button if the token quantity is too small.

@armaniferrante armaniferrante changed the title Swaps fail for some pairs Display minimum tradeable token quantity and disable swap button if too small Jun 12, 2021
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

No branches or pull requests

2 participants