theericstone⚡️ Get Historical MCAP + Price Snapshots via LiveQuery
Updated 2024-08-12
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
›
⌄
-- forked from ⚡️ Get Current MCAP + Price Snapshots via LiveQuery
-- @ https://flipsidecrypto.xyz/edit/queries/dff633bc-4eae-46fe-80a3-47d27e1f8b72
-- Coingecko 🤝 Flipside LiveQuery Function
-------------------------------------------------------------------------
with response as (
SELECT live.udf_api(
'GET',
'https://api.coingecko.com/api/v3/coins/list',
{'x-cg-demo-api-key':'{apikey}'},
{},
'coingecko') as resp
),
tokens as (
select
value:id::string as id,
value:name::string as name,
value:symbol::string as symbol
from response,
lateral flatten (input => resp:data)
)
select * from tokens
where name ilike any (
'bitcoin','ethereum','solana',
'avalanche','axelar','sei',
'aptos','arbitrum','base',
'blast','cosmos','flow',
'near protocol','optimism','polygon',
'sui','thorchain','klaytn'
)
QueryRunArchived: QueryRun has been archived