0xtableauTest UDFs
    Updated 2023-02-24
    -- 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