anomoneSABER locked per epoch
Updated 2022-03-12
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 locked as(
SELECT date_trunc('day', BLOCK_TIMESTAMP ) as date ,
max(
CASE DAYOFWEEK (BLOCK_TIMESTAMP)
WHEN 0 THEN 'Sunday'
WHEN 1 THEN 'Monday'
WHEN 2 THEN 'Tuesday'
WHEN 3 THEN 'Wednesday'
WHEN 4 THEN 'Thursday'
WHEN 5 THEN 'Friday'
WHEN 6 THEN 'Saturday' END
) as Day,
sum((INNER_INSTRUCTION:instructions[0]:parsed:info:amount )/1e6) as Locked
FROM solana.events
WHERE ---TX_ID = '5m3cXquqMncfCgEArC5AHnoZMYUckPzJcJ3FFDhiEuDjBNRB9odCmVDygBk22C7AivGMF4yM157NaPbpR3ekkebH'
PRETOKENBALANCES[0]:mint = 'Saber2gLauYim4Mvftnrasomsv6NvAuncvMEZwcLpD1'
AND Instruction:programId = 'LocktDzaV1W2Bm9DeZeiyz4J9zs4fRqNiYqQyracRXw'
AND INNER_INSTRUCTION:instructions[0]:programId = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA'
AND SUCCEEDED = 'True'
-- and tx_id = '4tWQn1HR8ZApXLjoBF4in4v5oK7ECgVkktDdnqEoBifAG9pqvimkPaaU9Jfe1CfXzyyZUiGGKy6j3rRUBswQoRHd'
Group By date_trunc('day', BLOCK_TIMESTAMP )
),
epochs as (
SELECT
date_trunc('day', BLOCK_TIMESTAMP ) as Date,
DATEDIFF('day' , '2022-01-20 05:42:45'::timestamp, date_trunc('day', BLOCK_TIMESTAMP ) ) as diff,
FLOOR((diff)/7) as epoch
FROM solana.events
--BLOCK_TIMESTAMP < '2022-01-20 05:42:46'::timestamp
GROUP BY date_trunc('day', BLOCK_TIMESTAMP )
ORDER BY date_trunc('day', BLOCK_TIMESTAMP ) desc
LIMIT 200
Run a query to Download Data