-
Notifications
You must be signed in to change notification settings - Fork 42
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
circular arbitrage issue #76
Comments
@osmangokc took abit of digging, but the answer I've derived is not what you wanted. The quotes will give you a blank path, what you need to do is create 2 separate quote (for example SOL => USDC, and USDC => SOL), concat the route plans together and pass it to /swap or /swap-instructions endpoint. |
hi, i have an issue like this after create 2 separate quote (for example SOL => USDC, and USDC => SOL), concat the route plans together and pass it to /swap-instructions endpoint. Got a lil bit stuck here, can you give me an explaination in detail ? I appreciate your help
|
@EsperanzaBunny You will also need to copy the input props to your final quote, here is a sample code: q2.routePlan = q1.routePlan.concat(q2.routePlan);
q2.inAmount = q1.inAmount;
q2.inputMint = q1.inputMint; Then submit *note that you will need to set Hope this all helps, and good luck! |
@shirotech hi bro, finally i can combine both quotes & submit transaction. Thank you so much for your time and effort. It really made a difference! But i wonder, do you use or have experience in using self-host jup ag with --allow-circular-arbitrage flag ? I think this is the way to shorten the getQuote process right ( only 1 fetch instead of 2 ) |
how does this allow circular arbitrage mode work. should i enter wsol mint for both input and output mint?
The text was updated successfully, but these errors were encountered: