TokenLendingProgram.liquidateObligation constructor
TokenLendingProgram.liquidateObligation({
- required SolAddress sourceLiquidity,
- required SolAddress destinationCollateral,
- required SolAddress repayReserve,
- required SolAddress repayReserveLiquiditySupply,
- required SolAddress withdrawReserve,
- required SolAddress withdrawReserveCollateralSupply,
- required SolAddress obligation,
- required SolAddress lendingMarket,
- required SolAddress lendingMarketAuthority,
- required SolAddress transferAuthority,
- required TokenLendingLiquidateObligationLayout layout,
Repay borrowed liquidity to a reserve to receive collateral at a discount from an unhealthy obligation. Requires a refreshed obligation and reserves.
Implementation
factory TokenLendingProgram.liquidateObligation(
{
/// Source liquidity token account. Minted by repay
/// reserve liquidity mint.
required SolAddress sourceLiquidity,
/// Destination collateral token account.
required SolAddress destinationCollateral,
/// Repay reserve account
required SolAddress repayReserve,
/// Repay reserve liquidity supply SPL Token account.
required SolAddress repayReserveLiquiditySupply,
/// Withdraw reserve account
required SolAddress withdrawReserve,
/// Withdraw reserve collateral supply SPL Token account.
required SolAddress withdrawReserveCollateralSupply,
/// Obligation account
required SolAddress obligation,
/// Lending market account.
required SolAddress lendingMarket,
/// Derived lending market authority.
required SolAddress lendingMarketAuthority,
/// User transfer authority
required SolAddress transferAuthority,
required TokenLendingLiquidateObligationLayout layout}) {
return TokenLendingProgram(keys: [
sourceLiquidity.toWritable(),
destinationCollateral.toWritable(),
repayReserve.toWritable(),
repayReserveLiquiditySupply.toWritable(),
withdrawReserve.toReadOnly(),
withdrawReserveCollateralSupply.toWritable(),
obligation.toWritable(),
lendingMarket.toReadOnly(),
lendingMarketAuthority.toReadOnly(),
transferAuthority.toSigner(),
SystemProgramConst.sysvarClockPubkey.toReadOnly(),
SPLTokenProgramConst.tokenProgramId.toReadOnly(),
], programId: TokenLendingProgramConst.lendingProgramId, layout: layout);
}