Liquidity

Exploring Liquidity on Polymesh

The liquidity metrics aim to provide well-rounded view of market activity and asset liquidity on the Polymesh network. The metrics below provide a snapshot of the current state of liquidity as of 05 March 2024.

Metric Category
Metric
Metric Description

Liquidity

Volume of asset transactions over time

Volume of asset transactions per year (excluding issuance)

Liquidity

Volume of asset transactions by asset type by month

Volume of asset transactions by asset type by month

Liquidity

Volume of asset transactions by event type by month

Volume of asset transactions by event type by month

Liquidity

Average daily trading volume over the last 120 days

Average amount (or total volume) of asset units traded across all assets within a given day over the last 120 days

Liquidity

Average daily trading volume by type over the last 120 days

Average amount (or total volume) of asset units traded across all assets within a given day by asset type over the last 120 days

Liquidity

Days without trading activities over the last 120 days

Nb of days without trading activities (i.e without asset transactions)

Liquidity

Turnover ratio

Volume of an asset traded over a period relative to the total supply of the asset.

Volume of asset transactions over time

This metric is useful to assess the liquidity and activity level of assets on the network. A year-over-year analysis can reveal the platform's performance in terms of stakeholder engagement and transaction volume.

What is the volume of asset transactions over time (including issuance)

SQL

SELECT 
    DATE_TRUNC('month', datetime) AS month,
    COUNT(*) AS total_transactions
FROM 
    asset_transactions
GROUP BY 
    month
ORDER BY 
    month;

GraphQL

query {
  assetTransactions {
    nodes {
      createdBlock {
        datetime
      }
    }
  }
}

This query retrieves all the asset transactions and their corresponding createdBlock.datetime field. Since the provided schema doesn't support aggregation and grouping directly in the query, you'll need to handle the grouping and counting of transactions by month in the application code

Possible Improvement #4

The Polymesh GraphQL schema could be updated to introduce a new entity called AssetTransactionAggregateByMonth and modify the existing AssetTransaction to include a reference to the AssetTransactionAggregateByMonth.

Volume of asset transactions by asset type by month

This metric provides a more granular view of transaction volumes, enabling stakeholders to identify which asset types are most actively traded and when. This can help in spotting trends, seasonal patterns, or emerging asset classes.

Which asset types are most actively traded on the Polymesh network, and how does this activity fluctuate over time?

SQL

SELECT 
    DATE_TRUNC('month', at.datetime) AS month,
    a.type AS asset_type,
    COUNT(at.id) AS transaction_volume
FROM 
    asset_transactions at
JOIN 
    assets a ON at.asset_id = a.id
GROUP BY 
    month, 
    asset_type
ORDER BY 
    month, 
    asset_type;

GraphQL

query {
  assetTransactions {
    nodes {
      id
      asset {
        type
      }
      createdBlock {
        datetime
      }
    }
  }
}

This query retrieves all the asset transactions along with their corresponding id, asset.type, and createdBlock.datetime fields.

Since the provided schema doesn't support aggregation and grouping directly in the query, you'll need to handle the grouping, counting, and ordering of transactions by month and asset type in the application code.

Possible improvement #5

The Polymesh GraphQL schema could be updated to support the query for aggregating asset transactions by month and asset type, the schema could be further modify to introduce a new entity called AssetTransactionAggregateByMonthAndType and then modifythe AssetTransaction entity to include a reference to the AssetTransactionAggregateByMonthAndType.

Volume of asset transactions by event type by month

This metric provides insights into the dynamics of asset transactions on the Polymesh network and can also helps stakeholders understand the underlying behaviors driving these transactions, enabling more informed decisions.

How do different types of asset transaction events vary in volume over time within the Polymesh network?

SQL

SELECT 
    DATE_TRUNC('month', at.datetime) AS month,
    at.event_id AS event_type,
    COUNT(at.id) AS transaction_volume
FROM 
    asset_transactions at
JOIN 
    assets a ON at.asset_id = a.id
GROUP BY 
    month, 
    event_type
ORDER BY 
    month, 
    event_type;

GraphQL

query {
  assetTransactions {
    nodes {
      id
      eventId
      createdBlock {
        datetime
      }
    }
  }
}

This query retrieves all the asset transactions along with their corresponding id, eventId, and createdBlock.datetime fields.

Similar to the previous examples, the provided schema doesn't support aggregation and grouping directly in the query. Therefore, you'll need to handle the grouping, counting, and ordering of transactions by month and event type in the application code.

Possible improvement #6

To support the query for aggregating asset transactions by month and event type directly in GraphQL, the schema could introduce a new entity called AssetTransactionAggregateByMonthAndEventType then modify the AssetTransaction entity to include a reference to the AssetTransactionAggregateByMonthAndEventType.

Average daily trading volume over the last 120 days

This metric helps in understanding the daily liquidity. It provides insight into the current liquidity and activity level, offering a more immediate snapshot than annual metrics. It's particularly useful for identifying short-term trends.

What is the Average daily trading volume over the last 120 days ?

SQL


SELECT 
    DATE_TRUNC('day', datetime) AS day,
    AVG(amount) AS average_daily_volume
FROM 
    asset_transactions
WHERE 
    datetime >= NOW() - INTERVAL '120 days'
GROUP BY 
    day
ORDER BY 
    day DESC;

GraphQL

query {
  assetTransactions {
    nodes {
      amount
      createdBlock {
        datetime
      }
    }
  }
}

This query retrieves all the asset transactions along with their corresponding amount and createdBlock.datetime fields.

Since the provided schema doesn't support aggregation and grouping directly in the query, you'll need to handle the filtering, grouping, and averaging of daily trading volumes over the last 120 days in the application code.

Possible improvement #7

The Polymesh schema could be updated to support the query for calculating the average daily trading volume over the last 120 days directly in GraphQL. One idea could be to introduce a new entity called AssetTransactionAggregateByDaythen modify the AssetTransaction entity to include a reference to the AssetTransactionAggregateByDay.

Average daily trading volume by type over the last 120 days

This metric helps in understanding the daily liquidity by asset type to provide deeper insights into specific markets. Similar to the average daily trading volume, but offers a breakdown by asset type.

What is the Average daily trading volume by asset type over the last 120 days?

SQL


SELECT 
    DATE_TRUNC('day', at.datetime) AS day,
    a.type AS asset_type,
    AVG(at.amount) AS average_daily_volume
FROM 
    asset_transactions at
JOIN 
    assets a ON at.asset_id = a.id
WHERE 
    at.datetime >= NOW() - INTERVAL '120 days'
GROUP BY 
    day, asset_type
ORDER BY 
    day DESC, asset_type;

GraphQL

query {
  assetTransactions {
    nodes {
      amount
      asset {
        type
      }
      createdBlock {
        datetime
      }
    }
  }
}

This query retrieves all the asset transactions along with their corresponding amount, asset.type, and createdBlock.datetime fields.

Since the provided schema doesn't support aggregation and grouping directly in the query, you'll need to handle the filtering, grouping, and averaging of daily trading volumes by asset type over the last 120 days in the application code.

Possible improvement #8

To support the query for calculating the average daily trading volume by asset type over the last 120 days directly in GraphQL, you can modify the schema by introducing a new entity called AssetTransactionAggregateByDayAndType and then modify the AssetTransaction entity to include a reference to the AssetTransactionAggregateByDayAndType.

Days without trading activities over the last 120 days

This metric identifies periods of low activity, which can be helpful for spotting potential issues in market participation or interest in certain assets. It's a good indicator of market health and investor engagement.

How many days without trading activities (i.e asset transactions) on the Polymesh network ?

SQL

WITH date_series AS (
    SELECT generate_series(
        DATE_TRUNC('day', NOW() - INTERVAL '120 days'),
        DATE_TRUNC('day', NOW()),
        INTERVAL '1 day'
    )::DATE AS day
), 
trading_days AS (
    SELECT 
        DATE_TRUNC('day', datetime)::DATE AS trading_day
    FROM 
        asset_transactions
    GROUP BY 
        trading_day
),
days_without_trading AS (
    SELECT 
        ds.day
    FROM 
        date_series ds
    LEFT JOIN 
        trading_days td ON ds.day = td.trading_day
    WHERE 
        td.trading_day IS NULL
)
SELECT 
    DATE_TRUNC('month', day) AS month,
    COUNT(day) AS days_without_trading
FROM 
    days_without_trading
GROUP BY 
    month
ORDER BY 
    month;

GraphQL

query {
  assetTransactions {
    nodes {
      createdBlock {
        datetime
      }
    }
  }
}

is query retrieves all the asset transactions along with their corresponding createdBlock.datetime field. The result will then need to be processed to calculate the number of days without trading activities.

Possible improvement #9

To support the query for calculating the number of days without trading activities directly in GraphQL, the schema could be updated by introducing new entities and fields. Add a TradingDay entity, add a DayWithoutTrading entity, add a DayWithoutTradingAggregateByMonth entity and modify the AssetTransaction entity to include a reference to the TradingDay and add a new query to retrieve the aggregated data.

Turnover ratio

This metric is helpful for assessing the efficiency and vibrancy of the market. A high turnover ratio indicates a liquid market with active trading, while a low ratio suggests the opposite.

How often assets are being traded, relative to their total supply (Weighted average)?

SQL

SELECT 
    SUM(weighted_turnover) / SUM(a.total_supply) AS weighted_avg_turnover_ratio
FROM (
    SELECT 
        assets.id AS asset_id, 
        assets.total_supply,
        SUM(asset_transactions.amount) AS total_volume,
        (SUM(asset_transactions.amount) / assets.total_supply) * assets.total_supply AS weighted_turnover
    FROM 
        asset_transactions
    JOIN 
        assets ON asset_transactions.asset_id = assets.id
    GROUP BY 
        assets.id, assets.total_supply
) AS a;

GraphQL

query {
  assets {
    nodes {
      id
      totalSupply
      transactions {
        nodes {
          amount
        }
      }
    }
  }
}

This query retrieves all the assets along with their corresponding id, totalSupply, and the related transactions with the amount field. The result will need then need to be processed to calculate the weighted average turnover ratio.

Individual asset turnover ratio

Individual asset turnover ratio helps understand how actively a specific asset is traded relative to its availability, offering insights into the liquidity and investor interest in that particular asset.

Last updated