-
Notifications
You must be signed in to change notification settings - Fork 16
Create slippage-protection.mdx #472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good content for anyone to better understand the risks of CoW Protocol.
I'd say "Tutorials" isn't the best place where to put this, since it's not really a how-to guide. Maybe after 🐮 CoW Protocol -> Concepts -> How it works
?
I also have a few inline comments.
|
||
### The Risk Model | ||
|
||
Slippage protection in CoW Protocol is implemented through a combination of economic incentives, governance mechanisms, and technical safeguards: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section reads weirdly to me:
Slippage protection [...] is implemented [...] by:
1. Having a bond (ok)
2. Allowing execution of orders at any signed price (what?)
3. Large orders are at risk (what?)
4. Security mechanisms (ok)
I'd try to separate the parts "what are the risks for the user, what the user should be careful about" and "what we do to mitigate those risks".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward: it looks like the former is part of "Safe Usage Guidelines" and the latter is part of "Recommendations," with some repeating content. Maybe this section can be dropped?
|
||
1. Manage slippage settings - Use reasonable slippage tolerances proportional to your trade size. | ||
|
||
2. Break up large trades - Split substantial orders into smaller batches to ensure potential slippage remains below the solver bond value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity. Having 1 large order or 10 small orders that sum up to the same parameters of the large one is basically the same in terms of risks if they are all active at the same time.
2. Break up large trades - Split substantial orders into smaller batches to ensure potential slippage remains below the solver bond value. | |
2. Break up large trades - Execute substantial orders in smaller batches one after the other to ensure potential slippage remains below the solver bond value. |
|
||
If a trade involves selling 1,000 ETH, and the user sets a 1% slippage tolerance: | ||
|
||
- At an ETH price of $3,000, the total order value is $3,000,000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ something $
is interpreted as math and is displayed weirdly.
This appears to work for escaping it:
- At an ETH price of $3,000, the total order value is $3,000,000 | |
- At an ETH price of \$3,000, the total order value is \$3,000,000 |
You may want to use \$
instead of $
everywhere in the document to avoid missing it, but it's also ok to only fix the issue where it's encountered.
3. Risk awareness - For particularly large orders with high slippage tolerance, users should be aware that: | ||
|
||
- The potential value at risk is tied to both order size and slippage settings | ||
|
||
- Additional precautions become increasingly important as order values grow | ||
|
||
5. Security layers - The protocol employs multiple protective mechanisms: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the skip between 3 and 5.
2. For developers: When building on CoW Protocol or implementing trading systems: | ||
|
||
- Implement additional validation logic for large trades | ||
|
||
- Consider custom slippage management for different token types and market conditions | ||
|
||
- Use TWAP for large order execution | ||
|
||
4. For treasury managers: When setting up systems like Zodiac Role Modifiers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the skip between 2 and 4.
Description
Create a new section for explaining the considerations around slippage management and accompanied risks
Changes
Add a new file with dedicated explanation