seaweed-uew7B4defillama_example
    Updated 2024-02-06
    /***
    -- Get Chain TVL--
    SELECT * FROM external.defillama.fact_chain_tvl LIMIT 10
    -- Get DEX Volume --
    SELECT * FROM external.defillama.fact_dex_volume
    WHERE date >= current_date - interval '1 days'
    LIMIT 10
    -- Fetch live data directly fron the API
    SELECT
    livequery.live.udf_api('https://api.llama.fi/protocol/pancakeswap') as response;
    SELECT
    livequery.live.udf_api('https://api.llama.fi/chains') as response;
    ***/

    --SELECT
    --livequery.live.udf_api('https://api.llama.fi/protocol/pancakeswap') as response;

    select date, sum(volume) as volume
    from external.defillama.fact_dex_volume
    where protocol like '%sushi%'
    --curve dex
    --uniswap v3
    and date >= '2024-01-19'
    and date <= '2024-02-02'
    group by 1


    Last run: about 1 year ago
    DATE
    VOLUME
    1
    2024-02-02 00:00:00.00014837950
    2
    2024-01-31 00:00:00.00028536203
    3
    2024-01-30 00:00:00.00036821750
    4
    2024-01-21 00:00:00.00026992392
    5
    2024-02-01 00:00:00.00017387075
    6
    2024-01-29 00:00:00.00019792985
    7
    2024-01-28 00:00:00.00019145387
    8
    2024-01-25 00:00:00.00021770311
    9
    2024-01-24 00:00:00.00021586652
    10
    2024-01-19 00:00:00.00035930277
    11
    2024-01-20 00:00:00.00030123427
    12
    2024-01-26 00:00:00.00016159883
    13
    2024-01-22 00:00:00.00040587532
    14
    2024-01-27 00:00:00.00016092623
    15
    2024-01-23 00:00:00.00023450164
    15
    556B
    2s