Historical Stats
Getting project stats on an hourly or daily cadence
Hyperspace collects stats on projects and stores the historical stats in different time granularity. Stats are collected every 5 minutes and are rolled up to hourly and daily historical stats every hour and every day. There is a 5-10 minutes delay for 5 minutes interval stats, 15-20 minutes delay for hourly stats and 30-45 minutes delay for daily stats.
For example, let's say the time now is 4:05 PM, the 5 minutes stats of 3:55 PM to 4:00 PM is not available yet. To get the 5 minutes stats between 3:55-4:00, you can query at 4:10 PM.
To get the hourly stats between 3:00-4:00, you should query at around 4:15 PM.
To get the daily stats for the previous day, you should query at 30 minutes after the next day starts. Note daily stats are collected in UTC, so you need to query 30 minutes after the next day in UTC.
In addition, the historical stats of last 24 hours can be inaccurate, due to slow transactions processed after that stats collection period. To handle this, we run a stats cleaning process that ensures the accuracy of data 24 hours before.
The following fields are returned from the historical stats api
project_stat_hist_entries {
project_id
timestamp
volume
volume_usd
volume_double
volume_usd_double
floor_price
num_of_sales
max_price
twitter_followers
discord_members
num_of_token_holders
num_of_token_listed
}
project_id: the project id of the historical stats returned
timestamp: the end timestamp of the stat hist entry
volume: volume in sol within the entry period that ends at timestamp
volume_usd: volume in usd within the entry period that ends at timestamp
volume_double: volume in solana with double precision within the entry period that ends at timestamp
volume_usd_double: volume in usd with double precision within the entry period that ends at timestamp
floor_price: floor price in sol within the entry period that ends at timestamp
num_of_sales: number of sales within the entry period that ends at timestamp
max_price: max sale price within the entry period that ends at timestamp
twitter_followers: average number of twitter followers observed within the entry period that ends at timestamp
discord_members: average number of discord members observed within the entry period that ends at timestamp
num_of_token_holders: average number of token holders observed within the entry period that ends at timestamp
num_of_token_listed: average number of token listed observed within the entry period that ends at timestamp
​
Function: getProjectStatHistory
Inputs:
Condition Inputs:
  • [Required] projects
    • Type: Array of strings
    • Description: project to query against
    • Note: We only support passing in a single project
  • [Required] startTimestamp
    • Type: number
    • Description: timestamp exclusive
  • [Required] endTimestamp
    • Type: number
    • Description: timestamp inclusive
  • [Required] timeGranularity
    • Type: string / TimeGranularityEnum
    • Description: Either PER_HOUR or PER_DAY
Example:
const hsClient = new HyperspaceClient(
""
);
​
const input: GetProjectStatHistCondition = {
projects: ["fractals"],
startTimestamp: 1641128400,
endTimestamp: 1641158340,
timeGranularity: "PER_HOUR" as TimeGranularityEnum,
paginationInfo: {
page_number: 1,
page_size: 5,
},
};
​
hsClient
.getProjectStatHistory(input)
.then((result) => console.log(result))
.catch((err) => console.error(err));
​
Copy link