2

I have initialized a fund on the devnet according to the spl example fund https://github.com/solana-labs/solana-program-library/blob/master/farms/docs/fund.md

However, after checking their rust client and cli client I have no idea how to deposit into the fund to receive a LP token in exchange. The docs seem to have been out of date for many instructions so I assume the example fund doesn't get a lot of attention.

1 Answer 1

1

You can deposit into a Fund with CLI tools, Rust, or Http clients using request-deposit-fund instruction. For it to work, though, as per docs, you need to have your Fund properly initialized. You start with fund-init command and then configure the Fund with fund-set-assets-tracking-config, fund-set-deposit-schedule, and fund-set-withdrawal-schedule. After that, you need to create token custodies for each token your Fund will manage with fund-add-custody. If everything is done correctly, request-deposit-fund instruction will succeed. Note that if approval_required is set to true in fund-set-deposit-schedule, then request-deposit-fund will just record the user's intent to make a deposit to the Fund and manual Fund Manager's approval (fund-approve-deposit) will be required to move funds into the Fund. Also, upon successful deposit, Funds arrive at an intermediate Deposit/Withdraw custody and can be moved into Trading custody with fund-lock-assets.

Fund roll-out is a rather complex task and unfortunately I can't give you detailed steps to execute without knowing the context. So, let me know if you have any specific questions about the Fund initialization, usage, or unclear parts of the code if you are building your own thing.

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.