Soheil_MKUntitled Query
Updated 2022-07-20
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 kashi_pairs_onsen as (
select '0x6eafe077df3ad19ade1ce1abdf8bdf2133704f89' as CONTRACT_ADDRESS--usdc/xsushi
union
select '0x77f3a4fa35bac0ea6cfac69037ac4d3a757240a1' as CONTRACT_ADDRESS --dai/xsushi
union
select '0xff7d29c7277d8a8850c473f0b71d7e5c4af45a50' as CONTRACT_ADDRESS --usdt/weth
union
select '0x561770b93d0530390eb70e17acbbd6e5d2f52a31' as CONTRACT_ADDRESS --dai/link
union
select '0x0ea032decbfbea581d77d4a9b9c5e9db7c102a7c' as CONTRACT_ADDRESS --dai/aave
union
select '0x17fb5f39c55903de60e63543067031ce2b2659ee' as CONTRACT_ADDRESS --usdt/xsushi
union
select '0x668edab8a38a962d30602d6fa7ca489484ee3224' as CONTRACT_ADDRESS --usdc/wbtc
union
select '0xf678b4a096bb49309b81b2a1c8a966ef5f9756ba' as CONTRACT_ADDRESS --usdt/wbtc
union
select '0x3485a7c8913d640245e38564ddc05bfb40104635' as CONTRACT_ADDRESS --tusd/xsushi
union
select '0x5f92e4300024c447a103c161614e6918e794c764' as CONTRACT_ADDRESS --dai/weth
union
select '0x418bc3ff0ba33ad64931160a91c92fa26b35acb0' as CONTRACT_ADDRESS --dai/wbtc
),
main1_deposit as (
select
BLOCK_TIMESTAMP::date as date,
ORIGIN_TO_ADDRESS as contract,
amount_usd as onsen_depositors
from ethereum.sushi.ez_lending
WHERE action = 'Deposit'
and ORIGIN_TO_ADDRESS in (select CONTRACT_ADDRESS from kashi_pairs_onsen)
group by 1,2
),
main1_withdraw as (
Run a query to Download Data