TokenLendingProgram.borrowObligationLiquidity constructor
TokenLendingProgram.borrowObligationLiquidity({
- required SolAddress destinationLiquidity,
- required SolAddress sourceLiquidity,
- required SolAddress borrowReserve,
- required SolAddress borrowReserveLiquidityFeeReceiver,
- required SolAddress obligation,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress obligationOwner,
- required TokenLendingBorrowObligationLiquidityLayout layout,
- SolAddress? hostFeeReceiver,
Borrow liquidity from a reserve by depositing collateral tokens. Requires a refreshed obligation and reserve.
Implementation
factory TokenLendingProgram.borrowObligationLiquidity({
/// Destination liquidity token account. Minted by borrow
/// reserve liquidity mint.
required SolAddress destinationLiquidity,
/// Source borrow reserve liquidity supply SPL Token
/// account.
required SolAddress sourceLiquidity,
/// Borrow reserve account
required SolAddress borrowReserve,
/// Borrow reserve liquidity fee receiver account. Must be
/// the fee account specified at InitReserve.
required SolAddress borrowReserveLiquidityFeeReceiver,
/// Obligation account
required SolAddress obligation,
/// Lending market account.
required SolAddress lendingMarket,
/// Derived lending market authority.
required SolAddress lendingMarketAuthority,
/// Obligation owner.
required SolAddress obligationOwner,
required TokenLendingBorrowObligationLiquidityLayout layout,
SolAddress? hostFeeReceiver,
}) {
return TokenLendingProgram(keys: [
sourceLiquidity.toWritable(),
destinationLiquidity.toWritable(),
borrowReserve.toWritable(),
borrowReserveLiquidityFeeReceiver.toWritable(),
obligation.toWritable(),
lendingMarket.toReadOnly(),
lendingMarketAuthority.toReadOnly(),
obligationOwner.toSigner(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
if (hostFeeReceiver != null) hostFeeReceiver.toWritable()
], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}