ArioPools Details
Updated 2023-10-10
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 Pools Details @ https://flipsidecrypto.xyz/edit/queries/efbe20d3-86b4-4b9e-a8ea-58237aff98e1
with
price_{{Blokchain}} as (
select
date_trunc({{Granularity}}, HOUR) as date,
TOKEN_ADDRESS,
avg(PRICE) as avg_Price
from
{{Blokchain}}.price.ez_hourly_token_prices
where 1=1
and TOKEN_ADDRESS is not NULL
group by
1,
2
),
tab1 as (
SELECT
Pool_name,
count(distinct tx_hash) as "# Swap",
count(DISTINCT ORIGIN_FROM_ADDRESS) as "# Sawpper",
sum(AMOUNT_IN * avg_Price) as "Swap Volume ($)",
avg(AMOUNT_IN * avg_Price) as "Avg Swap Volume ($)"
from
{{Blokchain}}.defi.ez_dex_swaps a
join price_{{Blokchain}} b on date_trunc({{Granularity}}, block_timestamp) = b.date
and a.TOKEN_IN = b.TOKEN_ADDRESS
where
BLOCK_TIMESTAMP::date between '{{Start_date}}' and '{{End_date}}'
and platform in ('trader-joe-v1', 'trader-joe-v2')
and pool_name not in ('ORBIT-WAVAX')
group by 1
having sum(AMOUNT_IN * avg_Price) < 4e8
),
tab2 as (
SELECT
Run a query to Download Data