csp88g$GEAR Buy/Sell summary by Users ###
Updated 2024-09-22
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
gear_sell_exr as(
select * from near.defi.ez_dex_swaps
where SYMBOL_IN = 'GEAR'
and BLOCK_TIMESTAMP > current_date -1
),
gear_buy_exr as(
select * from near.defi.ez_dex_swaps
where SYMBOL_OUT = 'GEAR'
and BLOCK_TIMESTAMP > current_date -1
),
gear_current_rate as(
select AMOUNT_IN_USD/AMOUNT_OUT as EX_rate
from gear_buy_exr
order by BLOCK_TIMESTAMP desc
limit 1
),
all_gear_swaps as(
select * from near.defi.ez_dex_swaps
where
/*block_timestamp > current_date -30*/
block_timestamp::date >= '2022-04-16'
/*and TRADER in ('csp88.near', '83b30f21b6d2ec9a4ab8b6490877f4623e87ee5cdc8ca753fce9975becfdda1e')*/
order by block_timestamp DESC),
GEAR_BUY as(
select block_timestamp,
TX_HASH,
TRADER,
AMOUNT_OUT as GEAR,
/*AMOUNT_OUT_USD as get_in_usd,*/
/*-AMOUNT_IN_USD as USD*/
CASE
QueryRunArchived: QueryRun has been archived