Skip to main content

Price Change API

Get Price Change of a Token in 5 min, 1H, 6H, 24H​

You can get the price for current time, 5 minutes ago, 1 Hour ago, 6 hours ago and 24 hours using a single query. You can check the saved query here.

{
EVM(dataset: combined, network: eth) {
DEXTradeByTokens(
where: {
Block: {
Time: { since: "2024-06-02T08:18:00Z", till: "2024-06-03T08:18:00Z" }
}
Trade: {
Currency: {
SmartContract: { is: "0xaaeE1A9723aaDB7afA2810263653A34bA2C21C7a" }
}
Side: {
Currency: {
SmartContract: {
is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
}
}
}
}
}
) {
Trade {
start: Price(minimum: Block_Time)
min5: Price(
minimum: Block_Time
if: { Block: { Time: { after: "2024-06-03T08:13:00Z" } } }
)
hour1: Price(
minimum: Block_Time
if: { Block: { Time: { after: "2024-06-03T07:18:00Z" } } }
)
hour6: Price(
minimum: Block_Time
if: { Block: { Time: { after: "2024-06-03T02:18:00Z" } } }
)
end: Price(maximum: Block_Time)
}
}
}
}

Video Tutorial on How to Get Price Change of a Token for last 5 minutes, 1 hour, 6 hours, 24 hours using Bitquery API​