bachisushi lp stat6
Updated 2022-08-24
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,
day
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) )
GROUP BY day
ORDER BY day DESC ),
liquidity_providers AS
(
SELECT count(DISTINCT lper_address) AS no_of_liq_providers,
day
FROM (
SELECT date(block_timestamp) AS day,
tx_hash,
Run a query to Download Data