StangFAST02 : Strategy : part 2
Updated 2023-03-05
999
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 prices AS
(
SELECT
date( fp.hour ) AS date
, avg( fp.price ) AS avg_sushi_price
FROM
ethereum.core.fact_hourly_token_prices fp
WHERE
date BETWEEN '2022-06-01' AND current_date
AND fp.symbol = 'SUSHI'
GROUP BY
date
)
, arbitrum_chain AS
(
SELECT
'arbitrum' AS chain
, date_trunc( 'month' , ez.block_timestamp ) AS date
, count( DISTINCT ez.tx_hash ) AS tx_count
, count( DISTINCT ez.origin_from_address ) AS unique_user
, CASE
when ez.action = 'Repay' then 'Repay'
when ez.action = 'Borrow' then 'Borrow'
END
AS type
, sum
(
CASE
when type = 'Repay' then ez.amount_usd
when type = 'Borrow' then ez.amount_usd
END
Run a query to Download Data