Flipside Community3a) Trade volume among new users polygon defi
Updated 2024-05-29
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
30
31
32
33
34
35
36
›
⌄
-- forked from 3a) Trade volume among new users @ https://flipsidecrypto.xyz/edit/queries/9c0fcc7d-b004-4c15-a126-2f008da4bcbc
with polygon as (
with addresses as (
select
from_address,
min(block_timestamp) as first_transaction_sent
from
polygon.core.fact_transactions
group by
from_address
having
first_transaction_sent >= '{{Start_date}}'
),
volume_traded as (
(
select
block_timestamp :: date as date,
origin_from_address as from_address,
amount_in_usd as amount_usd
from
polygon.defi.ez_dex_swaps
where
block_timestamp >= '{{Start_date}}'
and origin_from_address in (
select
from_address
from
addresses
)
)
)
select
'polygon' as chain,
date,
sum(amount_usd) as trade_volume
from
QueryRunArchived: QueryRun has been archived