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:
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
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:
Expected behavior
The error comes from the method
public static Percentage FromDouble(double dValue)present in src/Solana.Unity.Dex/Math/Percentage.csThis method should return a Percentage value instead of throwing an error.
Screenshots
Desktop (please complete the following information):