Skip to content

How to make a simple swap on devnet? #145

@tabatinga0xffff

Description

@tabatinga0xffff

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions