Flipside TeamDragonSwap APY copy
Updated 2024-08-26
999
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
34
35
36
›
⌄
with price_tab as (
select *
from(
SELECT
TO_TIMESTAMP(log.value[0] :: string) as pdate,
log.value[1]:: string as prices,
'WKLAY' :: string as token_symbol,
'0x19aac5f612f524b754ca7e7c41cbfa2e981a4432' :: string as token_contract,
rank() over(order by TO_TIMESTAMP(log.value[0] :: string) desc) as rank
FROM (SELECT livequery.live.udf_api('https://api.coingecko.com/api/v3/coins/klay-token/market_chart?vs_currency=usd&days=365&interval=daily&precision=3') as resp)
,LATERAL FLATTEN (input => resp:data:prices) log
UNION all
SELECT
TO_TIMESTAMP(log.value[0] :: string) as pdate,
log.value[1]:: string as prices,
'USDT' :: string as token_symbol,
'0x5c13e303a62fc5dedf5b52d66873f2e59fedadc2' :: string as token_contract,
rank() over(order by TO_TIMESTAMP(log.value[0] :: string) desc) as rank
FROM (SELECT livequery.live.udf_api('https://api.coingecko.com/api/v3/coins/tether/market_chart?vs_currency=usd&days=365&interval=daily&precision=3') as resp)
,LATERAL FLATTEN (input => resp:data:prices) log
UNION all
SELECT
TO_TIMESTAMP(log.value[0] :: string) as pdate,
log.value[1]:: string as prices,
'BORA' :: string as token_symbol,
'0x02cbe46fb8a1f579254a9b485788f2d86cad51aa' :: string as token_contract,
rank() over(order by TO_TIMESTAMP(log.value[0] :: string) desc) as rank
FROM (SELECT livequery.live.udf_api('https://api.coingecko.com/api/v3/coins/bora/market_chart?vs_currency=usd&days=365&interval=daily&precision=3') as resp)
,LATERAL FLATTEN (input => resp:data:prices) log
UNION all
QueryRunArchived: QueryRun has been archived