Skip to content

Commit

Permalink
Merge pull request #14478 from mseidlx/patch-2
Browse files Browse the repository at this point in the history
Switch to weekly active addresses and smaller growthepie API endpoint
  • Loading branch information
corwintines authored Dec 18, 2024
2 parents 343fe12 + cc0343d commit 3497a53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/api/fetchGrowThePie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const TXCOSTS_MEDIAN_USD = "txcosts_median_usd"
const TXCOUNT = "txcount"

export const fetchGrowThePie = async (): Promise<GrowThePieData> => {
const url = "https://api.growthepie.xyz/v1/fundamentals_full.json"
const url = "https://api.growthepie.xyz/v1/fundamentals.json"

const response = await fetch(url)
if (!response.ok) {
console.log(response.status, response.statusText)
throw new Error("Failed to fetch GrowThePie data")
throw new Error("Failed to fetch growthepie data")
}
const data: DataItem[] = await response.json()

Expand All @@ -27,7 +27,7 @@ export const fetchGrowThePie = async (): Promise<GrowThePieData> => {

const activeAddresses = data
.filter((item) => item.date === mostRecentDate)
.filter((item) => item.metric_key === "daa")
.filter((item) => item.metric_key === "aa_last7d")
.reduce((acc, item) => {
return {
...acc,
Expand Down

0 comments on commit 3497a53

Please sign in to comment.