TokenLendingProgram.initReserve constructor
TokenLendingProgram.initReserve({
- required SolAddress sourceLiquidity,
- required SolAddress destinationCollateral,
- required SolAddress reserve,
- required SolAddress liquidityMint,
- required SolAddress liquiditySupply,
- required SolAddress liquidityFeeReceiver,
- required SolAddress pythProduct,
- required SolAddress pythPrice,
- required SolAddress collateralMint,
- required SolAddress collateralSupply,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress lendingMarketOwner,
- required SolAddress transferAuthority,
- 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);
}