0xtableauTest UDFs
Updated 2023-02-24
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
›
⌄
-- decode hex to int
-- select livequery.utils.udf_hex_to_int('0x13BA');
-- utils.udf_register_secret
-- livequery.live.udf_api
WITH base AS (
SELECT
livequery.live.udf_api(
'GET',
'https://api.llama.fi/chains',{},{},''
) AS READ,
SYSDATE()
)
SELECT
VALUE :chainId :: INTEGER AS chainID,
VALUE :cmcId :: INTEGER AS cmcID,
VALUE :name :: STRING AS NAME,
VALUE :tokenSymbol :: STRING AS tokenSymbol,
round(VALUE :tvl :: FLOAT,2) AS tvl
FROM
base,
LATERAL FLATTEN(
input => READ :data
)
ORDER BY
tvl DESC;
Run a query to Download Data