Helpers
Utility hooks for working with Compound III
This section contains utility hooks that make it easier to work with Compound III.
Summary of Helper Hooks
- useTotalSupply: Retrieves the total supply of the base asset in the protocol
- useTotalBorrow: Retrieves the total amount borrowed from the protocol
- useTotalCollateral: Retrieves the total collateral for a specific asset
- useSuppliedBaseBalance: Retrieves the supplied base token balance for an account
- useBorrowBalance: Retrieves the borrow balance for an account
- useGetAssetInfo: Retrieves information about a specific asset by its symbol
- useGetAssetInfoByAddress: Retrieves information about an asset by its address
- useGetPrice: Retrieves the current price of an asset
- useGetMaxAssets: Gets the maximum number of assets supported by the protocol
- useGetFactorScale: Retrieves the factor scale used for calculations
- useGetPriceScale: Gets the price scale used for calculations
- useGetBaseIndexScale: Retrieves the base index scale
- useGetBaseAccrualScale: Gets the base accrual scale
- useGetBaseAssetMarketInfo: Retrieves market information for the base asset
- useUserBasic: Gets basic information about a user’s account
- useAccrueAccount: Allows accruing interest for a specific account
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.