Giter Site home page Giter Site logo

Comments (2)

fleupold avatar fleupold commented on August 11, 2024

cc @josojo, @koeppelmann

Which price should the "clearing-price-range-assertion" be based on? The one of the direct Uniswap pool if existing (tokenA<>tokenB) or the price via ETH (tokenA<>ETH<>tokenB).

I think we initially suggested the latter, however since this increases the uniswap spread from 0.3 to 0.6 (two hops) I can see how users might feel betrayed if there exists a liquid direct pool (e.g. GNO<>OWL). Therefore, the second suggestion was to choose the "better" of the two.

For that, we have two cases

  1. Settlement requires trade with Uniswap
  2. Settlement doesn't require trade with Uniswap

In case 1) we could just assert that the clearing price is taken from whichever of the two pools offers the better price for settling the required amount.
The second case is slightly harder, since one pool could have a better spot price but a lot of slippage (making it look better but being worse for actual trading).

We could also chose which pool would give the better price for trading the cumulative sell amount and always use this one.

Either way the decision seems non-trivial.

from gp-v2-contracts.

josojo avatar josojo commented on August 11, 2024

In case 1) we could just assert that the clearing price is taken from whichever of the two pools offers the better price for settling the required amount.

agreed

The second case is slightly harder, since one pool could have a better spot price but a lot of slippage (making it look better but being worse for actual trading).

How about taking the spot price of the two-hop path, but still only allowing 0.3 spread. That seems reasonable to me, as we don't allow big slippage, but still, we take the price having the most liquidity in most cases.

from gp-v2-contracts.

Related Issues (20)

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.