DataBeingEarly Redemption Percentage
Updated 2022-07-27
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
›
⌄
with penalty_address as (SELECT block_timestamp, amount, amount_usd, origin_from_address
FROM ethereum.core.ez_token_transfers
WHERE origin_function_signature = lower('0xbe5021ec') and to_address = lower('0xa45645ebb075a96d1c89511e28d3e9b94f3b7905')),
withdrawn_early as (SELECT distinct t.block_timestamp, t.symbol, t.to_address, t.amount, t.amount_usd
FROM ethereum.core.ez_token_transfers as t
JOIN penalty_address as p on t.block_timestamp = p.block_timestamp and t.to_address = p.origin_from_address
WHERE symbol = 'WETH' and from_address = lower('0xa4B41efc1B6F73355c90119aeeFDdB1ffcf907b0') and to_address != lower('0xa45645ebb075a96d1c89511e28d3e9b94f3b7905') and origin_function_signature = '0xbe5021ec'),
withdrawn_sum as (SELECT sum(amount) as sum_withdrawn, sum(amount_usd) as sum_withdrawn_usd, symbol
FROM withdrawn_early
GROUP BY 3),
eth_sent as (SELECT sum(amount)amount_eth, sum(amount_usd)amount_usd, symbol
FROM ethereum.core.ez_token_transfers
WHERE to_address = lower('0xa4b41efc1b6f73355c90119aeefddb1ffcf907b0') and symbol = 'WETH'
GROUP BY 3 )
SELECT sum_withdrawn/amount_eth * 100 as percent_eth, sum_withdrawn_usd/amount_usd * 100 as percent_in_usd, w.symbol
FROM withdrawn_sum as w
JOIN eth_sent as e on w.symbol = e.symbol
GROUP BY 1,2, 3
/* sum amount and sum withdrawn to get a piechart */
Run a query to Download Data