kaizen-ai / kaizenflow

KaizenFlow is a framework for Bayesian reasoning and AI/ML stream computing
GNU General Public License v3.0
112 stars 76 forks source link

WEB3 - Tulip - v0.5 - Compare with Uniswap #84

Open tamriq opened 1 year ago

tamriq commented 1 year ago

Get data from Uniswap and Binance and simulate Uniswap and DaoSwap to show that prices are more efficient

gpsaggese commented 1 year ago

This is probably an EPIC and needs to be broken down in smaller pieces.

1) DaoCross vs Uniswap

2) We want to get data from Uniswap (from the chain) and play it back to both Uniswap and DaoSwap to show what prices each would get.

samarth9008 commented 1 year ago

We want to get data from Binance about people trading (e.g., "trades") and Uniswap\

  • Is this similar to what you have implemented in sorrentum_sandbox for binance and team6 for uniswap? Are we gonna fetch the same data, trading one?

Play back taking liquidity from Uniswap using DaoCross using reference prices from Binance and compare the prices obtained by traders

  • Can you explain this again? I am unable to understand it?

Also we want to compute the impermanent loss as function of time for all the liquidity providers

  • This will be just for uniswap data?

We want to get data from Uniswap (from the chain) and play it back to both Uniswap and DaoSwap to show what prices each would get.

  • Will the uniswap data be different from the chain?
  • How should I play it back to DaoSwap/Cross? I believe what we are trying to implement is to see that DaoSwap provides less price for exchanging the tokens.

Is this issue outsourceable? I was thinking about outsourcing this one and focus on scalability of Tulip.

gpsaggese commented 1 year ago

This should become an EPIC and we split the work into multiple bugs. You can ask @DanilYachmenev how we do it.

We want to get data from Binance about people trading (e.g., "trades") and Uniswap\

  • Is this similar to what you have implemented in sorrentum_sandbox for binance and team6 for uniswap? Are we gonna fetch the same data, trading one?

Correct, we want to download everything possible for historical Uniswap (e.g., user request, price, liquidity) using the bitquery interface. This is the same task we discussed with @jsmerix We should download a little data to see what the data looks like and the schema. Then we can outsource the historical and real-time downloading to students.

@samarth9008 pls file a few bugs like "Download a bit of Uniswap to understand schema". For onboarding the data @jsmerix has a special flow like "download historical Uniswap data", "Download real-time Uniswap", etc. @jsmerix can you file that EPIC in parallel?

Play back taking liquidity from Uniswap using DaoCross using reference prices from Binance and compare the prices obtained by traders

  • Can you explain this again? I am unable to understand it?

The idea is that

Makes sense? This is also another bug to file @samarth9008

Also we want to compute the impermanent loss as function of time for all the liquidity providers

  • This will be just for uniswap data?

This is more complicated and we can ignore it for now.

We want to get data from Uniswap (from the chain) and play it back to both Uniswap and DaoSwap to show what prices each would get.

  • Will the uniswap data be different from the chain?

The data on-chain is very likely the same that we get from Bitquery (to confirm based on how Bitquery works). You can file a bug for checking on this.

  • How should I play it back to DaoSwap/Cross? I believe what we are trying to implement is to see that DaoSwap provides less price for exchanging the tokens.

Is this issue outsourceable? I was thinking about outsourcing this one and focus on scalability of Tulip.

For TulipCross is simple as discussed above, for DaoSwap it's going to be a bit more difficult since we can source orders from Binance or Uniswap and run DaoCross and see what prices come out. @samarth9008 find a bug for this under this EPIC.

samarth9008 commented 1 year ago

Shall I convert this issue as an EPIC and start assigning multiple bugs inside it Or just create a NEW epic by the name like WEB3 - DaoSwap More Efficient Than Uniswap?

gpsaggese commented 1 year ago

I've converted to an EPIC (it only works from ZenHub interface) and renamed. Now you can create child bugs under this EPIC

samarth9008 commented 1 year ago

Downloading little bit of uniswap data: https://github.com/sorrentum/sorrentum/issues/245

Comparing prices between uniswap and TulipCross: https://github.com/sorrentum/sorrentum/issues/252

Comparing data from uniswap on-chain and bitquery: https://github.com/sorrentum/sorrentum/issues/253

Comparing prices between uniswap and TulipSwap: https://github.com/sorrentum/sorrentum/issues/254

gpsaggese commented 1 year ago

FYI you don't need to enumerate the bugs since ZH (and the plugin for Chrome) gives you a view of the bugs in the EPIC

image

In any case I appreciate being organized :-)

jsmerix commented 1 year ago

@jsmerix can you file that EPIC in parallel?

https://github.com/sorrentum/sorrentum/issues/255