Giter Site home page Giter Site logo

uniswapv3lpoptimizer's Introduction

Uniswaptimizer

The goal of this tool is to give Uniswap V3 users ideas for 'optimal' pool positions (by APY expected value) by using historial price volatility and the current pool liquidity distribution. It was largely inspired by the Uniswap V3 fees calculator created by the Flipside team. However, this tool aims to take away a significant amount of manual work in locating positions, rather to allow users to tweak some investment settings (to be implemented soon) and automatically see a table of liquidity providing opportunities with start and end price points.

To use the tool, visit uniswaptimizer.com

liquidity visualization

Here is the rough calculation used for finding the APY of a given position:

  • Find the average daily volume of a pool averaged over a week
  • Calculate the liquidity of a potential position for start and end points. Currently setting the tick size to 1/4 of a standard deviation. I'm also assuming a $1000 USD position value which can be tweaked in the future.
  • Calculate a distribution of the existing liquidity overlapping with each bucket. This is similar to the views in both the flipside calculator and the liquidity view of the Uniswap analytics dashboard.
  • Use the normal distribution of the price pair (using one week of daily price movement to calculate volatility = standard deviation) to calculate the probability of the price being in each bucket. This of course makes the incorrect assumption that the past volatility will reflect the future, but hey, we gotta start somewhere. We can sum up all the buckets of the total start/end range to get an expected value for total 'liquidity coverage'.
  • Pulling everything together the calculation comes out to:
    • Daily Fees = Pool Volume * Pool Fee % * Liquidity Coverage Expected Value
    • APY = (Daily Fees / 1000) * 365
  • Finally choose the highest APY position for each pool

Also see some of the math in the Uniswap V3 fees calculator for more info on how liquidity is calculated. (Info used in the Discord channel was also leveraged)

NOTE: There are a number of parameter preset values that are being used to get rid of noise in the data. For example, the lower volume pools are excluded from result, and extremely aggressive positions are ignored. I aim to document these are make they controllable in the UI soon

DISCLAIMER: This tool is not investment advice, please use it at your own risk. It uses a point-in-time estimate of how much you could potentially earn in fees for providing liquidity in Uniswap V3 (similar to the Flipside calculator). It assumes no changes to swap price, swap volumes or liquidity positions which is not realistic. It also does not account for Impermanent Loss currently. Use it to make directionally decisions about investments, but past information makes no gaurantees about the future.

uniswapv3lpoptimizer's People

Contributors

timsoulm avatar

Stargazers

Mikoyan avatar Jose Abraham Garcia avatar mactone avatar Kishan Sudani avatar

Watchers

James Cloos avatar  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.