Skip to main content
This section contains utility hooks that make it easier to work with Compound III.

Summary of Helper Hooks

useTotalSupply

The useTotalSupply hook retrieves the total supply of the base asset in the protocol.

Usage

Return Value

useTotalBorrow

The useTotalBorrow hook retrieves the total amount borrowed from the protocol.

Usage

Return Value

useTotalCollateral

The useTotalCollateral hook retrieves the total collateral for a specific asset in the protocol.

Usage

Return Value

useSuppliedBaseBalance

The useSuppliedBaseBalance hook retrieves the supplied base token balance for an account.

Usage

Return Value

useBorrowBalance

The useBorrowBalance hook retrieves the borrow balance for an account.

Usage

Return Value

useGetAssetInfo

The useGetAssetInfo hook retrieves information about a specific asset by its symbol.

Usage

Return Value

useGetAssetInfoByAddress

The useGetAssetInfoByAddress hook retrieves information about an asset by its address.

Usage

Return Value

useGetPrice

The useGetPrice hook retrieves the current price of an asset.

Usage

Return Value

useGetMaxAssets

The useGetMaxAssets hook retrieves the maximum number of assets that can be supported by the protocol.

Usage

Return Value

useGetFactorScale

The useGetFactorScale hook retrieves the factor scale used for calculations in the protocol.

Usage

Return Value

useGetPriceScale

The useGetPriceScale hook retrieves the price scale used for calculations in the protocol.

Usage

Return Value

useGetBaseIndexScale

The useGetBaseIndexScale hook retrieves the base index scale used for calculations in the protocol.

Usage

Return Value

useGetBaseAccrualScale

The useGetBaseAccrualScale hook retrieves the base accrual scale used for calculations in the protocol.

Usage

Return Value

useGetBaseAssetMarketInfo

The useGetBaseAssetMarketInfo hook retrieves market information for the base asset.

Usage

Return Value

useUserBasic

The useUserBasic hook retrieves basic information about a user’s account.

Usage

Return Value

useAccrueAccount

The useAccrueAccount hook allows accruing interest for a specific account.

Usage

Return Value