Query editor
with base as (SELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'arbitrum' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Arbitrum')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'base' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Base')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'optimism' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Optimism')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'blast' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Blast')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'mantle' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Mantle')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'taiko' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Taiko')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'scroll' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Scroll')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'starknet' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/Starknet')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item)union ALLSELECTfrom_unixtime(CAST(item['date'] AS double)) AS time,'zkSync' as blockchain,CAST(item['tvl'] AS double) AS tvlFROM UNNEST(CAST(json_parse(HTTP_GET('https://api.llama.fi/v2/historicalChainTvl/ZKsync Era')) AS ARRAY(MAP(VARCHAR, JSON)))) AS t (item))select time, initcap(blockchain) as blockchain, tvlfrom basewhere time >= date('2022-01-01')