TokenLendingProgram.depositReserveLiquidity constructor
TokenLendingProgram.depositReserveLiquidity({
- required SolAddress sourceLiquidity,
- required SolAddress destinationCollateral,
- required SolAddress reserve,
- required SolAddress reserveLiquiditySupply,
- required SolAddress reserveCollateralMint,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress transferAuthority,
- 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);
}