ubiquity / uniswap-v3-liquidity-provider-indicator

This tool guides the research of new strategies and facilitates realtime decision making for human-operated active liquidity management in Uniswap V3 via TradingView.
1 stars 2 forks source link

Dynamic Data Input #1

Open 0x4007 opened 1 year ago

0x4007 commented 1 year ago

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.
0x4007 commented 1 year ago

I'll add lower priority issues after we get this started. There's a handful of adjustments that still need to be made, including ensuring calculation accuracy; and verifying the instrument being charted (my ETH-USDC LP indicator is plotting on every chart.)