jackguyImpermanent Loss; Mainnet vs. Polygon
Updated 2022-07-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
›
⌄
with tab1 as (
SELECT
tx_hash,
block_number,
block_timestamp,
event_inputs:amount0 / power(10, 6) as usdc_deposits,
event_inputs:amount1 / power(10, 18) as weth_deposits,
((event_inputs:amount0 / power(10, 6)) / (event_inputs:amount1 / power(10, 18))) as deposit_ratio,
(event_inputs:amount0 / power(10, 6)) * 2 as deposit_value_usd
FROM ethereum.core.fact_event_logs
WHERE event_name LIKE 'Mint'
AND contract_address LIKE '0x397ff1542f962076d0bfe58ea045ffa2d347aca0'
AND block_number BETWEEN 14000000 AND 15180000
)
SELECT
*,
(1 - (2 * SQRT(deposit_ratio/1549.483650343))/(1 + (deposit_ratio/1549.483650343))) * 100 AS IL_percent,
DEPOSIT_VALUE_USD *(1 - (2 * SQRT(deposit_ratio/1549.483650343))/(1 + (deposit_ratio/1549.483650343))) as IL_USD
from tab1
--SELECT *
--FROM ethereum.core.dim_dex_liquidity_pools
--WHERE platform LIKE 'sushiswap'
--AND pool_name LIKE '%USDC-WETH%'
Run a query to Download Data