2

I have developed a presale smart contract using Anchor, and it is currently functional. Now, I am exploring ways to transition to a public sale on decentralized exchanges (DEX) like Raydium after completing the presale. However, I am facing challenges in finding the appropriate steps to achieve this. I hope the community can provide assistance. Thank you.

2
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Jan 15 at 7:16
  • Waiting for the reply too, there is too much parameters to pass I need clarity on how and where to find them
    – David
    Commented Jan 16 at 19:25

3 Answers 3

2

You can use the deposit instruction by calling this function from raydium-io's raydium-contract-instructions package.

Here is is an example of a program that interacts with the raydium program. Although it calls a different instruction from what you want, you can use it as a reference point.

2
  • thank you for your reply. But there are still some difficulties to understand deposit function. I have to call deposit function from my program directly with CPI and relevant accounts ? How deposit function works exactly? Hope you to explain in more detail. Thank you.
    – Bheem Coin
    Commented Jan 15 at 7:58
  • Could you provide some docs or code snippet to understand this process?
    – Bheem Coin
    Commented Jan 15 at 8:00
0

There are demo functions for adding liquidity to CPMM and CLMM pool in the demo-sdk.

https://github.com/raydium-io/raydium-sdk-V1-demo/blob/master/src/ammAddLiquidity.ts https://github.com/raydium-io/raydium-sdk-V1-demo/blob/master/src/clmmCreatePosition.ts

To run these functions you'll need to set your keys and rpc in the config files.

A simple edit of the above should be suffisant to perform the action describe above.

Give a look at the README.md

/ withdraw functions are also available in the demo-sdk

1
  • I already checked all related documentation, but couldn`t find the suitable answer.
    – Bheem Coin
    Commented Mar 29 at 14:20
0

This is good practice. https://github.com/raydium-io/amm_anchor/blob/master/tests/amm-proxy/programs/amm-proxy/src/instructions/deposit.rs

I've tested and working correctly!

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.