datavortexTotals
Updated 2024-10-20
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
›
⌄
WITH CurrentPeriod AS (
SELECT
swaps.tx_hash AS SwapTxHash,
swaps.platform AS PlatformName,
swaps.amount_in_usd AS TotalVolumeUSD,
core.tx_fee AS TxFeeMATIC,
swaps.origin_from_address AS Swapper
FROM
polygon.defi.ez_dex_swaps AS swaps
LEFT JOIN
polygon.core.fact_transactions AS core
ON
swaps.tx_hash = core.tx_hash
WHERE
swaps.block_timestamp >= DATEADD(MONTH, -3, CURRENT_DATE)
AND swaps.block_timestamp < CURRENT_DATE
AND swaps.platform = 'quickswap-v3'
),
PreviousPeriod AS (
SELECT
swaps.tx_hash AS SwapTxHash,
swaps.platform AS PlatformName,
swaps.amount_in_usd AS TotalVolumeUSD,
core.tx_fee AS TxFeeMATIC,
swaps.origin_from_address AS Swapper
FROM
polygon.defi.ez_dex_swaps AS swaps
LEFT JOIN
polygon.core.fact_transactions AS core
ON
swaps.tx_hash = core.tx_hash
WHERE
swaps.block_timestamp >= DATEADD(MONTH, -6, CURRENT_DATE)
AND swaps.block_timestamp < DATEADD(MONTH, -3, CURRENT_DATE)
AND swaps.platform = 'quickswap-v3'
),
QueryRunArchived: QueryRun has been archived