TokenLendingProgram class
Instructions supported by the lending program.
- Inheritance
-
- Object
- TransactionInstruction
- TokenLendingProgram
Constructors
-
TokenLendingProgram({required List<
AccountMeta> keys, required SolAddress programId, required ProgramLayout layout}) - 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.
factory
- TokenLendingProgram.depositObligationCollateral({required SolAddress sourceCollateral, required SolAddress destinationCollateral, required SolAddress depositReserve, required SolAddress obligation, required SolAddress lendingMarket, required SolAddress obligationOwner, required SolAddress transferAuthority, required TokenLendingDepositObligationCollateralLayout layout})
-
Deposit collateral to an obligation. Requires a refreshed reserve.
factory
- 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.
factory
- 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.
factory
-
TokenLendingProgram.fromBytes({required List<
AccountMeta> keys, required List<int> instructionBytes, SolAddress programId = TokenLendingProgramConst.lendingProgramId}) -
factory
- TokenLendingProgram.initLendingMarket({required SolAddress lendingMarket, required TokenLendingInitLendingMarketLayout layout})
-
Initializes a new lending market.
factory
- TokenLendingProgram.initObligation({required SolAddress obligation, required SolAddress lendingMarket, required SolAddress obligationOwner})
-
Initializes a new lending market obligation.
factory
- 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.
factory
- 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.
factory
- TokenLendingProgram.redeemReserveCollateral({required SolAddress sourceCollateral, required SolAddress destinationLiquidity, required SolAddress reserve, required SolAddress reserveCollateralMint, required SolAddress reserveLiquiditySupply, required SolAddress lendingMarket, required SolAddress lendingMarketAuthority, required SolAddress transferAuthority, required TokenLendingRedeemReserveCollateralLayout layout})
-
Redeem collateral from a reserve in exchange for liquidity.
factory
-
TokenLendingProgram.refreshObligation({required SolAddress obligation, required List<
SolAddress> depositReserves, required List<SolAddress> borrowReserves}) -
Refresh an obligation's accrued interest and collateral and liquidity
prices. Requires refreshed reserves, as all obligation collateral
deposit reserves in order, followed by all liquidity borrow reserves
in order.
factory
- TokenLendingProgram.refreshReserve({required SolAddress reserve, required SolAddress oracle})
-
Accrue interest and update market price of liquidity on a reserve.
factory
- TokenLendingProgram.repayObligationLiquidity({required SolAddress sourceLiquidity, required SolAddress destinationLiquidity, required SolAddress repayReserve, required SolAddress obligation, required SolAddress lendingMarket, required SolAddress transferAuthority, required TokenLendingRepayObligationLiquidityLayout layout})
-
Repay borrowed liquidity to a reserve. Requires a refreshed obligation
and reserve.
factory
- TokenLendingProgram.setLendingMarketOwner({required SolAddress lendingMarket, required SolAddress currentOwner, required TokenLendingSetLendingMarketOwnerLayout layout})
-
Sets the new owner of a lending market.
factory
- TokenLendingProgram.withdrawObligationCollateral({required SolAddress sourceCollateral, required SolAddress destinationCollateral, required SolAddress withdrawReserve, required SolAddress obligation, required SolAddress lendingMarket, required SolAddress lendingMarketAuthority, required SolAddress obligationOwner, required TokenLendingWithdrawObligationCollateralLayout layout})
-
Withdraw collateral from an obligation. Requires a refreshed obligation
and reserve.
factory
Properties
-
data
→ List<
int> -
Program input.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
keys
→ List<
AccountMeta> -
Public keys to include in this transaction
Boolean represents whether this pubkey needs to sign the transaction
finalinherited
- layout → ProgramLayout
-
Program layout.
finalinherited
- programId → SolAddress
-
Program Id to execute.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited