5️Storage

Essential reserves and users information.

This module provides key information related to the reserves in the lending pool and user-specific data, such as asset holdings and balances. They are crucial for tracking the state of the protocol and individual user interactions, helping developers and users manage their assets within the NAVI protocol.

get_reserves_count

Description: This function returns the number of reserve assets available in the storage pool. It provides an overview of how many different assets are being managed in the lending protocol.

Use Cases: This function is used when a developer or user needs to know the total number of asset reserves in the pool, typically for pool status checks or when initializing interactions with multiple reserves.

public fun get_reserves_count(
    storage: &Storage
): u8 {}

get_user_assets

Description: This function retrieves the list of assets and their respective balances held by a specific user within the storage pool. It returns vectors representing the asset IDs and their corresponding values.

Use Cases: This function is used to get a comprehensive view of a user's asset holdings in the lending pool, useful for portfolio management or determining eligibility for borrowing and rewards.

public fun get_user_assets(
    storage: &Storage, 
    user: address
): (vector<u8>, vector<u8>) {}

get_user_balance

Description: This function returns the balance of a specific asset for a given user, including both supply and borrow amounts. It is essential for tracking the user's positions within the lending protocol.

Use Cases: This function is used when a user or developer needs to check the current balance of an asset supplied or borrowed by a specific user, which is critical for monitoring positions and potential liquidation risks.

public fun get_user_balance(
    storage: &mut Storage, 
    asset: u8, 
    user: address
): (u256, u256) {}

Last updated