CompoundDashboard component provides a complete user interface for interacting with the Compound III protocol. It combines multiple components into a tabbed interface, allowing users to view their position, supply and borrow assets, view market statistics, and see their transaction history.
Usage
Props
Example
Dashboard Tabs
The dashboard includes the following tabs:Overview Tab
The Overview tab displays a summary of the user’s position and market statistics:- User Position Summary: Shows the user’s supplied assets, borrowed amount, and health factor
- Interest Rate Display: Shows current supply and borrow interest rates
- Market Stats: Shows key market statistics like total supply, total borrow, and utilization rate
Supply & Borrow Tab
The Supply & Borrow tab provides forms for supplying and borrowing assets:- Supply Form: Allows users to supply assets to the protocol
- Withdraw Form: Allows users to withdraw supplied assets
- Borrow Form: Allows users to borrow assets from the protocol
- Repay Form: Allows users to repay borrowed assets
Assets Tab
The Assets tab displays detailed information about all assets in the protocol:- Asset List: Shows all available assets with their prices, supply APY, and borrow APY
- Asset Details: Shows detailed information about each asset, including collateral factors and supply caps
Transaction History Tab
The Transaction History tab displays a chronological list of the user’s transactions with the protocol:- Transaction List: Shows all transactions with their type, asset, amount, and date
- Filtering Options: Allows filtering transactions by type and asset
Network Switching
The dashboard includes a network selector that allows users to switch between different networks where Compound III is deployed:- Network Selector: Displays a dropdown of supported networks
- Automatic Switching: Automatically switches the connected wallet to the selected network
Loading and Error States
The component handles loading and error states automatically:- While data is being fetched, loading indicators are displayed
- If errors occur during data fetching or transactions, error messages are displayed
- If the user is not connected to a wallet, a connect wallet button is displayed
Customization
You can customize the appearance of the dashboard using theclassName prop: