TokenLendingProgram.depositReserveLiquidity constructor

TokenLendingProgram.depositReserveLiquidity({
  1. required SolAddress sourceLiquidity,
  2. required SolAddress destinationCollateral,
  3. required SolAddress reserve,
  4. required SolAddress reserveLiquiditySupply,
  5. required SolAddress reserveCollateralMint,
  6. required SolAddress lendingMarket,
  7. required SolAddress lendingMarketAuthority,
  8. required SolAddress transferAuthority,
  9. required TokenLendingDepositReserveLiquidityLayout layout,
})

Deposit liquidity into a reserve in exchange for collateral. Collateral represents a share of the reserve liquidity pool.

Implementation

factory TokenLendingProgram.depositReserveLiquidity(
    {
    /// Source liquidity token account.
    required SolAddress sourceLiquidity,

    /// Destination collateral token account.
    required SolAddress destinationCollateral,

    /// Reserve account.
    required SolAddress reserve,

    /// Reserve liquidity supply SPL Token account
    required SolAddress reserveLiquiditySupply,

    /// Reserve collateral SPL Token mint.
    required SolAddress reserveCollateralMint,

    /// Lending market account.
    required SolAddress lendingMarket,

    /// Derived lending market authority.
    required SolAddress lendingMarketAuthority,

    /// User transfer authority
    required SolAddress transferAuthority,
    required TokenLendingDepositReserveLiquidityLayout layout}) {
  return TokenLendingProgram(keys: [
    sourceLiquidity.toWritable(),
    destinationCollateral.toWritable(),
    reserve.toWritable(),
    reserveLiquiditySupply.toWritable(),
    reserveCollateralMint.toWritable(),
    lendingMarket.toReadOnly(),
    lendingMarketAuthority.toReadOnly(),
    transferAuthority.toSigner(),
    SystemProgramConst.sysvarClockPubkey.toReadOnly(),
    SPLTokenProgramConst.tokenProgramId.toReadOnly(),
  ], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}