Documentation
    Preparing search index...

    Module @naviprotocol/lending

    Lending Package - Main Entry Point

    This package provides comprehensive lending and borrowing functionality for the Sui blockchain. It includes account management, pool operations, flash loans, liquidation, and reward systems.

    @naviprotocol/lending

    npm version License: MIT

    NAVI Lending SDK is a lending SDK designed specifically for the Sui blockchain, providing complete lending functionality including account management, pool operations, flash loans, liquidation, and reward systems.

    For SDK documentation visit http://sdk.naviprotocol.io/lending

    The NAVI lending protocol allows users to:

    • Deposit: Deposit assets into pools to earn interest
    • Borrow: Use deposits as collateral to borrow other assets
    • Repay: Repay loans and pay interest
    • Withdraw: Withdraw deposits from pools

    Health factor is an important metric for measuring the safety of a user's lending account:

    • Health Factor > 1: Account is safe and can continue borrowing
    • Health Factor ≤ 1: Account is at risk of liquidation

    Flash loans allow users to borrow assets without collateral, but must be repaid within the same transaction.

    npm install @naviprotocol/lending
    

    The last options parameter of the interface is usually an optional object used to customize interface behavior. Common optional parameters include but are not limited to:

    • client: Sui network client instance (such as SuiClient), used for customizing network requests, suitable for scenarios that require custom RPC nodes or multi-network environments.
    • env: Specify environment (such as 'prod''dev'), affecting data sources and on-chain contract addresses, ensuring data isolation and compatibility in different deployment environments.
    • cacheTime: Custom cache time in milliseconds. By setting cache time, you can reduce duplicate requests and improve performance. For example, cacheTime: 60000 means cache for 60 seconds.
    • disableCache: Whether to disable cache
    • accountCap: In ptb-related operations, use account cap

    Usage Recommendations:

    • If you don't pass options, the SDK will automatically use default configuration, suitable for most regular scenarios.
    • When you need to customize network, environment, or cache strategy, it's recommended to pass corresponding parameters for more flexible control.
    • Interfaces with PTB suffix indicate that the current interface is used for constructing transactions.

    Enumerations

    PoolOperator

    Type Aliases

    AccountCap
    AccountCapOption
    AssetIdentifier
    CacheOption
    CoinObject
    EnvOption
    FeeDetail
    FloashloanAsset
    HistoryClaimedReward
    LendingClaimedReward
    LendingConfig
    LendingReward
    LendingRewardSummary
    OraclePriceFeed
    Pool
    PoolStats
    SuiClientOption
    Transaction
    TransactionResult
    UserLendingInfo

    Variables

    Address
    DEFAULT_CACHE_TIME
    FlashLoanAssetConfig
    getAllFlashLoanAssets
    getBorrowFee
    getConfig
    getFees
    getLendingState
    getPools
    getStats
    getTransactions
    getUserClaimedRewardHistory
    getUserTotalClaimedReward
    IncentiveAPYInfo
    IncentivePoolInfo
    IncentivePoolInfoByPhase
    OracleInfo
    ReserveDataInfo
    UserStateInfo

    Functions

    borrowCoinPTB
    claimLendingRewardsPTB
    createAccountCapPTB
    depositCoinPTB
    filterPriceFeeds
    flashloanPTB
    getCoins
    getFlashLoanAsset
    getHealthFactor
    getHealthFactorPTB
    getPool
    getPriceFeeds
    getPythStalePriceFeedId
    getSimulatedHealthFactor
    getSimulatedHealthFactorPTB
    getUserAvailableLendingRewards
    liquidatePTB
    mergeCoinsPTB
    normalizeCoinType
    parseTxValue
    repayCoinPTB
    repayFlashLoanPTB
    summaryLendingRewards
    updateOraclePricesPTB
    updatePythPriceFeeds
    withCache
    withdrawCoinPTB
    withSingleton