Aephiaraw_materials_prices copy
Updated 2024-11-10
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 atlas_price AS (
SELECT
hour::DATE AS DATE,
AVG(price) AS atlas_price
FROM
SOLANA.price.ez_prices_hourly
WHERE
token_address = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
AND hour::DATE >= current_date-7 AND hour::DATE < current_date
GROUP BY ALL
--order by 1 desc
),
rm_prices AS (
select
--*
date_trunc('day', block_timestamp::date) as date,
----------------------------------------------------
sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg'
then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
when inner_instruction:instructions[1]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg'
then inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount
end) AS ARCO_amount,
sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg'
AND inner_instruction:instructions[1]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[1]:parsed:info:tokenAmount:uiAmount)
when inner_instruction:instructions[1]:parsed:info:mint::string = 'ARCoQ9dndpg6wE2rRexzfwgJR3NoWWhpcww3xQcQLukg'
AND inner_instruction:instructions[2]:parsed:info:mint::string = 'ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx'
then (inner_instruction:instructions[0]:parsed:info:tokenAmount:uiAmount + inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount)
end) AS ARCO_atlas_amount,
sum(case when inner_instruction:instructions[2]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog'
then inner_instruction:instructions[2]:parsed:info:tokenAmount:uiAmount
when inner_instruction:instructions[1]:parsed:info:mint::string = 'MASS9GqtJz6ABisAxcUn3FeR4phMqH1XfG6LPKJePog'
QueryRunArchived: QueryRun has been archived