Afonso_Diazok2
Updated 2023-02-19
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
t1 as (
select block_timestamp,
tx_signer as user_address,
(deposit / 1e24 + transaction_fee / 1e24) * -1 as amount_near
from near.core.fact_transfers
where status = 1
),
t2 as (
select block_timestamp,
tx_receiver as user_address,
deposit / 1e24 as amount_near
from near.core.fact_transfers
where status = 1
),
t3 as (
select
block_timestamp,
trader as user_address,
iff(token_in = 'NEAR', (-1 * amount_in) / pow(10, 24), (amount_out) / pow(10, 24)) as amount_near
from near.core.ez_dex_swaps
join near.core.fact_transactions
using(tx_hash)
where (
token_in = 'NEAR' and amount_in > 0
) or (
token_out = 'NEAR' and amount_out > 0
)
),
t4 as (
select
block_timestamp,
Run a query to Download Data