StakePoolProgram.depositSol constructor

StakePoolProgram.depositSol({
  1. required SolAddress stakePool,
  2. required SolAddress withdrawAuthority,
  3. required SolAddress reserveStake,
  4. required SolAddress fundingAccount,
  5. required SolAddress destinationPoolAccount,
  6. required SolAddress managerFeeAccount,
  7. required SolAddress referralPoolAccount,
  8. required SolAddress poolMint,
  9. required StakePoolDepositSolLayout layout,
  10. SolAddress? depositAuthority,
})

Deposit SOL directly into the pool's reserve account. The output is a "pool" token representing ownership into the pool. Inputs are converted to the current ratio.

Implementation

factory StakePoolProgram.depositSol({
  /// Stake pool
  required SolAddress stakePool,

  /// Stake pool withdraw authority
  required SolAddress withdrawAuthority,

  /// Reserve stake account, to deposit SOL
  required SolAddress reserveStake,

  /// Account providing the lamports to be deposited into the pool
  required SolAddress fundingAccount,

  /// User account to receive pool tokens
  required SolAddress destinationPoolAccount,

  /// Account to receive fee tokens
  required SolAddress managerFeeAccount,

  /// Account to receive a portion of fee as referral fees
  required SolAddress referralPoolAccount,

  /// Pool token mint account
  required SolAddress poolMint,
  required StakePoolDepositSolLayout layout,

  /// Stake pool sol deposit authority.
  SolAddress? depositAuthority,
}) {
  return StakePoolProgram(
      layout: layout,
      keys: [
        stakePool.toWritable(),
        withdrawAuthority.toReadOnly(),
        reserveStake.toWritable(),
        fundingAccount.toSignerAndWritable(),
        destinationPoolAccount.toWritable(),
        managerFeeAccount.toWritable(),
        referralPoolAccount.toWritable(),
        poolMint.toWritable(),
        SystemProgramConst.programId.toReadOnly(),
        SPLTokenProgramConst.tokenProgramId.toReadOnly(),
        if (depositAuthority != null) depositAuthority.toSigner(),
      ],
      programId: StakePoolProgramConst.programId);
}