Returns bucketed stats for a given token within a pair.
Endpoint: getDetailedPairStats
Method: POST
Arguments
Name | Type | Description |
---|---|---|
bucketCount | Int | The number of aggregated values to receive. Note: Each duration has predetermined bucket sizes. |
durations | [DetailedPairStatsDuration] | The list of durations to get detailed pair stats for. |
networkId | Int! | The network ID the pair is deployed on. Required |
pairAddress | String! | The contract address of the pair. Required |
statsType | TokenPairStatisticsType | The type of statistics returned. Can be |
timestamp | Int | The unix timestamp for the stats. Defaults to current. |
tokenOfInterest | TokenOfInterest | The token of interest used to calculate token-specific stats for the pair. Can be |
Response
Name | Type | Description |
---|---|---|
bucketCount | Int | Number of aggregated buckets specified in input |
lastTransaction | Int | The unix timestamp for the last transaction to happen on the pair. |
networkId | Int! | The network ID the pair is deployed on. |
pair | Pair | |
pairAddress | String! | The contract address of the pair. |
queryTimestamp | Int | The timestamp specified as input to the query |
stats_day1 | WindowedDetailedPairStats | The breakdown of stats over a 24 hour window. |
stats_day30 | WindowedDetailedPairStats | The breakdown of stats over a 30 day window. |
stats_hour1 | WindowedDetailedPairStats | The breakdown of stats over an hour window. |
stats_hour4 | WindowedDetailedPairStats | The breakdown of stats over a 4 hour window. |
stats_hour12 | WindowedDetailedPairStats | The breakdown of stats over a 12 hour window. |
stats_min5 | WindowedDetailedPairStats | The breakdown of stats over a 5 minute window. |
stats_min15 | WindowedDetailedPairStats | The breakdown of stats over a 15 minute window. |
stats_week1 | WindowedDetailedPairStats | The breakdown of stats over a 7 day window. |
statsType | TokenPairStatisticsType! | The type of statistics returned. Can be FILTERED or UNFILTERED |
tokenOfInterest | TokenOfInterest | The token of interest used to calculate token-specific stats. |
Picking Duration
The duration
chosen as input for the query will be used in the following ways:
- Provides the
currentValue
,previousValue
, and percentchange
between the two. - Determines the bucket size and default
bucketCount
(the number of buckets per window) that will be returned.
Buckets Explained
Duration | Bucket Size | Default bucketCount |
---|---|---|
5 minutes | 1 minute | 5 + 1 = 6 |
15 minutes | 1 minute | 15 + 1 = 16 |
1 hour | 5 minutes | 12 + 1 = 13 |
4 hours | 30 minutes | 8 + 1 = 9 |
12 hours | 1 hour | 12 + 1 = 13 |
1 day | 4 hours | 6 + 1 = 7 |
1 week | 12 hours | 14 + 1 = 15 |
30 days | 1 day | 30 + 1 = 31 |
Bucket sizes are predetermined for each duration. The first n-1 buckets are always historical, while the last bucket is a snapshot of current data. Defaults for bucketCount
are displayed above, but can be overridden by query input to receive more or less aggregated values.
For example, requesting a min5
duration with a bucketCount
of 11 at 12:00:30PM will return
- aggregated stats and the percent change between
- the most current 5 minute window (11:55AM-12:00PM),
- the previous 5 minute window (11:50AM-11:55AM).
- 10 completed aggregated stats for each minute over those 10 minutes (11:50AM-11:51AM ... 11:59AM-12:00PM) plus 1 partial snapshot of stats for the current minute (12:00:00PM-12:00:30PM).
- the first 5 stats will add up to the
previousValue
, - the second 5 stats will add up to the
currentValue
.
- the first 5 stats will add up to the
Explore
Ask questions, share what you're working on and request new features 👬👭