> For the complete documentation index, see [llms.txt](https://qualitax.gitbook.io/polymesh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://qualitax.gitbook.io/polymesh/exploring-polymesh-data/assets.md).

# Assets

The metrics below not only offer a snapshot of the current state of assets (as of 05 March 2024 ) but also enable stakeholders to analyze trends over time, assess the diversity of asset types, and understand investor engagement.

| Metric Category | Metric                                       | Metric Description                                              |
| --------------- | -------------------------------------------- | --------------------------------------------------------------- |
| Assets          | Nb Assets                                    | Total number of assets on the network                           |
| Assets          | Assets by type                               | Total number of assets on the network by type                   |
| Assets          | Assets per month per type                    | Total number of assets created per month, grouped by asset type |
| Assets          | Top 10 Assets by investor count              | Top 10 assets by investor count                                 |
| Assets          | Assets created over the last 30 days by type | Total number of assets created over the last 30 days by type    |
| Assets          | List of Assets created over the last 30 days | List of assets created over the last 30 days                    |

## Nb Assets

This metric gives a high-level overview of the ecosystem's size and growth, indicating the adoption and utilization of the Polymesh platform for asset issuance.

**How many assets have been tokenized on the Polymesh network?**

<mark style="color:purple;">**SQL**</mark>

```
SELECT 
COUNT(*) as nbAssets
FROM 
assets
```

<figure><img src="/files/NeqUMzIKtu4S9WSfRxeX" alt=""><figcaption><p>Nb Assets</p></figcaption></figure>

<mark style="color:purple;">**GraphQL**</mark>

```
query {
  assets {
    totalCount
  }
}
```

<figure><img src="/files/MiDEbCGPNP83pVKE5ZUH" alt=""><figcaption></figcaption></figure>

##

## Assets by type

This metric is important for understanding the composition of the asset ecosystem, showing which types of assets (e.g., bonds, equities, funds) are most prevalent. This reflects market preferences and regulatory compliance capabilities of Polymesh.

#### How many assets have been tokenized on the Polymesh network by type of asset ?

<mark style="color:purple;">**SQL**</mark>

```
SELECT 
type as assetType, COUNT(*) as nbAssets
FROM 
    assets
GROUP BY type
ORDER BY nbAssets DESC;
```

<figure><img src="/files/SsXlkKiEiHGOvNAKF14Q" alt=""><figcaption><p>Assets by type</p></figcaption></figure>

<mark style="color:purple;">**GraphQL**</mark>

```
query assetGroupedByTypeCount {
  assets(orderBy: TYPE_ASC) {
    totalCount
    groupedAggregates(groupBy: TYPE) {
      keys
      distinctCount {
        ticker
      }
    }
  }
}
```

##

## Assets per month per type

This metric provides insights into growth trends and market dynamics, helping to identify patterns or shifts in the types of assets being created, which could be indicative of broader market or regulatory changes.

#### How many assets have been tokenized per month, grouped by asset type ?

<mark style="color:purple;">**SQL**</mark>

```
SELECT 
    DATE_TRUNC('month', b.datetime) AS month,
    a.type,
    COUNT(*) AS total_assets_created
FROM 
    assets a
JOIN 
    blocks b ON a.created_block_id::integer = b.block_id
GROUP BY 
    month, 
    a.type
ORDER BY 
    month DESC, 
    a.type;
```

<figure><img src="/files/CNFOQny9H9SdYjqugqs1" alt=""><figcaption><p>Assets per month per type</p></figcaption></figure>

<mark style="color:purple;">**GraphQL**</mark>

```
query {
  assets {
    nodes {
      type
      createdBlock {
        datetime
      }
    }
  }
}
```

This query retrieves the `type` and `createdBlock.datetime` fields for each asset. The `createdBlock` field represents the block in which the asset was created, and the `datetime` field represents the timestamp of that block.

After executing the query, you can process the results in your application code to group the assets by month and type, and count the total assets created for each group.

{% hint style="info" %}
**Potential improvement #2**

The current Polymesh GraphQL schema could be updated to support the grouping and counting of assets using the `@derivedFrom` directive and some additional queries.
{% endhint %}

## Top 10 Assets by investor count

This metric highlights the most popular or widely held assets, which can be a proxy for market sentiment, perceived value, or investor confidence in certain asset classes or issuances.

#### What are the top 10 assets on Polymesh by number of investors ?

<mark style="color:purple;">**SQL**</mark>

```
WITH AssetCreation AS (
    SELECT 
        DATE_TRUNC('month', b.datetime) AS createdMonth,
        a.id AS assetID
    FROM 
        assets a
    JOIN 
        blocks b ON a.created_block_id::integer = b.block_id
), 
TopAssets AS (
    SELECT 
        a.id AS assetID,
        a.name AS "Asset Name",
        a.type AS "Asset Type",
        COUNT(DISTINCT ah.identity_id) AS "InvestorCount",
        a.total_supply AS "Total Supply"
    FROM 
        assets a
    JOIN 
        asset_holders ah ON ah.asset_id = a.id
    GROUP BY 
        a.id
    ORDER BY 
        "InvestorCount" DESC
    LIMIT 10
)
SELECT 
    t."Asset Name",
    t.assetID,
    t."Asset Type",
    t."InvestorCount",
    t."Total Supply",
    ac.createdMonth
FROM 
    TopAssets t
JOIN 
    AssetCreation ac ON t.assetID = ac.assetID
ORDER BY 
    t."InvestorCount" DESC;

```

<figure><img src="/files/9O0WHtsETwMEZtysu6Bc" alt=""><figcaption><p>Top 10 Assets by investor count</p></figcaption></figure>

<mark style="color:purple;">**GraphQL**</mark>

```
query {
  assets(
    orderBy: HOLDERS_COUNT_DESC
    first: 10
  ) {
    nodes {
      id
      name
      type
      holders {
        totalCount
      }
      totalSupply
      createdBlock {
        datetime
      }
    }
  }
}
```

<figure><img src="/files/SVb5oc96vdEZaRvTKhlh" alt=""><figcaption><p>Top 10 Assets by investor count </p></figcaption></figure>

##

## Assets created over the last 30 days by type

This metric allows stakeholders to track recent activity and interest in different types of assets. This metric is particularly useful for identifying sudden spikes or drops in asset issuance, possibly in response to market or regulatory developments.

#### How many assets created over the last 30 days by type ?

<mark style="color:purple;">**SQL**</mark>

```

SELECT 
    a.type AS "Asset Type",
    COUNT(a.id) AS "Number of Assets Created",
    DATE_TRUNC('day', b.datetime) AS "Creation Date"
FROM 
    assets a
JOIN 
    blocks b ON a.created_block_id::integer = b.block_id
WHERE 
    b.datetime >= NOW() - INTERVAL '30 days'
GROUP BY 
    "Asset Type", "Creation Date"
ORDER BY 
    "Creation Date" DESC, "Asset Type";
    
```

Results: none at the time of running the query.

<mark style="color:purple;">**GraphQL**</mark>

```
query {
  assets {
    nodes {
      id
      type
      createdBlock {
        datetime
      }
    }
  }
}
```

This query retrieves all the assets and their corresponding `type` and `createdBlock.datetime` fields. Since the provided schema doesn't support filtering or formatting directly in the query,  you will need to handle the filtering and formatting in the application code.

{% hint style="info" %}
**Potential improvement #3**

The current Polymesh GraphQL schema could be updated to support filtering of assets.
{% endhint %}

##

## List of assets created over the last 30 days

This metric provides specific details on recent issuances, offering users immediate insights into the newest assets on the network. This can be valuable for investors looking for new opportunities or analysts monitoring the innovation and evolution of the platform's offerings.

#### What is the list of assets created over the last 30 days on Polymesh ?

<mark style="color:purple;">**SQL**</mark>

```

SELECT 
   ticker, name, type, funding_round
FROM 
    assets a
JOIN 
    blocks b ON a.created_block_id::integer = b.block_id
WHERE 
    b.datetime >= NOW() - INTERVAL '30 days';

```

<mark style="color:purple;">**GraphQL**</mark>

```
query {
  assets {
    nodes {
      ticker
      name
      type
      fundingRound
      createdBlock {
        datetime
      }
    }
  }
}
```

This query retrieves all the assets and their corresponding `ticker`, `name`, `type`, `fundingRound`, and `createdBlock.datetime` fields.

Since the provided schema doesn't support filtering directly in the query, you'll need to handle the filtering of assets created within the last 30 days in the application code.

{% hint style="info" %}
**Potential improvement #3**

The current Polymesh GraphQL schema could be updated to support filtering of assets.
{% endhint %}
