Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create slippage-protection.mdx #472

wants to merge 1 commit into from

Conversation

cmagan
Copy link
Contributor

@cmagan cmagan commented Apr 1, 2025

Description

Create a new section for explaining the considerations around slippage management and accompanied risks

Changes

Add a new file with dedicated explanation

@cmagan cmagan requested a review from fedgiac April 1, 2025 08:17
@cmagan cmagan requested a review from a team as a code owner April 1, 2025 08:17
Copy link

vercel bot commented Apr 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Apr 1, 2025 8:17am

Copy link
Contributor

@fedgiac fedgiac left a 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:
Copy link
Contributor

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".

Copy link
Contributor

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.
Copy link
Contributor

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.

Suggested change
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
Copy link
Contributor

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.

image

This appears to work for escaping it:

Suggested change
- 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.

Comment on lines +45 to +51
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:
Copy link
Contributor

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.

Comment on lines +151 to +159
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:
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants