Pine Analyticsaxl final 1-1 copy copy
Updated 2023-12-14
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
›
⌄
-- forked from axl final 1-1 copy @ https://flipsidecrypto.xyz/edit/queries/30e85e2d-5b61-44cc-8dab-8708405454d8
-- forked from axl final 1-1 @ https://flipsidecrypto.xyz/edit/queries/56814e54-8379-4690-827f-b0d48685c238
-- forked from axl final 1 @ https://flipsidecrypto.xyz/edit/queries/c7af34a2-7375-40fa-85cc-88ed5cfb89be
with tab2 as (
SELECT
block_timestamp,
tx_hash,
user,
sum(CASE when flow like 'out' then -1 * amount else amount end) as net_flow
FROM (
SELECT
block_timestamp,
tx_hash,
from_address as user,
'out' as flow,
RAW_AMOUNT_PRECISE::NUMBER(38, 0) as AMOUNT
from arbitrum.core.fact_token_transfers
WHERE contract_address LIKE lower('0x23ee2343B892b1BB63503a4FAbc840E0e2C6810f')
UNION
SELECT
block_timestamp,
tx_hash,
to_address as user,
'in' as flow,
RAW_AMOUNT_PRECISE::NUMBER(38, 0) as AMOUNT
from arbitrum.core.fact_token_transfers
WHERE contract_address LIKE lower('0x23ee2343B892b1BB63503a4FAbc840E0e2C6810f')
)
GROUP BY 1,2,3
), tab3 as (
Run a query to Download Data