Giter VIP home page Giter VIP logo

uniswap-v3-liquidity-provider-indicator's Introduction

Uniswap V3 Liquidity Provider TradingView Indicator

This tool helps to guide research of strategies and decision making for active liquidity management in Uniswap V3 by charting positions using TradingView.

As of 14 November 2022, the indicator plots four lines:

ETHUSDT_2022-11-14_11-48-50

  1. The bottom of the Uniswap V3 LP position ($1000)
  2. The top of the Uniswap V3 LP position ($2000)
  3. The breakeven line of the Uniswap V3 LP position (downwards, to the right)
  4. The divergence loss line of the Uniswap V3 LP position (upwards, to the right)

Optimally, the liquidity provider should seek to maintain the price of the asset (ETH) inside of all the ranges (above breakeven & bottom of range, and below divergence loss & top of range.) However, depending on your greater asset management strategy, generally it is fine to be anywhere above the breakeven line!

uniswap-v3-liquidity-provider-indicator's People

Contributors

0x4007 avatar

Watchers

 avatar  avatar  avatar

uniswap-v3-liquidity-provider-indicator's Issues

Graph Compounding

I'm focusing on the "breakeven line" idea and its ability to accurately express when a position is compounded (yield is withdrawn, and redeposited.) Instead of graphing it as a ray (a line with one "extended" point) we can instead graph it as a line segment (no extended points) from the position deposit time, to when a position's size is modified.

If we add to the position size, then the breakeven line should be steeper (more fees should be accrued due to a larger position size.) I made a quick mockup using TradingView to illustrate this idea.

ETHUSDT_2022-11-18_11-36-13

Dynamic Data Input

Dynamic Data Input on TradingView Indicator

The first major engineering challenge in order for this to be useful in realtime decision making is to allow for the script to have the capability to dynamically read position data from external data sources. I did quite a bit of research on this, and it appears that TradingView's PineScript does not currently have this capability.

Currently the variables must be manually input on the indicator. This can be done by double clicking the indicator on TradingView.

tv

Those variables are manually imported off of the data presented by Revert's UI

https://revert.finance/#/uniswap-position/mainnet/312741

The founder of Revert passed me along this draft documentation of their private API. This was current as of 12 July 2022, as such there may have been some changes introduced since. This will allow you to access the information in JSON format.

apidocs.md


Research

I would encourage you to explore workarounds.

Workaround Strategy A - API Reverse Engineering

I would highly recommend API reverse engineering so that there is FAR LESS infrastructure to support for this capability. Then we could have a super simple node program that simply pings Revert (GET) and TradingView (POST) APIs every minute or so.

Workaround Strategy B - Scraper

Have a remote invoked scraper to manually log in to your TradingView account, and

  1. pass in the updated parameters using the settings panel (this might be possible by directly making the API request to update the user's settings vs having to navigate through the UI) or
  2. to hardcode the parameters and update the PineScript code.

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.