zero-ndoLtScount of long and short
Updated 2022-06-30Copy Reference Fork
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 long as
(
select block_timestamp::date as dte, tx_hash, AMOUNT_IN from ethereum.core.ez_dex_swaps
where TOKEN_OUT = lower('0xf1B99e3E573A1a9C5E6B2Ce818b617F0E664E86B')
-- select * from ethereum.core.ez_token_transfers where ORIGIN_TO_ADDRESS='0xd7c3157b4823079fb4684a423e981927a12c78fb'
),
nft_trans as
(
select *,rank () over( partition by tokenid order by block_timestamp desc) as rank from ethereum.core.ez_nft_transfers
where NFT_ADDRESS=lower('0xa653e22A963ff0026292Cc8B67941c0ba7863a38')
and event_type='mint'
),
short as
(
select block_timestamp::date as dte, tx_hash, AMOUNT from ethereum.core.ez_token_transfers
where tx_hash in
(select tx_hash from nft_trans
)
and contract_address='0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'
)
select 'long' as position,count(distinct tx_hash) as count from long
UNION
select 'short' as position,count(distinct tx_hash) as count from short
Run a query to Download Data