Options
All
  • Public
  • Public/Protected
  • All
Menu

@solendprotocol/solend-sdk

Index

Type aliases

ActionType

ActionType: "deposit" | "borrow" | "withdraw" | "repay" | "mint" | "redeem" | "depositCollateral"

ClaimType

ClaimType: { distributorPublicKey: string; incentivizer: string; index: number; lotNumber: number; name: string; obligationID: string; optionMarketKey: string; proof: string[]; quantity: string; root: string }

Type declaration

  • distributorPublicKey: string
  • incentivizer: string
  • index: number
  • lotNumber: number
  • name: string
  • obligationID: string
  • optionMarketKey: string
  • proof: string[]
  • quantity: string
  • root: string

ConfigType

ConfigType: MarketConfigType[]

EnrichedClaimType

EnrichedClaimType: { claimId: PublicKey; claimStatusBump: number; claimable: boolean; claimedAt: number | null; distributor: { bump: number; mint: PublicKey }; distributorATAPublicKey: PublicKey; mintAddress: string; optionMarket: (OptionMarketWithKey & { userBalance: number }) | null; quantity: string } & ClaimType

ExternalRewardStatType

ExternalRewardStatType: RewardStatType & { reserveID: string; rewardMint: string; rewardSymbol: string; side: "supply" | "borrow" }

MarketConfigType

MarketConfigType: { address: string; authorityAddress: string; creator: string; description: string; hidden: boolean; isPrimary: boolean; name: string; reserves: ReserveConfigType[] }

Type declaration

  • address: string
  • authorityAddress: string
  • creator: string
  • description: string
  • hidden: boolean
  • isPrimary: boolean
  • name: string
  • reserves: ReserveConfigType[]

ObligationStats

ObligationStats: { borrowLimit: number; borrowUtilization: number; liquidationThreshold: number; netAccountValue: number; positions: number; userTotalBorrow: number; userTotalDeposit: number }

Type declaration

  • borrowLimit: number
  • borrowUtilization: number
  • liquidationThreshold: number
  • netAccountValue: number
  • positions: number
  • userTotalBorrow: number
  • userTotalDeposit: number

Position

Position: { amount: BN; mintAddress: string }

Type declaration

  • amount: BN
  • mintAddress: string

ReserveConfigType

ReserveConfigType: { address: string; collateralMintAddress: string; collateralSupplyAddress: string; liquidityAddress: string; liquidityFeeReceiverAddress: string; liquidityToken: { coingeckoID: string; decimals: number; logo: string; mint: string; name: string; symbol: string; volume24h: number }; pythOracle: string; switchboardOracle: string; userBorrowCap: number; userSupplyCap: number }

Type declaration

  • address: string
  • collateralMintAddress: string
  • collateralSupplyAddress: string
  • liquidityAddress: string
  • liquidityFeeReceiverAddress: string
  • liquidityToken: { coingeckoID: string; decimals: number; logo: string; mint: string; name: string; symbol: string; volume24h: number }
    • coingeckoID: string
    • decimals: number
    • logo: string
    • mint: string
    • name: string
    • symbol: string
    • volume24h: number
  • pythOracle: string
  • switchboardOracle: string
  • userBorrowCap: number
  • userSupplyCap: number

ReserveDataType

ReserveDataType: { assetPriceUSD: number; borrowFeePercentage: number; borrowInterestAPY: number; cTokenExchangeRate: number; cumulativeBorrowRateWads: BN; decimals: number; depositLimit: BN; hostFeePercentage: number; liquidationBonus: number; liquidationThreshold: number; loanToValueRatio: number; maxBorrowRate: number; minBorrowRate: number; mintAddress: string; name: string; optimalBorrowRate: number; optimalUtilizationRate: number; protocolTakeRate: number; reserveBorrowLimit: BN; supplyInterestAPY: number; symbol: string; totalBorrowsWads: BN; totalDepositsWads: BN; totalLiquidityWads: BN; userDepositLimit?: number }

Type declaration

  • assetPriceUSD: number
  • borrowFeePercentage: number
  • borrowInterestAPY: number
  • cTokenExchangeRate: number
  • cumulativeBorrowRateWads: BN
  • decimals: number
  • depositLimit: BN
  • hostFeePercentage: number
  • liquidationBonus: number
  • liquidationThreshold: number
  • loanToValueRatio: number
  • maxBorrowRate: number
  • minBorrowRate: number
  • mintAddress: string
  • name: string
  • optimalBorrowRate: number
  • optimalUtilizationRate: number
  • protocolTakeRate: number
  • reserveBorrowLimit: BN
  • supplyInterestAPY: number
  • symbol: string
  • totalBorrowsWads: BN
  • totalDepositsWads: BN
  • totalLiquidityWads: BN
  • Optional userDepositLimit?: number

RewardInfoType

RewardInfoType: { price: number; rewardMint?: string; rewardRate: string; rewardSymbol: string }

Type declaration

  • price: number
  • Optional rewardMint?: string
  • rewardRate: string
  • rewardSymbol: string

RewardResponseType

RewardResponseType: { borrow: RewardStatType; supply: RewardStatType }

Type declaration

RewardStatType

RewardStatType: { lastSlot: number; rewardRates: { beginningSlot: number; name?: string; rewardRate: string }[]; rewardsPerShare: string; totalBalance: string } | null

RewardsDataType

RewardsDataType: {}

Type declaration

SolendReward

SolendReward: { claimableAmount: number; claimedAmount: number; lifetimeAmount: number; rewardClaims: SolendClaim[]; symbol: string }

Type declaration

  • claimableAmount: number
  • claimedAmount: number
  • lifetimeAmount: number
  • rewardClaims: SolendClaim[]
  • symbol: string

Variables

LENDING_MARKET_SIZE

LENDING_MARKET_SIZE: any = LendingMarketLayout.span

LastUpdateLayout

LastUpdateLayout: typeof BufferLayout.Structure = ...

LendingMarketLayout

LendingMarketLayout: typeof BufferLayout.Structure = ...

OBLIGATION_SIZE

OBLIGATION_SIZE: any = ObligationLayout.span

ObligationCollateralLayout

ObligationCollateralLayout: typeof BufferLayout.Structure = ...

ObligationLayout

ObligationLayout: typeof BufferLayout.Structure = ...

ObligationLiquidityLayout

ObligationLiquidityLayout: typeof BufferLayout.Structure = ...

POSITION_LIMIT

POSITION_LIMIT: 6 = 6

RESERVE_SIZE

RESERVE_SIZE: any = ReserveLayout.span

ReserveConfigLayout

ReserveConfigLayout: any = ...

ReserveLayout

ReserveLayout: typeof BufferLayout.Structure = ...

SLOTS_PER_YEAR

SLOTS_PER_YEAR: 63072000 = 63072000

SOLEND_BETA_PROGRAM_ID

SOLEND_BETA_PROGRAM_ID: PublicKey = ...

SOLEND_DEVNET_PROGRAM_ID

SOLEND_DEVNET_PROGRAM_ID: PublicKey = ...

SOLEND_PRODUCTION_PROGRAM_ID

SOLEND_PRODUCTION_PROGRAM_ID: PublicKey = ...

U64_MAX

U64_MAX: "18446744073709551615" = "18446744073709551615"

WAD

WAD: string = ...

WANG

WANG: string = ...

Functions

Const borrowObligationLiquidityInstruction

  • borrowObligationLiquidityInstruction(liquidityAmount: number | BN, sourceLiquidity: PublicKey, destinationLiquidity: PublicKey, borrowReserve: PublicKey, borrowReserveLiquidityFeeReceiver: PublicKey, obligation: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, obligationOwner: PublicKey, solendProgramAddress: PublicKey, hostFeeReceiver?: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • sourceLiquidity: PublicKey
    • destinationLiquidity: PublicKey
    • borrowReserve: PublicKey
    • borrowReserveLiquidityFeeReceiver: PublicKey
    • obligation: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • obligationOwner: PublicKey
    • solendProgramAddress: PublicKey
    • Optional hostFeeReceiver: PublicKey

    Returns TransactionInstruction

Const depositObligationCollateralInstruction

  • depositObligationCollateralInstruction(collateralAmount: number | BN, sourceCollateral: PublicKey, destinationCollateral: PublicKey, depositReserve: PublicKey, obligation: PublicKey, lendingMarket: PublicKey, obligationOwner: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • collateralAmount: number | BN
    • sourceCollateral: PublicKey
    • destinationCollateral: PublicKey
    • depositReserve: PublicKey
    • obligation: PublicKey
    • lendingMarket: PublicKey
    • obligationOwner: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const depositReserveLiquidityAndObligationCollateralInstruction

  • depositReserveLiquidityAndObligationCollateralInstruction(liquidityAmount: number | BN, sourceLiquidity: PublicKey, sourceCollateral: PublicKey, reserve: PublicKey, reserveLiquiditySupply: PublicKey, reserveCollateralMint: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, destinationCollateral: PublicKey, obligation: PublicKey, obligationOwner: PublicKey, pythOracle: PublicKey, switchboardFeedAddress: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • sourceLiquidity: PublicKey
    • sourceCollateral: PublicKey
    • reserve: PublicKey
    • reserveLiquiditySupply: PublicKey
    • reserveCollateralMint: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • destinationCollateral: PublicKey
    • obligation: PublicKey
    • obligationOwner: PublicKey
    • pythOracle: PublicKey
    • switchboardFeedAddress: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const depositReserveLiquidityInstruction

  • depositReserveLiquidityInstruction(liquidityAmount: number | BN, sourceLiquidity: PublicKey, destinationCollateral: PublicKey, reserve: PublicKey, reserveLiquiditySupply: PublicKey, reserveCollateralMint: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • sourceLiquidity: PublicKey
    • destinationCollateral: PublicKey
    • reserve: PublicKey
    • reserveLiquiditySupply: PublicKey
    • reserveCollateralMint: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const flashBorrowReserveLiquidityInstruction

  • flashBorrowReserveLiquidityInstruction(liquidityAmount: number | BN, sourceLiquidity: PublicKey, destinationLiquidity: PublicKey, reserve: PublicKey, lendingMarket: PublicKey, lendingProgramId: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • sourceLiquidity: PublicKey
    • destinationLiquidity: PublicKey
    • reserve: PublicKey
    • lendingMarket: PublicKey
    • lendingProgramId: PublicKey

    Returns TransactionInstruction

Const flashRepayReserveLiquidityInstruction

  • flashRepayReserveLiquidityInstruction(liquidityAmount: number | BN, borrowInstructionIndex: number, sourceLiquidity: PublicKey, destinationLiquidity: PublicKey, reserveLiquidityFeeReceiver: PublicKey, hostFeeReceiver: PublicKey, reserve: PublicKey, lendingMarket: PublicKey, userTransferAuthority: PublicKey, lendingProgramId: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • borrowInstructionIndex: number
    • sourceLiquidity: PublicKey
    • destinationLiquidity: PublicKey
    • reserveLiquidityFeeReceiver: PublicKey
    • hostFeeReceiver: PublicKey
    • reserve: PublicKey
    • lendingMarket: PublicKey
    • userTransferAuthority: PublicKey
    • lendingProgramId: PublicKey

    Returns TransactionInstruction

getProgramId

  • getProgramId(environment: string): PublicKey

Const initLendingMarketInstruction

  • initLendingMarketInstruction(owner: PublicKey, quoteCurrency: Buffer, lendingMarket: PublicKey, lendingProgramId: PublicKey, oracleProgramId: PublicKey, switchboardProgramId: PublicKey): TransactionInstruction
  • Parameters

    • owner: PublicKey
    • quoteCurrency: Buffer
    • lendingMarket: PublicKey
    • lendingProgramId: PublicKey
    • oracleProgramId: PublicKey
    • switchboardProgramId: PublicKey

    Returns TransactionInstruction

Const initObligationInstruction

  • initObligationInstruction(obligation: PublicKey, lendingMarket: PublicKey, obligationOwner: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • obligation: PublicKey
    • lendingMarket: PublicKey
    • obligationOwner: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const initReserveInstruction

  • initReserveInstruction(liquidityAmount: number | BN, config: ReserveConfig, sourceLiquidity: PublicKey, destinationCollateral: PublicKey, reserve: PublicKey, liquidityMint: PublicKey, liquiditySupply: PublicKey, liquidityFeeReceiver: PublicKey, collateralMint: PublicKey, collateralSupply: PublicKey, pythProduct: PublicKey, pythPrice: PublicKey, switchboardFeed: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, lendingMarketOwner: PublicKey, transferAuthority: PublicKey, lendingProgramId: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • config: ReserveConfig
    • sourceLiquidity: PublicKey
    • destinationCollateral: PublicKey
    • reserve: PublicKey
    • liquidityMint: PublicKey
    • liquiditySupply: PublicKey
    • liquidityFeeReceiver: PublicKey
    • collateralMint: PublicKey
    • collateralSupply: PublicKey
    • pythProduct: PublicKey
    • pythPrice: PublicKey
    • switchboardFeed: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • lendingMarketOwner: PublicKey
    • transferAuthority: PublicKey
    • lendingProgramId: PublicKey

    Returns TransactionInstruction

Const isLendingMarket

  • isLendingMarket(info: AccountInfo<Buffer>): boolean

Const isObligation

  • isObligation(info: AccountInfo<Buffer>): boolean

Const isReserve

  • isReserve(info: AccountInfo<Buffer>): boolean

obligationToString

  • obligationToString(obligation: Obligation): string

Const parseLendingMarket

  • parseLendingMarket(pubkey: PublicKey, info: AccountInfo<Buffer>): { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: LendingMarket; pubkey: PublicKey }
  • Parameters

    • pubkey: PublicKey
    • info: AccountInfo<Buffer>

    Returns { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: LendingMarket; pubkey: PublicKey }

    • account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }
      • data: Buffer

        Optional data assigned to the account

      • executable: boolean

        true if this account's data contains a loaded program

      • lamports: number

        Number of lamports assigned to the account

      • owner: PublicKey

        Identifier of the program that owns the account

      • Optional rentEpoch?: number

        Optional rent epoch infor for account

    • info: LendingMarket
    • pubkey: PublicKey

Const parseObligation

  • parseObligation(pubkey: PublicKey, info: AccountInfo<Buffer>): null | { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: Obligation; pubkey: PublicKey }
  • Parameters

    • pubkey: PublicKey
    • info: AccountInfo<Buffer>

    Returns null | { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: Obligation; pubkey: PublicKey }

Const parseReserve

  • parseReserve(pubkey: PublicKey, info: AccountInfo<Buffer>): null | { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: Reserve; pubkey: PublicKey }
  • Parameters

    • pubkey: PublicKey
    • info: AccountInfo<Buffer>

    Returns null | { account: { data: Buffer; executable: boolean; lamports: number; owner: PublicKey; rentEpoch?: number }; info: Reserve; pubkey: PublicKey }

Const redeemReserveCollateralInstruction

  • redeemReserveCollateralInstruction(collateralAmount: number | BN, sourceCollateral: PublicKey, destinationLiquidity: PublicKey, reserve: PublicKey, reserveCollateralMint: PublicKey, reserveLiquiditySupply: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • collateralAmount: number | BN
    • sourceCollateral: PublicKey
    • destinationLiquidity: PublicKey
    • reserve: PublicKey
    • reserveCollateralMint: PublicKey
    • reserveLiquiditySupply: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const refreshObligationInstruction

  • refreshObligationInstruction(obligation: PublicKey, depositReserves: PublicKey[], borrowReserves: PublicKey[], solendProgramAddress: PublicKey): TransactionInstruction

Const refreshReserveInstruction

  • refreshReserveInstruction(reserve: PublicKey, solendProgramAddress: PublicKey, oracle?: PublicKey, switchboardFeedAddress?: PublicKey): TransactionInstruction
  • Parameters

    • reserve: PublicKey
    • solendProgramAddress: PublicKey
    • Optional oracle: PublicKey
    • Optional switchboardFeedAddress: PublicKey

    Returns TransactionInstruction

Const repayObligationLiquidityInstruction

  • repayObligationLiquidityInstruction(liquidityAmount: number | BN, sourceLiquidity: PublicKey, destinationLiquidity: PublicKey, repayReserve: PublicKey, obligation: PublicKey, lendingMarket: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • liquidityAmount: number | BN
    • sourceLiquidity: PublicKey
    • destinationLiquidity: PublicKey
    • repayReserve: PublicKey
    • obligation: PublicKey
    • lendingMarket: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

reserveToString

  • reserveToString(reserve: Reserve): string

syncNative

  • syncNative(account: PublicKey, programId?: PublicKey): TransactionInstruction
  • Construct a SyncNative instruction

    Parameters

    • account: PublicKey

      Native account to sync lamports from

    • programId: PublicKey = TOKEN_PROGRAM_ID

      SPL Token program account

    Returns TransactionInstruction

    Instruction to add to a transaction

Const updateReserveConfig

  • updateReserveConfig(reserve: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, lendingMarketOwner: PublicKey, pythProduct: PublicKey, pythPrice: PublicKey, switchboardOracle: PublicKey, reserveConfig: ReserveConfig, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • reserve: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • lendingMarketOwner: PublicKey
    • pythProduct: PublicKey
    • pythPrice: PublicKey
    • switchboardOracle: PublicKey
    • reserveConfig: ReserveConfig
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const withdrawObligationCollateralAndRedeemReserveLiquidity

  • withdrawObligationCollateralAndRedeemReserveLiquidity(collateralAmount: number | BN, sourceCollateral: PublicKey, destinationCollateral: PublicKey, withdrawReserve: PublicKey, obligation: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, destinationLiquidity: PublicKey, reserveCollateralMint: PublicKey, reserveLiquiditySupply: PublicKey, obligationOwner: PublicKey, transferAuthority: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • collateralAmount: number | BN
    • sourceCollateral: PublicKey
    • destinationCollateral: PublicKey
    • withdrawReserve: PublicKey
    • obligation: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • destinationLiquidity: PublicKey
    • reserveCollateralMint: PublicKey
    • reserveLiquiditySupply: PublicKey
    • obligationOwner: PublicKey
    • transferAuthority: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Const withdrawObligationCollateralInstruction

  • withdrawObligationCollateralInstruction(collateralAmount: number | BN, sourceCollateral: PublicKey, destinationCollateral: PublicKey, withdrawReserve: PublicKey, obligation: PublicKey, lendingMarket: PublicKey, lendingMarketAuthority: PublicKey, obligationOwner: PublicKey, solendProgramAddress: PublicKey): TransactionInstruction
  • Parameters

    • collateralAmount: number | BN
    • sourceCollateral: PublicKey
    • destinationCollateral: PublicKey
    • withdrawReserve: PublicKey
    • obligation: PublicKey
    • lendingMarket: PublicKey
    • lendingMarketAuthority: PublicKey
    • obligationOwner: PublicKey
    • solendProgramAddress: PublicKey

    Returns TransactionInstruction

Generated using TypeDoc