bachisushi lp stat5
Updated 2022-08-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
26
27
28
29
30
31
32
33
34
35
36
›
⌄
WITH pool_details AS
(
SELECT address
FROM ethereum.core.dim_labels
WHERE label ='sushiswap'
AND label_type= 'dex'
AND label_subtype='pool' ),
yield_farmers as (
select count(distinct yield_farmer) as no_of_yield_farmers from (
SELECT Date(block_timestamp) AS day,
tx_id,
tx_from_address AS yield_farmer,
event_inputs:value /pow(10,15) AS total_amount
FROM ethereum.events_emitted
WHERE tx_to_address = '0xef0881ec094552b2e128cf945ef17a6752b4ec5d'
and event_inputs:from = tx_from_address
and event_name = 'Transfer'
and tx_succeeded = 'TRUE'
AND contract_address IN
(
SELECT *
FROM pool_details)
)
),
liquidity_providers as (
select count(distinct lper_address) as no_of_liq_providers from
(
SELECT Date(block_timestamp) AS day,
tx_hash,
origin_from_address AS lper_address,
event_inputs:value /pow(10,15) AS total_amount
FROM ethereum.core.fact_event_logs e
WHERE event_inputs:from = '0x0000000000000000000000000000000000000000'
Run a query to Download Data