pub fn issue_shares(ctx: Context<IssueShares>, amount: u64) -> Result<()> {
        let farm_key = {
            let loader: AccountLoader<tulipv2_sdk_vaults::accounts::multi_optimizer::MultiDepositOptimizerV1> = AccountLoader::try_from_unchecked(
                &ctx.accounts.vault_program.key(),
                &ctx.accounts.vault,
            )?;
            {
                let vault = loader.load()?;
                vault.base.farm
            }
        };
        /*
            if this error is returned, it means the depositing_underlying_account
            has less tokens (X) then requested deposit amount (Y)
            Program log: RUNTIME ERROR: a(X) < b(Y)
            Program log: panicked at 'RUNTIME ERROR: a(0) < b(1)', programs/vaults/src/vault_instructions/deposit_tracking/acl_helpers.rs:198:9
        */
        let ix = new_issue_shares_ix(
            ctx.accounts.authority.key(),
            ctx.accounts.vault.key(),
            ctx.accounts.deposit_tracking_account.key(),
            ctx.accounts.deposit_tracking_pda.key(),
            ctx.accounts.vault_pda.key(),
            ctx.accounts.vault_underlying_account.key(),
            ctx.accounts.shares_mint.key(),
            ctx.accounts.receiving_shares_account.key(),
            ctx.accounts.depositing_underlying_account.key(),
            farm_key.into(),
            amount,
        );
        anchor_lang::solana_program::program::invoke(
            &ix,
            &[
                ctx.accounts.authority.clone(),
                ctx.accounts.vault.clone(),
                ctx.accounts.deposit_tracking_account.clone(),
                ctx.accounts.deposit_tracking_pda.clone(),
                ctx.accounts.vault_pda.clone(),
                ctx.accounts.vault_underlying_account.to_account_info(),
                ctx.accounts.shares_mint.to_account_info(),
                ctx.accounts.receiving_shares_account.to_account_info(),
                ctx.accounts.depositing_underlying_account.to_account_info(),
            ],
        )?;
        Ok(())
    }
/// deposits `amount` of the underlying tokens in exchange for a corresponding
/// amount of shares. these shares are locked within the deposit tracking account
/// for 15 minutes, after which they can be removed from the deposit tracking account
/// if desired. generaly speaking this should only be done if you want to
/// use the tokenized shares elsewhere (ie friktion volts), otherwise
/// its best to leave them within the deposit tracking account otherwise
/// so that you can measure your accrued rewards automatically.
deposits `amount` of the underlying tokens in exchange for a corresponding
amount of shares. these shares are locked within the deposit tracking account
for 15 minutes, after which they can be removed from the deposit tracking account
if desired. generaly speaking this should only be done if you want to
use the tokenized shares elsewhere , otherwise
its best to leave them within the deposit tracking account otherwise
so that you can measure your accrued rewards automatically.
deposits ` amount ` of the underlying tokens in exchange for a corresponding amount of shares . these shares are locked within the deposit tracking account for 15 minutes after which they can be removed from the deposit tracking account if desired . generaly speaking this should only be done if you want to use the tokenized shares elsewhere otherwise its best to leave them within the deposit tracking account otherwise so that you can measure your accrued rewards automatically .
pub fn issue_shares(ctx: Context<IssueShares>, amount: u64) -> Result<()> {
        let farm_key = {
            let loader: AccountLoader<tulipv2_sdk_vaults::accounts::multi_optimizer::MultiDepositOptimizerV1> = AccountLoader::try_from_unchecked(
                &ctx.accounts.vault_program.key(),
                &ctx.accounts.vault,
            )?;
            {
                let vault = loader.load()?;
                vault.base.farm
            }
        };
        /*
            if this error is returned, it means the depositing_underlying_account
            has less tokens (X) then requested deposit amount (Y)
            Program log: RUNTIME ERROR: a(X) < b(Y)
            Program log: panicked at 'RUNTIME ERROR: a(0) < b(1)', programs/vaults/src/vault_instructions/deposit_tracking/acl_helpers.rs:198:9
        */
        let ix = new_issue_shares_ix(
            ctx.accounts.authority.key(),
            ctx.accounts.vault.key(),
            ctx.accounts.deposit_tracking_account.key(),
            ctx.accounts.deposit_tracking_pda.key(),
            ctx.accounts.vault_pda.key(),
            ctx.accounts.vault_underlying_account.key(),
            ctx.accounts.shares_mint.key(),
            ctx.accounts.receiving_shares_account.key(),
            ctx.accounts.depositing_underlying_account.key(),
            farm_key.into(),
            amount,
        );
        anchor_lang::solana_program::program::invoke(
            &ix,
            &[
                ctx.accounts.authority.clone(),
                ctx.accounts.vault.clone(),
                ctx.accounts.deposit_tracking_account.clone(),
                ctx.accounts.deposit_tracking_pda.clone(),
                ctx.accounts.vault_pda.clone(),
                ctx.accounts.vault_underlying_account.to_account_info(),
                ctx.accounts.shares_mint.to_account_info(),
                ctx.accounts.receiving_shares_account.to_account_info(),
                ctx.accounts.depositing_underlying_account.to_account_info(),
            ],
        )?;
        Ok(())
    }
pub fn issue_shares ( ctx : Context < IssueShares > , amount : u64 ) -> Result < ( ) > { let farm_key = { let loader : AccountLoader < tulipv2_sdk_vaults :: accounts :: multi_optimizer :: MultiDepositOptimizerV1 > = AccountLoader :: try_from_unchecked ( & ctx . accounts . vault_program . key ( ) , & ctx . accounts . vault , ) ? ; { let vault = loader . load ( ) ? ; vault . base . farm } } ; /*
            if this error is returned, it means the depositing_underlying_account
            has less tokens (X) then requested deposit amount (Y)
            Program log: RUNTIME ERROR: a(X) < b(Y)
            Program log: panicked at 'RUNTIME ERROR: a(0) < b(1)', programs/vaults/src/vault_instructions/deposit_tracking/acl_helpers.rs:198:9
        */ let ix = new_issue_shares_ix ( ctx . accounts . authority . key ( ) , ctx . accounts . vault . key ( ) , ctx . accounts . deposit_tracking_account . key ( ) , ctx . accounts . deposit_tracking_pda . key ( ) , ctx . accounts . vault_pda . key ( ) , ctx . accounts . vault_underlying_account . key ( ) , ctx . accounts . shares_mint . key ( ) , ctx . accounts . receiving_shares_account . key ( ) , ctx . accounts . depositing_underlying_account . key ( ) , farm_key . into ( ) , amount , ) ; anchor_lang :: solana_program :: program :: invoke ( & ix , & [ ctx . accounts . authority . clone ( ) , ctx . accounts . vault . clone ( ) , ctx . accounts . deposit_tracking_account . clone ( ) , ctx . accounts . deposit_tracking_pda . clone ( ) , ctx . accounts . vault_pda . clone ( ) , ctx . accounts . vault_underlying_account . to_account_info ( ) , ctx . accounts . shares_mint . to_account_info ( ) , ctx . accounts . receiving_shares_account . to_account_info ( ) , ctx . accounts . depositing_underlying_account . to_account_info ( ) , ] , ) ? ; Ok ( ( ) ) }
deposits `amount` of the underlying tokens in exchange for a corresponding
amount of shares.
deposits ` amount ` of the underlying tokens in exchange for a corresponding amount of shares .
ctx
Context<IssueShares>
amount
u64
ctx
Context<IssueShares>
amount
u64