Spectertakers and maker volume (usd)
Updated 2024-11-04
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 Single and multi-outcome markets @ https://flipsidecrypto.xyz/studio/queries/adec02a5-d93c-47ae-9ba1-7cbe6f164779
WITH predictfun AS (
SELECT
block_timestamp,
decoded_log:taker as taker,
'taker' AS Type,
CASE
WHEN decoded_log:takerAssetId = 0 then decoded_log:takerAmountFilled
end / 1e18 as Amount_USD
FROM blast.core.fact_decoded_event_logs
where contract_address in ('0x739f0331594029064c252559436edce0e468e37a', '0x6a3796c21e733a3016bc0ba41edf763016247e72')
--and tx_hash = '0x9723decd36215e9b6433246cfe8437c44a3d3de416a1bd113aef408b1a098f36'
AND event_name = 'OrderFilled'
UNION ALL
SELECT
block_timestamp,
decoded_log:maker as maker, 'Maker' AS Type,
CASE
when decoded_log:makerAssetId = 0 then decoded_log:makerAmountFilled
end / 1e18 as Amount_USD
FROM blast.core.fact_decoded_event_logs
where contract_address in ('0x6a3796c21e733a3016bc0ba41edf763016247e72', '0x739f0331594029064c252559436edce0e468e37a')
--and tx_hash = '0x9723decd36215e9b6433246cfe8437c44a3d3de416a1bd113aef408b1a098f36'
AND event_name = 'OrderFilled'
)
SELECT type,
SUM(Amount_USD) AS Volume
FROM predictfun
GROUP BY type
QueryRunArchived: QueryRun has been archived