Trader JoeETH_USDC LVR
Updated 2023-11-01
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 LB_TXNS AS (
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
CASE
WHEN ethereum.public.udf_hex_to_int(SUBSTRING(data,35+64*1,32))::integer > 0
THEN ethereum.public.udf_hex_to_int(SUBSTRING(data,35+64*1,32))::integer/POWER(10,18)
ELSE ethereum.public.udf_hex_to_int(SUBSTRING(data,35+64*2,32))::integer*-1/POWER(10,18)
END AS ETH_FLOW,
CASE
WHEN ethereum.public.udf_hex_to_int(SUBSTRING(data,3+64*1,32))::integer > 0
THEN ethereum.public.udf_hex_to_int(SUBSTRING(data,3+64*1,32))::integer/POWER(10,6)
ELSE ethereum.public.udf_hex_to_int(SUBSTRING(data,3+64*2,32))::integer*-1/POWER(10,6)
END AS USDC_FLOW,
CASE
WHEN ethereum.public.udf_hex_to_int(SUBSTRING(data,35+64*4,32))::integer > 0
THEN ethereum.public.udf_hex_to_int(SUBSTRING(data,35+64*4,32))::integer/POWER(10,18)
ELSE 0
END AS fee_ETH,
CASE
WHEN ethereum.public.udf_hex_to_int(SUBSTRING(data,3+64*4,32))::integer > 0
THEN ethereum.public.udf_hex_to_int(SUBSTRING(data,3+64*4,32))::integer/POWER(10,6)
ELSE 0
END AS fee_USDC,
'LB' AS PROTOCOL
FROM arbitrum.core.fact_event_logs
WHERE CONTRACT_ADDRESS = '0x94d53be52706a155d27440c4a2434bea772a6f7c'
AND BLOCK_TIMESTAMP >= '2023-01-01'
AND TOPICS[0] = '0xad7d6f97abf51ce18e17a38f4d70e975be9c0708474987bb3e26ad21bd93ca70'
),
UNI_TXNS AS (
SELECT
BLOCK_TIMESTAMP,
TX_HASH,
CASE
Run a query to Download Data