-
Notifications
You must be signed in to change notification settings - Fork 92
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
priorityLevelWithMaxLamports Improper Documentation #575
Comments
Opened PR #576 |
How were they failing? Can't land on-chain or landed on-chain with the wrong priority fees?
|
All swaps failed with Error 422, showed up like this:
when I removed the following from my code, it worked.
Therefore I kept messing with it, and eventually, I learned if you want to use so yeah, they didn't land on-chain bc the API couldn't accept my requests. |
try again? and check how you are passing in your params? the docs should be correct, you can refer to the video and see the difference with |
Well that's interesting. The following is my old JSON body, in which transactions constantly failed, and when testing on https://station.jup.ag/api-v6/post-swap i got the error JSON.stringify({
// quoteResponse from /quote api
quoteResponse: quoteResponse.data,
// user public key to be used for the swap
userPublicKey: myWallet.publicKey.toString(),
// auto wrap and unwrap SOL. default is true
wrapAndUnwrapSol: true,
//dynamicComputeUnitLimit: true, // allow dynamic compute limit instead of max 1,400,000
dynamicSlippage: {
// This will set an optimized slippage to ensure high success rate
maxBps: 300, // Make sure to set a reasonable cap here to prevent MEV
},
prioritizationFeeLamports: {
priorityLevelWithMaxLamports: {
maxLamports: config.sell.prio_fee_max_lamports,
priorityLevel: config.sell.prio_level,
},
},
}) upon changing the ending to the below, my transactions went through. priorityLevelWithMaxLamports: {
maxLamports: config.swap.prio_fee_max_lamports,
priorityLevel: config.swap.prio_level,
}, but yeah you're right. although the second variant allows the swap quote to be serialized, my fee looks like its 99999 lamports. any idea why it's failing when the first body is used? |
what are you passing in for these params?
|
prio_fee_max_lamports: '500000',
prio_level: 'medium' |
try hardcode the values and see if it works? |
still nothing. |
can you try doing this on https://station.jup.ag/api-v6/post-swap? |
don't use the api doc to test, it is a bit wonky
edit: ah sorry, got confused, everything works fine when im doing it programmatically |
Update: I managed to fix it, and not sure which part fixed it. I hardcoded the parameters, separated the body as a JSON.stringify variable outside of the request, and after some more moving the code around it started working. Not gonna touch it anymore for fear of breaking it lol. |
In
docs/2-apis/11-landing-transactions.md
, usage ofpriorityLevelWithMaxLamports
is incorrect. Found it by testing in API Playground why all my swaps were failing, and realized the docs incorrectly showed how to useprioritizationFeeLamports
. I'll fix this in a fork and open a PR.The text was updated successfully, but these errors were encountered: