sakineh5021-nIQRzBtotal TVL (polygon)
Updated 2022-03-26
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 inflow as (
SELECT SYMBOL , sum(AMOUNT_USD) as inpu , sum(amount) as inpu_num
from polygon.udm_events
where (to_address = '0x0319000133d3ada02600f0875d2cf03d442c3367'
or to_address = '0xe2f736b7d1f6071124cbb5fc23e93d141cd24e12')
and event_type = 'erc20_transfer'
and symbol is not null
group by 1
) ,
outflow as (
SELECT SYMBOL , sum(AMOUNT_USD) as outpu , sum(amount) as outpu_num
from polygon.udm_events
where (from_address = '0x0319000133d3ada02600f0875d2cf03d442c3367'
or from_address = '0xe2f736b7d1f6071124cbb5fc23e93d141cd24e12')
and event_type = 'erc20_transfer'
and symbol is not null
group by 1
)
,
lock as (
SELECT o.SYMBOL as locked_token ,inpu_num-outpu_num as NUMBER_OF_LOCKED_TOKENS
, inpu-outpu as AMOUNT_USD
from inflow I , outflow o
where O.symbol= I.Symbol
order by 3 DESC
limit 40 )
SELECT sum( AMOUNT_USD)
from lock
Run a query to Download Data