scottincryptoQuickswap WMATIC/MaticX Staker Balances -
Updated 2022-10-04
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 dates as (
select
date_day as block_day
from ethereum.core.dim_dates
where date_day > '2022-04-26'
and date_day <= current_date
)
, stakes as (
select
date_trunc('day', block_timestamp) as block_day
, event_inputs:user as wallet_address
, sum(event_inputs:amount::int) / 1e18 as stake_amount
from polygon.core.fact_event_logs
where 1=1
and contract_address = '0x1e16ecc4f912d8db04b8177b4186bb597267fc25' -- Quickswap WMATIC/MaticX staking contract
and event_name = 'Staked'
and block_day > '2022-04-26'
and tx_status = 'SUCCESS'
group by block_day, wallet_address
order by block_day
)
, withdraws as (
select
date_trunc('day', block_timestamp) as block_day
, event_inputs:account as wallet_address
, sum(event_inputs:amount::int) / 1e18 as withdraw_amount
from polygon.core.fact_event_logs
where 1=1
and contract_address = '0x1e16ecc4f912d8db04b8177b4186bb597267fc25' -- Quickswap WMATIC/MaticX staking contract
and event_name = 'Withdrawn'
and block_day > '2022-04-26'
and tx_status = 'SUCCESS'
group by block_day, wallet_address
order by block_day
Run a query to Download Data