Skip to content
This repository has been archived by the owner on Nov 11, 2022. It is now read-only.

V5 Initial Scoping #37

Open
GalloDaSballo opened this issue Sep 14, 2022 · 0 comments
Open

V5 Initial Scoping #37

GalloDaSballo opened this issue Sep 14, 2022 · 0 comments

Comments

@GalloDaSballo
Copy link
Owner

Assume every pool is UniV2

If k = a * b
How do we compare pool 1 vs pool 2?
Most likely we need to normalize by token decimals, which may still create odd situations

Then we need to compare the relative size of the tokenIn compared to the liquidity
I think that ratio will determine the price impact, but then we need to map that out to oracle manipulation
So next step is to correlate price impact to cost of manipulation which is work that we need to do + we can use some of the work Euler did

Basically the question is:
Does Price Impact correlate with cost of attack?
Can we compute cost of attack onChain?
After that:
Is there a correlation between Cost of Attack and Price Impact?
If we can find answer to these questions, we can create a "trust score" to determine how many TWAP we need to be sure that a price is benign
The highest score will be for the Pairs
USDC + WETH
WETH + wBTC
USDC + wBTC

So we also need to figure out what is the consensus on minimum observations there
TL;DR

-> Please find:

  • Oracle that uses TWAP that have been hacked or not, how many observations at least?
  • Cost of Manipulation formula
  • Twap observations used by euler based on the above
  • Correlation (if exists) between Price Impact and Cost of Manipulation (basically get a ton of data as CSV / Spreadsheet and we'll figure it out)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant