messaridaily revenue copy
Updated 2024-09-04
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
›
⌄
-- forked from developer_viola / monthly revenue @ https://flipsidecrypto.xyz/developer_viola/q/e0sJIp0fxiVx/monthly-revenue
with klayswap as (
SELECT
livequery.live.udf_api(
'GET',
'https://api.llama.fi/summary/dexs/klayswap?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyVolume',
{ 'content-type': 'application/json;charset=utf-8' },
{ }
) AS response
),
klayswap_final as (
SELECT
DATE_TRUNC('day', TO_TIMESTAMP(v.value [0] :: INT)) AS day,
ROUND(v.value [1] :: FLOAT, 0) AS klayswap_volume
FROM
klayswap,
LATERAL FLATTEN(input = > response ['data'] ['totalDataChart']) AS v
ORDER BY
day DESC
),
dragonswap as (
SELECT
livequery.live.udf_api(
'GET',
'https://api.llama.fi/summary/dexs/dragonswap?excludeTotalDataChart=true&excludeTotalDataChartBreakdown=false&dataType=dailyVolume',
{ 'content-type': 'application/json;charset=utf-8' },
{ }
) AS response
),
dragonswap_final as (
SELECT
DATE_TRUNC('day', TO_TIMESTAMP(v.value [0] :: INT)) AS day,
ROUND(v.value [1] :: FLOAT, 0) AS dragonswap_volume
FROM
dragonswap,
LATERAL FLATTEN(input = > response ['data'] ['totalDataChart']) AS v
QueryRunArchived: QueryRun has been archived