binhachonFuse Pool Analysis - Similar pool
Updated 2022-03-18
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 pool_allocation_transaction as (
select
distinct tx_id
from ethereum.events_emitted
where event_name = 'PoolAllocation'
and tx_succeeded = 'TRUE'
),
USDC_deposit_transaction as (
select
block_id,
block_timestamp,
event_inputs:to::string as pool_address,
case
when pool_address = '0x6f95d4d251053483f41c8718c30f4f3c404a8cf2' then 'Fuse 18'
when pool_address = '0x53de5a7b03dc24ff5d25ccf7ad337a0425dfd8d1' then 'Fuse 7'
when pool_address = '0x6447026fe96363669b5be2ee135843a5e4d15b50' then 'Fuse 14'
when pool_address = '0x5f9faed5599d86d2e6f8d982189d560c067897a0' then 'Fuse 15'
when pool_address = '0x94c49563a3950424a2a7790c3ef5458a2a359c7e' then 'Fuse R4'
when pool_address = '0x39aa39c021dfbae8fac545936693ac917d5e7563' then 'Compound'
when pool_address = '0xdb55b77f5e8a1a41931684cf9e4881d24e6b6cc9' then 'Fuse 6'
when pool_address = '0x3b624de26a6ceba421f9857127e37a5efd8ecaab' then 'Fuse 13'
when pool_address = '0x241056eb034bea7482290f4a9e3e4dd7269d4329' then 'Fuse 11'
when pool_address = '0x5f9faed5599d86d2e6f8d982189d560c067897a0' then 'Fuse 15'
when pool_address = '0x3dfd23a6c5e8bbcfc9581d2e864a68feb6a076d3' then 'AAVE'
when pool_address = '0x30647a72dc82d7fbb1123ea74716ab8a317eac19' then 'mStable'
else 'Other' end as pool_name,
case when contract_address = '0xe2f2a5c287993345a840db3b0845fbc70f5935a5' then event_inputs:value::float/1e18 else event_inputs:value::float/1e6 end as deposit_amount
from ethereum.events_emitted
where 1 = 1
and event_name = 'Transfer'
and tx_id in (select tx_id from pool_allocation_transaction)
-- and tx_to_address in ('0xc6bf8c8a55f77686720e0a88e2fd1feef58ddf4a', '0x66f4856f1bbd1eb09e1c8d9d646f5a3a193da569') --Rari USDC pool controller
and contract_address in ('0xe2f2a5c287993345a840db3b0845fbc70f5935a5', '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48') --mUSDC, USDC
and event_inputs:from::string = '0x66f4856f1bbd1eb09e1c8d9d646f5a3a193da569' --Rari USDC pool controller
),
USDC_deposit_over_time as (
Run a query to Download Data