-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Swap quote with ORCA dex is not working properly.
When using the method GetSwapQuote(...), an error with message "Conversion not possible" appears.
This is preventing swaps to work properly with ORCA.
To Reproduce
There are 2 ways to reproduce:
- Simple approach: Go to https://magicblock-labs.github.io/Solana.Unity-SDK/ and try to do a swap
- Technical approach: Write the code below and try to do a swap
try {
TokenData tokenA = await dex.GetTokenByMint("So11111111111111111111111111111111111111112");
TokenData tokenB = await dex.GetTokenByMint("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
SwapQuote _swapQuote = await dex.GetSwapQuote(
tokenA.MintAddress,
tokenB.MintAddress,
DecimalUtil.ToUlong(amountInSol, tokenA.Decimals)
);
}
catch (Exception ex)
{
Debug.LogError(JsonConvert.SerializeObject(ex));
}Expected behavior
The error comes from the method public static Percentage FromDouble(double dValue) present in src/Solana.Unity.Dex/Math/Percentage.cs
This method should return a Percentage value instead of throwing an error.
Screenshots
Desktop (please complete the following information):
- OS: Linux Ubuntu 25.04
- Unity version: 6000.0.65f1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working