diff --git a/src/data-layer/fetchers/fetchTotalValueLocked.ts b/src/data-layer/fetchers/fetchTotalValueLocked.ts index 4aa1787586f..5da934ccfab 100644 --- a/src/data-layer/fetchers/fetchTotalValueLocked.ts +++ b/src/data-layer/fetchers/fetchTotalValueLocked.ts @@ -7,7 +7,7 @@ export const FETCH_TOTAL_VALUE_LOCKED_TASK_ID = "fetch-total-value-locked" * Returns the latest total liquidity USD value for Ethereum. */ export async function fetchTotalValueLocked(): Promise { - const url = "https://api.llama.fi/charts/Ethereum" + const url = "https://api.llama.fi/v2/historicalChainTvl/Ethereum" console.log("Starting total value locked data fetch from DefiLlama") @@ -26,7 +26,7 @@ export async function fetchTotalValueLocked(): Promise { } // Today's value at end of array - const value = json[json.length - 1].totalLiquidityUSD + const value = json[json.length - 1].tvl const timestamp = Date.now() console.log("Successfully fetched total value locked data", { diff --git a/src/lib/types.ts b/src/lib/types.ts index fc402063c8e..bc35853c6f4 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -588,8 +588,8 @@ export type EtherscanTxCountResponse = { } export type DefiLlamaTVLResponse = { - date: string - totalLiquidityUSD: number + date: number + tvl: number }[] export type MetricReturnData = ValueOrError