hessShare of REF copy
Updated 2024-10-05
999
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 prices as (
select date(block_timestamp) as date,
TOKEN_IN_CONTRACT,
(sum(AMOUNT_OUT)/sum(AMOUNT_IN)) as price
from near.defi.ez_dex_swaps
where SYMBOL_OUT in ('wNEAR')
and AMOUNT_OUT > 0
and AMOUNT_IN > 0
and TOKEN_IN_CONTRACT = 'gear.enleap.near'
group by 1, 2
),
near_price as (
select hour::date as date,
'Near' as symbol,
min(price) as near_price
from near.price.ez_prices_hourly
where symbol = 'NEAR'
and hour::date >= '2024-01-01'
group by 1, 2
),
gear as (
select a.date,
'gear.enleap.near' as tok_address,
price * near_price as price
from prices a
join near_price b on a.date = b.date
)
,
uwon_price as (
select date(block_timestamp) as date,
TOKEN_IN_CONTRACT,
(sum(AMOUNT_OUT)/sum(AMOUNT_IN)) as price
from near.defi.ez_dex_swaps
where SYMBOL_OUT in ('wNEAR')
QueryRunArchived: QueryRun has been archived