TokenLendingProgram.initReserve constructor

TokenLendingProgram.initReserve({
  1. required SolAddress sourceLiquidity,
  2. required SolAddress destinationCollateral,
  3. required SolAddress reserve,
  4. required SolAddress liquidityMint,
  5. required SolAddress liquiditySupply,
  6. required SolAddress liquidityFeeReceiver,
  7. required SolAddress pythProduct,
  8. required SolAddress pythPrice,
  9. required SolAddress collateralMint,
  10. required SolAddress collateralSupply,
  11. required SolAddress lendingMarket,
  12. required SolAddress lendingMarketAuthority,
  13. required SolAddress lendingMarketOwner,
  14. required SolAddress transferAuthority,
  15. required TokenLendingInitReserveLayout layout,
})

Initializes a new lending market reserve.

Implementation

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

    /// Destination collateral token account
    required SolAddress destinationCollateral,

    /// Reserve liquidity SPL Token mint.
    required SolAddress reserve,

    /// Reserve liquidity SPL Token mint.
    required SolAddress liquidityMint,

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

    /// Reserve liquidity fee receiver
    required SolAddress liquidityFeeReceiver,

    /// Pyth product account.
    required SolAddress pythProduct,

    /// Pyth price account.
    required SolAddress pythPrice,

    /// Reserve collateral SPL Token mint
    required SolAddress collateralMint,

    /// Reserve collateral token supply
    required SolAddress collateralSupply,

    /// Lending market account.
    required SolAddress lendingMarket,

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

    /// Lending market owner.
    required SolAddress lendingMarketOwner,

    /// User transfer authority
    required SolAddress transferAuthority,
    required TokenLendingInitReserveLayout layout}) {
  return TokenLendingProgram(keys: [
    sourceLiquidity.toWritable(),
    destinationCollateral.toWritable(),
    reserve.toWritable(),
    liquidityMint.toReadOnly(),
    liquiditySupply.toWritable(),
    liquidityFeeReceiver.toWritable(),
    collateralMint.toWritable(),
    collateralSupply.toWritable(),
    pythProduct.toReadOnly(),
    pythPrice.toReadOnly(),
    lendingMarket.toWritable(),
    lendingMarketAuthority.toReadOnly(),
    transferAuthority.toSigner(),
    SystemProgramConst.sysvarClockPubkey.toReadOnly(),
    SystemProgramConst.sysvarRentPubkey.toReadOnly(),
    SPLTokenProgramConst.tokenProgramId.toReadOnly(),
  ], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}