chispascombined tables flux
Updated 2023-09-24Copy Reference Fork
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
›
⌄
SELECT
date_trunc('day', a.block_timestamp) as date,
SUM(a.swap_from_amount) AS volume,
SUM(SUM(a.swap_from_amount)) OVER (
ORDER BY
DATE_TRUNC('day', a.block_timestamp)
) AS cumulative_volume
FROM
solana.defi.fact_swaps a
JOIN
solana.core.fact_events b
ON
a.program_id = b.program_id
WHERE
a.swap_from_mint = 'So11111111111111111111111111111111111111112'
AND a.swap_to_mint = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v'
AND a.succeeded = 'TRUE'
AND b.program_id = 'FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X'
AND a.block_timestamp >= current_date - 30
GROUP BY
date
ORDER BY
date DESC
Run a query to Download Data