Stablecoin Market Cap
The Stablecoin Market Cap metric tracks the market capitalization of stablecoins circulating on the Hedera network as reported by DeFiLlama. This metric provides insight into the adoption and liquidity of stablecoins within the ecosystem.
To access this Hedera network statistic (and others) via Hgraph's GraphQL & REST APIs, get started here.
Methodology
Data Source
- Fetch Method: Stablecoin data is retrieved via an HTTP call to DeFiLlama’s Hedera endpoint at https://stablecoins.llama.fi/stablecoincharts/Hedera.
- JSON Structure: The API returns an array of JSON objects, each containing:
date
(Unix time in seconds)totalCirculating
(a nested JSON object from which thepeggedUSD
value is extracted)
Aggregation & Processing
- Parse JSON: Each JSON record is parsed from the API response.
- Extract Market Cap: The
peggedUSD
value is extracted from thetotalCirculating
object to represent the stablecoin market cap. - Convert Timestamps: The
date
field is converted from Unix time (seconds) to a timestamp usingto_timestamp(date_sec)
. - Define Time Period: A day-long time range is created for each record by subtracting one day from the converted timestamp. This range is represented as an
int8range
(with the start and end timestamps in nanoseconds). - No Grouping or Averaging: Each record directly corresponds to a day-long period. There is no grouping of multiple records or averaging of market cap values.
Data Representation
- Output Columns:
timestamp_range
: A Postgresint8range
indicating the start and end timestamps (in nanoseconds) of the day-long period.total
: The stablecoin market cap (in USD) for that period, derived directly from thepeggedUSD
value.
Use Case Example
This statistic helps gauge network health by tracking the liquidity and adoption of stablecoins, which are vital for smooth financial transactions. A sustained increase in stablecoin market cap can indicate growing confidence in the network's financial ecosystem.
SQL Implementation
Below is a link to the Hedera Stats GitHub repository. The repo contains the SQL function that calculates the Stablecoin Market Cap statistic outlined in this methodology.
SQL Function: ecosystem.dashboard_stablecoin_marketcap
Dependencies
- Hedera mirror node
- Internet access (to fetch data via
http_get
from DeFiLlama)