Uniswap v3

Events Included

ethereum.dex.uniswap_v3_protocol_liquidity_pool_events contains swap, mint, burn, collect, and flash events emitted by Uniswap v3 protocol pools.

Projects Included

This table includes forks of Uniswap v3 under the project segment. Currently, this includes uniswap, sushiswap, pancakeswap and kyberswap.

Signed Token Amounts

token0_amount and token1_amount in this table is multiplied by -1* accordingly. This is to facilitate the calculation of pool TVL changes from events.

TVL Calculation

The 3 main events that contribute to pool balance changes are mint, swap & collect. This is because collect event is emitted during LP-burn and includes the LP burned amount. Users can also collect fees without burning LP (which decreases pool balance without burn event emitted). Sample Query - Pool TVL

-- TVL Calculation*
select 
    date(block_timestamp) as date,
    pool_name,
    sum(token0_amount) as amt0_delta,
    sum(amt0_delta) over (order by date) as token0_balance,
    sum(token1_amount) as amt1_delta,
    sum(amt1_delta) over (order by date) as token1_balance
from ethereum.dex.uniswap_v3_protocol_liquidity_pool_events
where liquidity_pool_address = '0x6c6bc977e13df9b0de53b251522280bb72383700' -- Univ3 
and event in ('mint', 'collect', 'swap') 
group by 1,2
order by 1 desc

Column Names

Column NameDescriptionExample

event

Liquidity pool event: mint or burn

burn

project

Name of the project.

uniswap

liquidity_pool_factory_address

Address of the liquidity pool factory.

0x1f98431c8ad98523631ae4a59f267346ea31f984

liquidity_pool_address

Address of the liquidity pool.

0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640

pool_name

Name of the pool.

uniswap: USDC-WETH 500

fee

The fee amount to enable, denominated in hundredths of a bip (i.e. 1e-6).

500

tick_spacing

The spacing between ticks to be enforced for all pools created with the given fee amount.

10

sender_address

Address of the sender of the pool event, which can be the Router.

0xc36442b4a4522e871399cd717abdd847ab11fe88

to_address

Address of the recipient of the pool event.

0xc36442b4a4522e871399cd717abdd847ab11fe88

token0_address

Address of token0 in this LP.

0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48

token0_name

Name of the token0 in this LP.

USD Coin

token0_symbol

Symbol of token0 in this LP.

USDC

token0_amount_raw

How much token0 was required for the minted liquidity, unormalized.

-432,607,956,944

token0_amount_raw_str

How much token0 was required for the minted liquidity, unormalized & in string.

-432607956944

token0_amount

How much token0 was required for the minted liquidity, normalized.

-432,607.96

token0_amount_usd

Amount of token0 in USD value.

432,478.17

token1_address

Address of token1 in this LP.

0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

token1_name

Name of the token1 in this LP.

Wrapped Ether

token1_symbol

Symbol of token1 in this LP.

WETH

token1_amount_raw

How much token1 was required for the minted liquidity, unormalized.

0

token1_amount_raw_str

How much token1 was required for the minted liquidity, unormalized & in string.

0

token1_amount

How much token1 was required for the minted liquidity, normalized.

0

token1_amount_usd

Amount of token1 in USD value.

0

usd_amount

Total sum of LP in USD value: token0_amount_usd + token1_amount_usd

432,478.17

liquidity_amount_raw

The amount of unnormalized amount of liquidity minted to the position range.

-9.0388E+17

liquidity_amount

The amount of liquidity minted to the position range.

-7.53233E+16

sqrt_price_x96

The initial sqrt price of the pool, as a Q64.96.

tick_lower

The lower tick of the position.

194,410

tick_upper

The upper tick of the position.

194,570

price_lower_0_1

Lower bound price of token0 per token1.

3551.033266

price_upper_0_1

Upper bound price of token0 per token1. The tick_lower is used to calculate the price_upper_0_1, where price_upper_0_1 = pow(1.0001, -1 * (tick_lower)) * pow(10,(token1_decimals - token0_decimals))

3608.303878

price_lower_1_0

Lower bound price of token1 per token0. Where price_lower_1_0 = pow(1.0001, (tick_lower)) * pow(10,(token0_decimals - token1_decimals))

0.000277138521

price_upper_1_0

Upper bound price of token1 per token0.

0.0002816081757

token0_price_usd

USD price of token0.

0.9997

token1_price_usd

USD price of token1.

3,601.72

transaction_from_address

Transaction sender address. I.e. the address of the transaction initiator. (from_address in the raw.transactions field for the transaction_hash of this swap).

0xd9c0bfdf37fec4f0582e23b8da7ee486885ff214

transaction_to_address

Transaction receiver. (to_address in the raw.transactions field for the transaction_hash of this swap).

0xc36442b4a4522e871399cd717abdd847ab11fe88

transaction_hash

Transaction hash the pool event.

0xaf7dab0a194ed62e87522aac9472b41ec9dfcd391284fdc1c0c28794c1bb5aac

log_index

Log index of the pool event transaction.

480

block_timestamp

Block timestamp of the pool event.

2021-10-11 09:05:15

block_number

Block number of the pool event.

13,396,403

block_hash

Block hash of the pool event.

0x8f6797ca81b7780edb56e6aadce96dd99d58a7ffd36e6edafbebeb2cac9b4e27

unique_id

Unique ID of each event.

event-burn_txn-0xaf7dab0a194ed62e87522aac9472b41ec9dfcd391284fdc1c0c28794c1bb5aac_log_index-480

Last updated