sofiatabsent-coffee
Updated 2025-02-24
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
›
⌄
with raw_volume as (
SELECT
SUM(CASE WHEN SYMBOL_IN = 'WETH' THEN AMOUNT_IN ELSE AMOUNT_OUT END) as total_weth_volume,
SUM(CASE WHEN SYMBOL_IN = 'BID' THEN AMOUNT_IN ELSE AMOUNT_OUT END) as total_bid_volume
--SUM(amount_usd) as total_usd_volume
FROM base.defi.ez_dex_swaps
WHERE PLATFORM = 'aerodrome'
AND pool_name = 'WETH-BID'
AND BLOCK_TIMESTAMP >= current_timestamp - INTERVAL '24 hours'
)
select *, total_weth_volume * 0.003 as weth_fees, total_bid_volume * 0.003 as bid_fees from raw_volume
-- select * from base.defi.ez_dex_swaps where PLATFORM = 'aerodrome' and pool_name = 'WETH-BID'
-- AND BLOCK_TIMESTAMP >= current_timestamp - INTERVAL '24 hours'
--contract_address = '0x74F22A01Da78294f8dF640C98A414FE209e33f60'
--rder by BLOCK_TIMESTAMP desc