flyingfisharbitrum Decent addLiquidity
Updated 2023-08-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 logs AS (
SELECT *
FROM arbitrum.core.fact_decoded_event_logs
WHERE block_timestamp::date >= '2023-02-03'
-- AND tx_hash = '0x1aea0b740d19333022acc20a5c4954d3067df5c55608821b2d9101834fe913e3'
AND event_name IN ('PoolCreated', 'IncreaseLiquidity')
),
pool_details AS (
SELECT
block_timestamp
, decoded_log:pool AS pool
, decoded_log:token0 AS token0
, decoded_log:token1 AS token1
, a.name AS name0
, a.symbol AS symbol0
, a.decimals AS decimals0
, b.name AS name1
, b.symbol AS symbol1
, b.decimals AS decimals1
, tx_hash
FROM logs
LEFT JOIN arbitrum.core.dim_contracts a
ON token0 = a.address
LEFT JOIN arbitrum.core.dim_contracts b
ON token1 = b.address
WHERE event_name = 'PoolCreated'
),
pool_amounts AS (
SELECT
decoded_log:amount0 AS amount0
, decoded_log:amount1 AS amount1
, tx_hash AS tx_hash_a
FROM logs
WHERE event_name = 'IncreaseLiquidity'
)
-- SELECT * FROM pool_amounts
Run a query to Download Data