flyingfishVelodrome - add liquidity sample
Updated 2022-07-30
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
›
⌄
⌄
⌄
⌄
/* SELECT *
FROM optimism.core.fact_transactions
WHERE to_address = lower('0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9')
AND origin_function_signature in ('0x5a47ddc3', '0x0dede6c4')
limit 2
*/
SELECT
date_trunc('day', block_timestamp) as date,
event_name,
count(1),
sum(event_inputs:amount0)/pow(10,18) as velo_amount,
sum(event_inputs:amount1)/pow(10,6) as usdc_amount,
sum(velo_amount) OVER (partition by event_name ORDER BY date ASC) AS cumulative_add_velo,
sum(usdc_amount) OVER (partition by event_name ORDER BY date ASC) AS cumulative_usdc_velo
from optimism.core.fact_event_logs
--WHERE tx_hash = '0xd284beb98eaade638319eac833a80d026bf884d7c3064329fca8fa2c0ca008a9'
-- WHERE tx_hash = '0x007a3dd3422092577ebc1b4752dcf936e64d8a75b182c3b4506150050d221614'
WHERE block_timestamp > '2022-07-01' and block_timestamp < CURRENT_DATE
AND origin_to_address = lower('0xa132dab612db5cb9fc9ac426a0cc215a3423f9c9')
AND origin_function_signature IN ('0x5a47ddc3', '0x0dede6c4')
AND contract_address = lower('0xe8537b6ff1039cb9ed0b71713f697ddbadbb717d')
AND event_name IN ('Mint', 'Burn')
GROUP BY date, event_name
ORDER BY date ASC, event_name
/* SELECT *
FROM optimism.core.fact_transactions
WHERE tx_hash = '0xa3a0e84f133c099e2db34fa5a3c2b3d711fdb973a703b99b2a6c7cc10b50a23c'
OR tx_hash = '0xdce156efcf517f5329ef5bc99abe6cf4082cf69472636cb47ae3f61f6c726bc2'
*/
/* SELECT to_address,
sum(eth_value)
FROM ethereum.core.fact_traces
WHERE block_timestamp::date >= '2022-01-30'
--and tx_hash = '0x88f2a68161c556f98c1dc78b684656df2904825cfe6d94d75026d0800b0d91ce'
Run a query to Download Data