TokenLendingProgram.flashLoan constructor
TokenLendingProgram.flashLoan({
- required SolAddress sourceLiquidity,
- required SolAddress destinationLiquidity,
- required SolAddress liquidityReserve,
- required SolAddress flashLoanFeeReceiver,
- required SolAddress hostFeeReceiver,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress flashLoanProgram,
- required SolAddress transferAuthority,
- required TokenLendingFlashLoanLayout layout,
Make a flash loan.
Implementation
factory TokenLendingProgram.flashLoan(
{
/// Source liquidity token account.
required SolAddress sourceLiquidity,
/// Destination liquidity token account
required SolAddress destinationLiquidity,
/// Reserve account.
required SolAddress liquidityReserve,
/// Flash loan fee receiver account.
required SolAddress flashLoanFeeReceiver,
/// Host fee receiver.
required SolAddress hostFeeReceiver,
/// Lending market account.
required SolAddress lendingMarket,
/// Derived lending market authority.
required SolAddress lendingMarketAuthority,
/// Flash loan receiver program id.
required SolAddress flashLoanProgram,
required SolAddress transferAuthority,
required TokenLendingFlashLoanLayout layout}) {
return TokenLendingProgram(keys: [
sourceLiquidity.toWritable(),
destinationLiquidity.toWritable(),
liquidityReserve.toWritable(),
flashLoanFeeReceiver.toWritable(),
hostFeeReceiver.toWritable(),
lendingMarket.toReadOnly(),
lendingMarketAuthority.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
flashLoanProgram.toReadOnly(),
transferAuthority.toSigner()
], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}