OHLC of a currency on multiple blockchains
Historical data The Trading cube covers real time and roughly the last 30 days. For anything older, rebuild the same numbers from raw trades with DEXTradeByTokens. Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/ Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retenti
What it returns
- currency ID
- currency name
- currency symbol
- block date
- block time
- timestamp
- start
- duration
- end
- base
- base attributed to USD
- quote
- USD
- is quoted in USD
- open
- high
- low
- close
- estimate
- exponential moving
- mean
- simple moving
- weighted simple moving
Filters
- currency ID is bid:bitcoin
- time duration is 60
The query
# Historical data
# The Trading cube covers real time and roughly the last 30 days. For
# anything older, rebuild the same numbers from raw trades with
# DEXTradeByTokens.
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
# For more info on the endpoint visit -
# https://docs.bitquery.io/docs/trading/crypto-price-api/introduction/
# For faster results try using indexed feilds in where and orderBy clause -
# https://docs.bitquery.io/docs/graphql/indexed-fields-reference/
# For OHLC of a currency from a particular pair use Pairs cube instead of
# Currency
{
Trading {
Currencies(
where: {
Currency: { Id: { is: "bid:bitcoin" } },
Interval: { Time: { Duration: { eq: 60 } } }
},
limit: { count: 1 },
orderBy: { descending: Interval_Time_Start }
) {
Currency {
Id
Name
Symbol
}
Block {
Date
Time
Timestamp
}
Interval {
Time {
Start
Duration
End
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
Price {
IsQuotedInUsd #The price is shown in USD (`IsQuotedInUsd: true` by default).
Ohlc {
Open # Earliest price across chains in the interval
High # Highest price across chains in the interval
Low # Lowest price across chains in the interval
Close # Latest price across chains in the interval
}
Average {
Estimate
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
}
}
}
}
Similar queries
- Currency Liquidity Across Chains · Trading (all chains) · Currencies
- Latest Bitcoin Price (Trading API) · Trading (all chains) · Currencies
- Arbitrum mcap · Trading (all chains) · Currencies
- btc volume, tokens vs currency cube · Trading (all chains) · Currencies
- tv-currency · Trading (all chains) · Currencies