0xHaM-dRef-finance in Total
Updated 2024-10-22
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
›
⌄
-- forked from ThalaSwap in Total @ https://flipsidecrypto.xyz/studio/queries/e66fbb1e-e278-4871-80a8-6152b78c0616
with swapEvent as (
select
block_timestamp,
TX_HASH,
TRADER,
SYMBOL_IN,
SYMBOL_OUT,
coalesce(AMOUNT_OUT_USD, AMOUNT_IN_USD) as amount_usd
from near.defi.ez_dex_swaps
where PLATFORM ilike ('%ref-finance%')
-- and block_timestamp::date >= '2024-01-01'
)
SELECT
count(DISTINCT tx_hash) as n_swaps,
count(DISTINCT TRADER) as unique_swapper,
sum (amount_usd) as volume,
volume/n_swaps as avg_vol_per_swap,
volume/unique_swapper as avg_vol_per_swappper,
FROM swapEvent
QueryRunArchived: QueryRun has been archived