Skip to content
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

How to make a simple swap on devnet? #145

Open
tabatinga0xffff opened this issue Mar 21, 2024 · 1 comment
Open

How to make a simple swap on devnet? #145

tabatinga0xffff opened this issue Mar 21, 2024 · 1 comment

Comments

@tabatinga0xffff
Copy link

tabatinga0xffff commented Mar 21, 2024

On devnet

I need to make a simple swap operation and as one time operation, as a test.

I need it in the form of 3 types: SOL -> token, token -> SOL, token -> token

Initially I have 10 SOL on my dev account. I've tried to eliminate all the stuff from that I may not need from jupiterSpotSwap(....) and then call this function in the end of init(...). I specified subAccountIndex = 0 and marketIndex = 0 too.

It's not worked. But there'll be some or other error at runtime still, for instance:

error: Error trying to long spot position for market 0 on jupiter, subaccount start 0

How will I make a simple swap then? Is there any simple example?

And what preliminary work have I make for this: open a position, set up something.... ? And how?

@wphan
Copy link
Member

wphan commented Mar 21, 2024

there is no jupiter on devnet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants