Comments (2)
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
- Settlement requires trade with Uniswap
- 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.
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)
- Update to latest Balancer contracts.
- Add custom limit amount for swap fast path
- Add `OrderBalance.ERC20` as a valid value for sell token balance `0b01` flag value
- Stricter order balance typing in TypeScript library
- Add useful flags to withdraw task
- Update Settlement Decoding to latest contracts.
- Investigate `hardhat-deploy` issues when changing deployment salt.
- [audit] GPv2Settlement.sol
- `dump` task will attempt transfer even if balance is 0.
- Tokens that are not traded do not get included in withdraw list
- Tokens that were traded and then became "invalid" can no longer be swapped.
- Allow specifying a maximum withdraw/dump batch size
- `dump` script display order information and wait
- [đĽA1] Gnosis Protocol Token Contracts Audit HOT 3
- Long approval times invalidate fees. HOT 1
- [Cowswap] API Price Strategy check endpoint HOT 2
- `dump` script can fail to place orders when approvals take too long.
- Implement faster way of getting largest token balances for WithdrawService
- Fix block native price estimation access HOT 1
- A HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â¤ď¸ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gp-v2-contracts.