Code Monkey home page Code Monkey logo

thrackle's Introduction

Overview

Example python data pipeline using asyncio for making RPC calls to an ethereum node.

Questions

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.

Question 1

Get uniswap v3 pool tick spacing for the following contract addresses: WBTC / ETH for the fee tiers 0.01%, 0.05%, 0.3% 1%.


WBTC / ETH 0.01%

  • Contract: 0xe6ff8b9A37B0fab776134636D9981Aa778c4e718
  • Tick spacing: 1

WBTC / ETH 0.05%

  • Contract: 0x4585FE77225b41b697C938B018E2Ac67Ac5a20c0
  • Tick spacing: 10

WBTC / ETH 0.3%

  • Contract: 0xCBCdF9626bC03E24f779434178A73a0B4bad62eD
  • Tick spacing: 60

WBTC / ETH 1%

  • Contract: 0x6Ab3bba2F41e7eAA262fa5A1A9b3932fA161526F
  • Tick spacing: 200

This query was used to find the answer.


Question 2

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.


Question 3

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.

Answer


Question 4

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%

  1. Pull the bitmap index from Uniswap v3 contracts (links to github contracts: core, periphery with TickLens function)
  2. 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.

Answer

thrackle's People

Contributors

juls858 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.