Example python data pipeline using asyncio for making RPC calls to an ethereum node.
All questions have been answered using Flispide Crypto data. An api is available for each query such that the results can be pulled directly into a pandas dataframe for analysis.
Get uniswap v3 pool tick spacing for the following contract addresses: WBTC / ETH for the fee tiers 0.01%, 0.05%, 0.3% 1%.
- Contract: 0xe6ff8b9A37B0fab776134636D9981Aa778c4e718
- Tick spacing: 1
- Contract: 0x4585FE77225b41b697C938B018E2Ac67Ac5a20c0
- Tick spacing: 10
- Contract: 0xCBCdF9626bC03E24f779434178A73a0B4bad62eD
- Tick spacing: 60
- Contract: 0x6Ab3bba2F41e7eAA262fa5A1A9b3932fA161526F
- Tick spacing: 200
This query was used to find the answer.
Create a time series for the total locked value (TVL) for pools listed in #1 by minute and hour. Also calculate the change in Δ TVL and price between each time interval. Start with the most recent month and then expand the dataset to the starting point of Uniswap v3 (May 5, 2022)
The total TVL can calculated from the time series generated by the following queries.
The following parameterized query can be run for any pool. Use the desired contract address in Q1 to populate the pool_address parameter and run the query for the desired pool.
Find TVL of active and inactive positions for a point in time for Uniswap v3 pools listed in #1 that are active and inactive for a point in time, For example, what is the total locked value for active and inactive liquidity positions at 6:00 am on March 7, 2023, when the open price of WBTC / ETH 0.05% live DEX price was 22833.952. Choose a time and date that’s accessible on coin market cap or another similar site.
The following parameterized query can be run for any pool. Use the desired contract address in Q1 to populate the pool_address parameter and run the query for the desired pool.
This is a challenging question! While liquidity can be reconstructed with mints and burns, researchers would like point in time information for current tick ranges. Create a function to represent the current liquidity mapped to ticks. If possible use Uniswap v3 pool: WBTC / ETH for fee tiers 0.05%
- Pull the bitmap index from Uniswap v3 contracts (links to github contracts: core, periphery with TickLens function)
- Then translate the bitmap index into liquidity by ticks for the current point in time.
The following parameterized query can be run for any pool. Use the desired contract address in Q1 to populate the pool_address parameter and run the query for the desired pool. Also set the tick_spacing parameter to the corresponding tick space.