HBAR Price: Average USD Conversion
Overview
The HBAR Price statistic provides the latest price of HBAR, aggregated from multiple sources. This statistic is essential for tracking the value of HBAR in real time and analyzing price trends over different timeframes. Minute-level granularity is now available for high-frequency price tracking.
To access this Hedera network statistic (and others) via Hgraph's GraphQL & REST APIs, get started here.
Hedera Stat Name: avg_usd_conversion
Methodology
- Data Sources: Binance, Bybit, OKX, Bitget and MEXC
- Aggregation:
- The average of candlestick closing prices for a given period for the HBAR/USDT pair on the five major exchanges by trading volume was calculated.
- The price is multiplied by 100,000 for integer representation for each time period.
Data Representation
Each period represents the latest available HBAR price at the given timestamp. This metric is useful for tracking price fluctuations and market trends.
Additional Notes
- HBAR price fluctuations can be influenced by market conditions, trading volume, and broader crypto trends.
- Minute-level data provides real-time price tracking and is retained for 72 hours to balance data freshness with storage efficiency.
- Future enhancements may include price history tracking, moving averages, and volatility analysis.
GraphQL API Examples
Test out these queries using our developer playground.
Fetch most recent HBAR price
query GetHBARPrice {
metric: ecosystem_metric(
where: {name: {_eq: "avg_usd_conversion"}}
order_by: {end_date: desc_nulls_last}
limit: 1
) {
total
end_date
}
}
Fetch minute-level HBAR price (last 2 hours)
query MinuteHBARPrice {
metric: ecosystem_metric(
order_by: {end_date: desc_nulls_last}
limit: 120
where: {name: {_eq: "avg_usd_conversion"}, period: {_eq: "minute"}}
) {
total
end_date
}
}
Fetch hourly HBAR price (timeseries, 365 days)
query HourlyHBARPrice {
metric: ecosystem_metric(
order_by: {end_date: desc_nulls_last}
limit: 8760
where: {name: {_eq: "avg_usd_conversion"}, period: {_eq: "hour"}}
) {
total
end_date
}
}
7 day percentage change (168 hours)
query HBAR7DayChange {
current: ecosystem_metric(
where: {name: {_eq: "avg_usd_conversion"}, period: {_eq: "hour"}}
order_by: {start_date: desc}
limit: 1
offset: 0
) {
total
}
previous: ecosystem_metric(
where: {name: {_eq: "avg_usd_conversion"}, period: {_eq: "hour"}}
order_by: {start_date: desc}
limit: 1
offset: 168
) {
total
}
}
Note: Divide the response by
100000
to place decimal for USD formatting.
Available Time Periods
The period
field supports the following values:
minute
- High-frequency data updated every minute (retained for 72 hours)hour
- Hourly aggregated dataday
- Daily aggregated data
SQL Implementation
Below is a link to the Hedera Stats GitHub repository. The repo contains the SQL function that calculates the HBAR Price statistic outlined in this methodology.
SQL Function: ecosystem.avg_usd_conversion
Dependencies
- Hedera mirror node
- APIs: Binance, Bybit, OKX, Bitget and MEXC