> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Portfolio Composition

> Get USD portfolio value breakdown by blockchain network

## Overview

Returns the portfolio composition showing the USD value of assets held by an address on each supported blockchain network. This endpoint is useful for understanding cross-chain asset distribution and portfolio diversification.

<Info>
  This endpoint provides a breakdown of value by chain, while the `/total/usd/aggregate` endpoint provides a single combined total.
</Info>

## Path Parameters

<ParamField path="address" type="string" required>
  Ethereum address or ENS name (e.g., `vitalik.eth` or `0x742d35Cc6634C0532925a3b844Bc454e4438f44e`)
</ParamField>

## Response

<ResponseField name="address" type="string">
  The resolved Ethereum address (checksummed)
</ResponseField>

<ResponseField name="timestamp" type="string">
  ISO 8601 timestamp when values were calculated
</ResponseField>

<ResponseField name="total_asset_usd" type="number">
  Combined total portfolio value across all chains
</ResponseField>

<ResponseField name="chains" type="array">
  Per-chain breakdown of asset values
</ResponseField>

<ResponseField name="chains[].chain_id" type="integer">
  Blockchain network ID
</ResponseField>

<ResponseField name="chains[].chain_name" type="string">
  Human-readable chain name
</ResponseField>

<ResponseField name="chains[].total_asset_usd" type="number">
  Total asset value on this chain in USD
</ResponseField>

## Included Assets

| Asset Type                       | Included            |
| -------------------------------- | ------------------- |
| Native tokens (ETH, MATIC, etc.) | Yes                 |
| ERC-20 tokens                    | Yes                 |
| Stablecoins (USDC, USDT, DAI)    | Yes                 |
| LP tokens (Uniswap, Curve)       | Yes                 |
| Wrapped tokens (WETH, WBTC)      | Yes                 |
| Collateral deposits              | Yes                 |
| NFTs                             | No                  |
| Unclaimed rewards                | No                  |
| Pending transactions             | No                  |
| Debt positions                   | No (separate field) |

## Pricing Sources

* **Primary**: Chainlink on-chain oracles (real-time)
* **Fallback**: CoinGecko API (for tokens without oracle coverage)
* **Update Frequency**: Prices refresh every 60 seconds
* **Denomination**: All values in USD

## Use Cases

* **Portfolio Diversification**: Visualize asset distribution across chains
* **Chain-Level Tracking**: Monitor holdings on specific networks
* **Rebalancing Decisions**: Identify over/under-weighted chains
* **Cross-Chain Analytics**: Compare activity across L1s and L2s

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.credprotocol.com/api/v2/report/address/vitalik.eth/total/usd" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.credprotocol.com/api/v2/report/address/vitalik.eth/total/usd', {
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  });

  const data = await response.json();
  console.log(`Total Portfolio: $${data.total_asset_usd}`);
  data.chains.forEach(chain => {
    console.log(`${chain.chain_name}: $${chain.total_asset_usd}`);
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.credprotocol.com/api/v2/report/address/vitalik.eth/total/usd',
      headers={'Authorization': 'Bearer YOUR_API_KEY'}
  )

  data = response.json()
  print(f"Total Portfolio: ${data['total_asset_usd']}")
  for chain in data['chains']:
      print(f"{chain['chain_name']}: ${chain['total_asset_usd']}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "timestamp": "2024-01-15T10:30:00Z",
    "total_asset_usd": 125000.50,
    "chains": [
      {
        "chain_id": 1,
        "chain_name": "Ethereum",
        "total_asset_usd": 85000.50
      },
      {
        "chain_id": 8453,
        "chain_name": "Base",
        "total_asset_usd": 25000.00
      },
      {
        "chain_id": 137,
        "chain_name": "Polygon",
        "total_asset_usd": 15000.00
      }
    ]
  }
  ```
</ResponseExample>

## Performance

* **Response Time**: \< 1 second
* **Caching**: Results cached for 5 minutes per address
