freemartianEarly Redemption Percentage
Updated 2023-04-18
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
›
⌄
with early_redemptions as (
SELECT
distinct tx_hash
from ethereum.core.ez_token_transfers
where origin_to_address = '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'
and contract_address = '0xb4bd4628e6efb0cb521d9ec35050c75840320374'
and from_address= '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'),
early_eth as (
SELECT
sum(event_inputs:value)/pow(10,18) as Early_ETH_Redeemed
from ethereum.core.fact_event_logs
where origin_to_address = '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'
and contract_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
and event_inputs:from = '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'
and event_inputs:to != '0xa45645ebb075a96d1c89511e28d3e9b94f3b7905'
and tx_hash in ( select tx_hash from early_redemptions)),
locked_eth as (
select
sum(event_inputs:value)/pow(10,18) as Total_ETH_locked
from ethereum.core.fact_event_logs
where origin_to_address = '0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0'
and contract_address = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
and event_name = 'Transfer'
)
select (Early_ETH_Redeemed/Total_ETH_locked)*100 as early_redeem_percentage
from locked_eth, early_eth
Run a query to Download Data