Skip to main content
The UserPositionSummary component displays a comprehensive summary of a user’s position in the Compound III protocol, including supplied assets, borrowed amount, and health factor.

Usage

Props

Example

Displayed Information

The component displays the following information about the user’s position:
  • Total Supplied: The total value of all supplied assets
  • Total Borrowed: The total amount borrowed
  • Available to Borrow: The remaining amount available to borrow
  • Health Factor: A measure of the position’s safety (higher is better)
  • Liquidation Threshold: The point at which the position becomes eligible for liquidation
  • Supplied Assets: A breakdown of all supplied assets with their values
  • Collateral Assets: A breakdown of assets being used as collateral

Health Factor Indicator

The component includes a visual health factor indicator that changes color based on the position’s risk level:
  • Green: Safe position (health factor > 1.5)
  • Yellow: Moderate risk (health factor between 1.1 and 1.5)
  • Orange: High risk (health factor between 1.0 and 1.1)
  • Red: Danger of liquidation (health factor < 1.0)

Loading and Error States

The component handles loading and error states automatically:
  • While data is being fetched, a loading indicator is displayed
  • If an error occurs during data fetching, an error message is displayed
  • If the user has no position, an appropriate message is shown

Customization

You can customize the appearance of the component using the className prop: