jup-ag / jupiter-swap-api

The jupiter swap api binary
72 stars 20 forks source link

V6 Swap API gives failed transactions while jup.ag based swap completes with no problem #12

Closed DanielMS93 closed 1 month ago

DanielMS93 commented 7 months ago

I am using the swap api to execute swap trades on solana tokens.

Most of the time the swap api works well, however way too often the transaction fails. The suspected culprit for this is slippage but I have increased slippage to over 30% and the transaction still fails. Then, when I execute the same transaction through the UI it completes with 0.5% slippage.

Please can anyone help me understand what is going on here? Is the API itself unstable? Is are something I am missing or doing wrong?

Also, is there a way to get more detail on the failed tx and the reason, maybe a traceback or something?

{'quoteResponse': {'inputMint': '3ag1Mj9AKz9FAkCQ6gAEhpLSX8B2pUbPdkb9iBsDLZNB', 'inAmount': '1110252197432', 'outputMint': 'So11111111111111111111111111111111111111112', 'outAmount': '48617665', 'otherAmountThreshold': '43755899', 'swapMode': 'ExactIn', 'slippageBps': 1000, 'platformFee': None, 'priceImpactPct': '0.007981763744257982803141058', 'routePlan': [{'swapInfo': {'ammKey': 'BZivKpJWgQvrA3yYe3ubomufeGVouoYoUhosmBEdqF9y', 'label': 'Raydium', 'inputMint': '3ag1Mj9AKz9FAkCQ6gAEhpLSX8B2pUbPdkb9iBsDLZNB', 'outputMint': 'So11111111111111111111111111111111111111112', 'inAmount': '1107476549121', 'outAmount': '48617665', 'feeAmount': '2775630493', 'feeMint': '3ag1Mj9AKz9FAkCQ6gAEhpLSX8B2pUbPdkb9iBsDLZNB'}, 'percent': 100}], 'contextSlot': 245664909, 'timeTaken': 0.086242568}, 'userPublicKey': '', 'wrapAndUnwrapSol': True, 'prioritizationFeeLamports': {'autoMultiplier': 1}}

siong1987 commented 1 month ago

the API is the same as the UI. shouldn't be any problems here.