How to swap SOL <-> token / vise versa but on-chain (in a smart contract)? On Raydium or SolDex
How to swap SOL <-> token / vise versa but on-chain (in a smart contract)? On Raydium or SolDex
Loading saved threads...
barugaggi · External communityPost link
External question — Solana Stack Exchange
Author: barugaggi
Original post: https://solana.stackexchange.com/questions/10018
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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.
Quote
Report
Stendhal · External communityPost link
External answer — Solana Stack Exchange
Author: Stendhal
Original post: https://solana.stackexchange.com/a/12347
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
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
Quote
Report
0xp3p3x0 · External communityPost link
External answer — Solana Stack Exchange
Author: 0xp3p3x0
Original post: https://solana.stackexchange.com/a/23176
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
https://github.com/0xcrust/raydium-swap
plz read this,It might help you.
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Solana Stack Exchange Author: 0xp3p3x0 Source score (net votes, not local likes): 0 Original post: https://solana.stackexchange.com/a/23176 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. https://github.com/0xcrust/raydium-swap plz read this,It might help you.
Checking account access…