1

I'm aware of this question How to interact with router for swap transaction?

but mine is different.

How to swap a token for SOL or vise versa from within a Solana program/smart contract? That is, on-chain. How to interract with a router of either Raydium or SolDex? I haven't found any example of this.

1 Answer 1

0

Here you'll find demo implementation of Raydium routing engine. To interact directly with the routing program, you'll just need to make up your functions and plug your rpc + private key in the config files. More details in the README.md.

The new bi-directional routing engine - available on the beta - should get open-sourced very soon.

Link to Raydium SDK: https://github.com/raydium-io/raydium-sdk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.