Skip to content

Conversation

@fhenneke
Copy link
Contributor

@fhenneke fhenneke commented Nov 26, 2025

This PR updates the section on competition rules.

Some rules we currently enforce via the circuit breaker were missing (e.g. hooks) and I added them.

Some rules were described in a way which does not correspond to how they are enforced, e.g. for buffer usage. I tried to simplify the description there.

Due to recent changes to fees, I also changed the definition of a valid solution as it is not sufficient to include a user order or CoW AMM order (with can generate surplus), nor is it required to give surplus to any order. I tried defining it via scores now.

I also added some additional formatting to hopefully make the rules a bit easier to understand.

It would be good to clean up some of the rules in a CIP, as some of the rules (local token conservation, pennying/overbidding) do not make much sense anymore. I left them in since they are still voted on by the DAO for now.

Summary by CodeRabbit

  • Documentation

    • Expanded and clarified auction competition rules: decomposed off-chain protocol into scores, valid-solution criteria, fair combinatorial winner selection for batched bids, settlement validity (pre/post-hook ordering, partial fills, denial consequences), buffer usage, rewards, tightened penalties/wording, standardized "CoW Improvement Proposal" terminology, harmonized EBBO references and formatting. No changes to exported/public interfaces.
  • Chores

    • Added rewards metadata field (documentation only).

✏️ Tip: You can customize this high-level summary in your review settings.

some rules were missing and some rules were worded a bit strangely. i tried to streamline the discussion of rules a bit
@fhenneke fhenneke requested a review from a team as a code owner November 26, 2025 12:07
@vercel
Copy link

vercel bot commented Nov 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
docs Ready Ready Preview Dec 8, 2025 2:42pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Expanded auction competition rules into a structured off‑chain protocol (Scores, Valid solutions, Winner selection via a Fair Combinatorial Auction, Valid settlements with hook sequencing and partial‑fill semantics), clarified buffer/accounting and EBBO/CIP terminology, and added rewards metadata front matter.

Changes

Cohort / File(s) Summary
Auction competition rules (expanded)
docs/cow-protocol/reference/core/auctions/competition_rules.md
Rewrote the Off‑chain protocol into subsections: Scores (per‑solution scoring tied to executed trade amounts), Valid solutions (positive score + UDCP compliance), Winner selection (Fair Combinatorial Auction: per‑directed‑pair best bids, unfair‑bid filtering, batched‑bid handling, second‑price considerations), Valid settlements (pre/post hook ordering, partial‑fill semantics, hook error consequences, denylist/circuit‑breaker interactions), Buffer usage and accounting, Deadline/penalties, EBBO/baseline token notes, CIP capitalization, and general formatting/link harmonization.
Rewards metadata
docs/cow-protocol/reference/core/auctions/rewards.md
Added front‑matter id: rewards (metadata only); no content or behavioral changes.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Solver
    participant Scorer as "Off‑chain Scorer"
    participant Selector as "Winner Selector\n(Fair Combinatorial Auction)"
    participant Settlement as "On‑chain Settlement\n(pre/post hooks)"

    Note over Solver,Scorer: Solver generates candidate solutions
    Solver->>Scorer: submit solutions
    Scorer-->>Solver: return scores + UDCP compliance flags

    alt valid solutions exist
        Solver->>Selector: submit scored, UDCP‑compliant solutions
        Selector->>Selector: group/filter by directed token pairs
        Selector->>Selector: remove unfair/overbidding bids
        Selector->>Selector: handle batched bids & compute coherent winning set (second‑price logic)
        Selector->>Settlement: submit winning settlement bundle
        Settlement->>Settlement: execute pre‑hooks
        Settlement->>Settlement: apply settlement (allow partial fills per rules)
        Settlement->>Settlement: execute post‑hooks
        Settlement-->>Selector: success / denylist or rejection on hook non‑compliance
    else no valid solution
        Selector-->>Solver: no‑winner / trigger deadline handling
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus areas:
    • Winner selection filtering and second‑price / coherence logic.
    • On‑chain settlement hook sequencing, partial‑fill semantics, and denylist / circuit‑breaker interactions.
    • EBBO/CIP/baseline token references and link anchors.

Possibly related PRs

Suggested reviewers

  • harisang
  • pretf00d

Poem

🐰 I hopped through bids and counted scores,
I sorted pairs and closed the doors,
From solver sparks to hooks that sing,
Winners twirl — a second‑price ring,
A rabbit cheers — the rules take wing! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description provides clear context for the changes but lacks the structured format specified in the template (missing 'Changes' section with a checklist of detailed changes). Reorganize the description to follow the template structure: add a 'Changes' section with a checklist of specific modifications (e.g., '- [ ] Added missing circuit breaker rules', '- [ ] Simplified buffer usage description', '- [ ] Revised valid solution definition via scores').
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update competition rules' accurately reflects the main change in the PR, which updates the competition rules documentation section.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_competition_rules_section

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/cow-protocol/reference/core/auctions/competition_rules.md (2)

33-33: Simplify "with respect to" for brevity.

Line 33 uses the phrase "with respect to solver, score, and executed amounts." Consider replacing with a more concise alternative like "regarding" or for better flow: "matching the solver, score, and executed amounts."

-  - The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  - The solution was selected as winner and is executed as specified in the bidding stage regarding solver, score, and executed amounts.

54-56: Reduce repetitive sentence structure in buffer usage list.

Lines 54–56 all begin with "Solvers are allowed..." Consider restructuring for variety and readability:

-  - Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
-  - Solvers are allowed to store funds to cover _network fees_ in the contract.
-  - Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
-  - Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
+  - _Protocol and partner fees_ must be stored in the settlement contract.
+  - Funds covering _network fees_ may be stored in the contract.
+  - Funds may be used to offset price variations on liquidity sources (referred to as _slippage_).
+  - Funds may be used for executing trades (referred to as _internalizations_) if the accumulating token is among the [list of allowlisted tokens](https://files.cow.fi/token_list.json).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7408f18 and c94ec61.

📒 Files selected for processing (2)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
  • docs/cow-protocol/reference/core/auctions/rewards.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[grammar] ~32-~32: Use a hyphen to join words.
Context: ...id settlements: A settlement executed on chain is valid if: - The solution wa...

(QB_NEW_EN_HYPHEN)


[style] ~33-~33: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~43-~43: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata b. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[grammar] ~46-~46: Ensure spelling is correct
Context: ...ing these rules can result in immediate denylisting of a solver until a manual inspection i...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~48-~48: Use a hyphen to join words.
Context: ...n. If the transaction is not observed on chain before the deadline block is mined...

(QB_NEW_EN_HYPHEN)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~155-~155: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

🔇 Additional comments (4)
docs/cow-protocol/reference/core/auctions/rewards.md (1)

2-2: Metadata addition aligns with documentation structure.

Adding the id: rewards field maintains consistency with adjacent documentation files and improves navigation/linking.

docs/cow-protocol/reference/core/auctions/competition_rules.md (3)

8-12: Clear introduction structure.

The rewritten introduction effectively frames the three rule categories and provides clear navigation.


32-32: Use hyphenated form "on-chain" for consistency and style.

Lines 32 and 48 use "on chain" (two words), but the hyphenated form "on-chain" is the standard convention in technical documentation and aligns with CoW Protocol style guidelines.

- Line 32: A settlement executed on chain is _valid_ if:
+ Line 32: A settlement executed on-chain is _valid_ if:

- Line 48: If the transaction is not observed on chain before the deadline block is mined,
+ Line 48: If the transaction is not observed on-chain before the deadline block is mined,

[suggest_minor_issue]

Also applies to: 48-48


75-160: Governance section is well-structured and comprehensive.

The section clearly outlines social consensus rules with appropriate governance references. The EBBO section is particularly thorough with chain-specific baseline protocols and tokens. Internal anchor linking appears consistent with the documentation structure.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (4)
docs/cow-protocol/reference/core/auctions/competition_rules.md (4)

32-32: Use hyphens to join "on-chain" in compound adjectives.

Lines 32 and 48 use "on chain" but should use the hyphenated form "on-chain" for consistency with standard style conventions for compound modifiers preceding nouns.

Apply this diff:

-  - A settlement executed on chain is _valid_ if:
+  - A settlement executed on-chain is _valid_ if:

And:

-  - Deadline: Solvers that win an auction will receive a deadline by which they must settle the auction on-chain. If the transaction is not observed on chain before the deadline block is mined, then the solution will count as not having been executed.
+  - Deadline: Solvers that win an auction will receive a deadline by which they must settle the auction on-chain. If the transaction is not observed on-chain before the deadline block is mined, then the solution will count as not having been executed.

Also applies to: 48-48


46-46: Improve link text to be more descriptive.

Lines 46, 50, and 57 use generic link text ("here", "this") which does not convey the destination or purpose. More descriptive anchor text improves accessibility and user experience.

Apply this diff:

-  Not following these rules can result in immediate denylisting of a solver until a manual inspection is executed. These rules are currently implemented [here](https://github.com/cowprotocol/circuit-breaker-validator).
+  Not following these rules can result in immediate denylisting of a solver until a manual inspection is executed. These rules are currently implemented in the [circuit-breaker-validator](https://github.com/cowprotocol/circuit-breaker-validator).

And:

-  - Rewards: A solver that provided a winning solution is rewarded according to a second-price auction mechanism; for more information see [here](rewards).
+  - Rewards: A solver that provided a winning solution is rewarded according to a second-price auction mechanism; for more information see the [rewards documentation](rewards).

And:

-  Solvers bear responsibility for all changes to balances of the settlement contract. The concrete implementation of buffer accounting is described [here](accounting).
+  Solvers bear responsibility for all changes to balances of the settlement contract. The concrete implementation of buffer accounting is described in the [accounting section](accounting).

Also applies to: 50-50, 57-57


52-57: Vary sentence starters in the Buffer usage list to reduce repetition.

Three consecutive bullet points begin with "Solvers are allowed," which reduces readability through repetitive structure. Reword some sentences to introduce variety while maintaining clarity.

Consider this alternative phrasing:

-  - Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
+  - Protocol and partner fees should be stored in the settlement contract.
-  - Solvers are allowed to store funds to cover _network fees_ in the contract.
+  - Funds to cover _network fees_ may be stored in the contract.
-  - Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
+  - Using settlement contract funds to offset price variations (also called _slippage_) on liquidity sources is permitted.
-  - Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
+  - For executing trades (_internalizations_), settlement contract funds may be used if the accumulating token is on the [list of allowlisted tokens](https://files.cow.fi/token_list.json).

33-33: Consider using more concise phrasing in place of "with respect to".

Line 33 uses "with respect to," which is somewhat wordy. Shorter alternatives like "regarding" or simply restructuring the sentence would improve clarity without changing the meaning.

Consider this alternative:

-  - The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  - The solution was selected as winner and is executed as specified in the bidding stage regarding solver, score, and executed amounts.

Or alternatively:

-  - The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  - The solution was selected as winner and is executed as specified: same solver, score, and executed amounts as in the bidding stage.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c94ec61 and 967321f.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[grammar] ~32-~32: Use a hyphen to join words.
Context: ...id settlements: A settlement executed on chain is valid if: - The solution wa...

(QB_NEW_EN_HYPHEN)


[style] ~33-~33: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~43-~43: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata b. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[grammar] ~46-~46: Ensure spelling is correct
Context: ...ing these rules can result in immediate denylisting of a solver until a manual inspection i...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~48-~48: Use a hyphen to join words.
Context: ...n. If the transaction is not observed on chain before the deadline block is mined...

(QB_NEW_EN_HYPHEN)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~155-~155: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

🪛 markdownlint-cli2 (0.18.1)
docs/cow-protocol/reference/core/auctions/competition_rules.md

46-46: Link text should be descriptive

(MD059, descriptive-link-text)


50-50: Link text should be descriptive

(MD059, descriptive-link-text)


57-57: Link text should be descriptive

(MD059, descriptive-link-text)

🔇 Additional comments (1)
docs/cow-protocol/reference/core/auctions/competition_rules.md (1)

1-161: Overall content and structure are well-integrated and technically accurate.

The expansion of the competition rules documentation is comprehensive and correctly reflects the updated auction mechanisms (Fair Combinatorial Auction, multi-criterion scoring, detailed hook semantics). The references to CIP-38, CIP-65, and CIP-67 are aligned with the official protocol specifications for scoring, auction selection, and winner determination. The hook execution rules (lines 34–46) provide clear and actionable requirements for settlement compliance. The baseline protocols and token lists are thorough and well-organized with collapsible sections for readability.

Copy link
Contributor

@acanidio-econ acanidio-econ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit: the opening paragraph talks about "rules that solvers must follow", but the text also discusses rewards, which isn't a rule that solvers should follow, rather that the protocol should follow. Maybe we should remove the discussion about rewards? Or maybe we should introduce the section by saying that the competition has certain rules (not only "rules that a solver must follow")

@harisang
Copy link
Contributor

@fhenneke could you rebase and also address the AI-provided comments?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
docs/cow-protocol/reference/core/auctions/competition_rules.md (5)

28-33: Fix hyphenation in compound adjectives; consider tightening verbose phrase.

Line 32 uses the unhyphenated form "on chain"; compound adjectives in English should be hyphenated. Additionally, line 33's "with respect to" is verbose.

Apply this diff:

- - Valid settlements: A settlement executed on chain is _valid_ if:
-  - The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+ - Valid settlements: A settlement executed on-chain is _valid_ if:
+  - The solution was selected as winner and is executed as specified in the bidding stage for solver, score, and executed amounts.

46-46: Improve link text descriptiveness.

Line 46 uses a non-descriptive link text "here". Per Markdown linting standards, link text should describe the resource being referenced.

Apply this diff:

- Not following these rules can result in immediate denylisting of a solver until a manual inspection is executed. These rules are currently implemented [here](https://github.com/cowprotocol/circuit-breaker-validator).
+ Not following these rules can result in immediate denylisting of a solver until a manual inspection is executed. These rules are currently implemented in the [circuit-breaker-validator](https://github.com/cowprotocol/circuit-breaker-validator).

48-48: Fix hyphenation: "on-chain" should be hyphenated.

Apply this diff:

- - Deadline: Solvers that win an auction will receive a deadline by which they must settle the auction on-chain. If the transaction is not observed on chain before the deadline block is mined, then the solution will count as not having been executed.
+ - Deadline: Solvers that win an auction will receive a deadline by which they must settle the auction on-chain. If the transaction is not observed on-chain before the deadline block is mined, then the solution will count as not having been executed.

50-57: Improve link text and reduce repetitive sentence structure.

Line 50 uses a non-descriptive link text "here". Additionally, lines 52–56 repetitively begin with "Solvers are allowed" / "Solvers bear responsibility", which can be simplified for clarity.

Apply this diff:

- - Rewards: A solver that provided a winning solution is rewarded according to a second-price auction mechanism; for more information see [here](rewards).
+ - Rewards: A solver that provided a winning solution is rewarded according to a second-price auction mechanism; for more information see the [rewards documentation](rewards).

- - Buffer usage: solvers are allowed to use funds in the settlement contract for certain types of use cases.
+ - Buffer usage: The settlement contract may be used by solvers in the following ways:
-  - Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
+  - Storing _protocol and partner fees_
-  - Solvers are allowed to store funds to cover _network fees_ in the contract.
+  - Storing funds to cover _network fees_
-  - Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
+  - Using funds to offset price variations on liquidity sources, also referred to as _slippage_
-  - Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
+  - Using funds for executing trades (internalizations), if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json)
-  Solvers bear responsibility for all changes to balances of the settlement contract. The concrete implementation of buffer accounting is described [here](accounting).
+
+  Solvers bear responsibility for all changes to balances of the settlement contract. The concrete implementation of buffer accounting is described in the [accounting documentation](accounting).

161-161: Improve link text descriptiveness.

Line 161 uses a non-descriptive link text "this". The link should describe the EBBO rules being referenced.

Apply this diff:

- More details about how a certificate of an EBBO violation is computed, and what are the steps taken in case such a violation occurs can be found in [this](ebbo-rules) section.
+ More details about how a certificate of an EBBO violation is computed, and what are the steps taken in case such a violation occurs can be found in the [EBBO rules](ebbo-rules) section.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 967321f and 90c7fa3.

📒 Files selected for processing (2)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
  • docs/cow-protocol/reference/core/auctions/rewards.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/cow-protocol/reference/core/auctions/rewards.md
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[grammar] ~32-~32: Use a hyphen to join words.
Context: ...id settlements: A settlement executed on chain is valid if: - The solution wa...

(QB_NEW_EN_HYPHEN)


[style] ~33-~33: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~43-~43: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata b. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[grammar] ~46-~46: Ensure spelling is correct
Context: ...ing these rules can result in immediate denylisting of a solver until a manual inspection i...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[grammar] ~48-~48: Use a hyphen to join words.
Context: ...n. If the transaction is not observed on chain before the deadline block is mined...

(QB_NEW_EN_HYPHEN)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~57-~57: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~166-~166: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

🪛 markdownlint-cli2 (0.18.1)
docs/cow-protocol/reference/core/auctions/competition_rules.md

46-46: Link text should be descriptive

(MD059, descriptive-link-text)


50-50: Link text should be descriptive

(MD059, descriptive-link-text)


57-57: Link text should be descriptive

(MD059, descriptive-link-text)

- move content of rewards section to a comment on winner selection
- changed wording following ai review
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
docs/cow-protocol/reference/core/auctions/competition_rules.md (2)

52-55: Reduce repetition of "Solvers are allowed" at sentence beginnings.

Three consecutive bullet points (lines 52, 54, 55) begin with "Solvers are allowed..." which is repetitive. Restructure for variety while maintaining clarity.

Consider this restructuring:

  - Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
- - Solvers are allowed to store funds to cover _network fees_ in the contract.
- - Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
- - Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
+ - Network fees may be covered by funds stored in the settlement contract.
+ - Price variations on liquidity sources (_slippage_) can be offset using settlement contract funds.
+ - For executing trades (_internalizations_), settlement contract funds can be used if the accumulating token is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).

34-34: Tighten phrasing: replace "with respect to" with shorter alternative.

Line 34 uses "with respect to," which is slightly wordy. Consider "for" or "regarding."

-  - The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  - The solution was selected as winner and is executed as specified in the bidding stage for solver, score, and executed amounts.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90c7fa3 and df3f9b7.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[style] ~34-~34: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~44-~44: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata b. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[grammar] ~47-~47: Ensure spelling is correct
Context: ...ing these rules can result in immediate denylisting of a solver until a manual inspection i...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)


[style] ~54-~54: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~165-~165: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

🔇 Additional comments (6)
docs/cow-protocol/reference/core/auctions/competition_rules.md (6)

47-47: Verify spelling of "denylisting".

Line 47 uses "denylisting," which may be a domain-specific term but is not standard in dictionaries. Verify this is the intended terminology; consider alternatives like "denying," "blocking," or "blacklisting" for clarity if appropriate.


21-31: Expanded subsections are well-structured and informative.

The new Scores, Valid solutions, and Winner selection subsections clearly explain the off-chain protocol flow, reference external CIPs, and provide concrete criteria. The Fair Combinatorial Auction logic is well-articulated.


33-47: Valid settlements subsection with hook execution rules is comprehensive.

The detailed hook execution rules (pre/post hooks, partial fills, error handling) and circuit-breaker-validator reference provide clear enforcement guidance without ambiguity.


92-158: Base protocols and tokens subsections are well-organized.

Collapsible detail sections for each chain provide transparency and maintainability. Links to block explorers aid verification.


78-78: "CoW Improvement Proposal (CIP)" capitalization is consistent.

Standardization of CIP capitalization across the document aligns with governance terminology and is applied correctly throughout.


160-160: EBBO violation handling reference is clear.

The inline reference to the EBBO rules section (line 160) provides a natural link without cluttering the governance section.

- Winner selection: The set of winning solutions (and corresponding winning solvers) is chosen using a _Fair Combinatorial Auction_ (see [CIP-67](https://snapshot.box/#/s:cow.eth/proposal/0xf9ecb08c4738f04c4525373d6b78085d16635f86adacd1b8ea77b2c176c99d32)) from all valid solutions. Each solution corresponds to a bid in the auction.
- The protocol first considers bids containing only orders on the same _directed token pair_, i.e., on the same token pair and in the same direction, and computes the best bid on each directed token pair, where the best bid is the one generating the highest score. The collection of these best bids is the reference outcome for each directed token pair, representing the best possible execution against outside liquidity.
- The protocol then uses the reference outcome to filter out _unfair_ bids from the remaining batched bids (batched because, by definition, they contain orders on multiple directed token pairs). A batched bid is filtered out whenever it generates lower score for a given directed token pair than the reference outcome.
- In the final step, the protocol considers all the batched bids that survived the filtering and the best bids on individual directed token pairs. It computes the collection of winning bids, under the constraint that all orders on the same directed token pair must be part of the same winning bid.
Copy link
Contributor

@harisang harisang Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the winner's selection algorithm described anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not currently described anywhere.

Should I add a sentence on it for now? Something like "At the moment, the algorithm for selecting winning bids in the final step proceeds by greedily picking solutions with largest scores from those without a directed token pair in common with already selected solutions. The algorithm might get updated in the future."

An actual elaboration of the whole process would be welcome, including the filtering. But that feels a bit out of place in this section.


- Valid settlements: A settlement executed on-chain is _valid_ if:
- The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
- Hooks of executed trades, as specified in app data of respective orders, are executed according to the following rules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the preview, this part looks cramped and not easy to parse.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in ebb4a77

d. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
Not following these rules can result in immediate denylisting of a solver until a manual inspection is executed. These rules are currently implemented in the [circuit-breaker-validator](https://github.com/cowprotocol/circuit-breaker-validator).

- Deadline: Solvers that win an auction will receive a deadline by which they must settle the auction on-chain. If the transaction is not observed on-chain before the deadline block is mined, then the solution will count as not having been executed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be part of the "valid settlements" section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The suggestion sounds good, especially if we want to make the distinction that the circuit breaker should denylist solvers who submit invalid settlements.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 9f24a33

Copy link
Contributor

@harisang harisang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall but i added some comments that i feel need to be addressed

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
docs/cow-protocol/reference/core/auctions/competition_rules.md (2)

34-34: Consider simplifying "with respect to" for clarity.

Line 34 uses "with respect to solver, score, and executed amounts," which could be more concise. Consider alternatives like "regarding" or restructuring to "by solver, score, and executed amounts."

-  The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  The solution was selected as winner and is executed as specified in the bidding stage regarding solver, score, and executed amounts.

52-55: Consider varying sentence structure in buffer usage list.

Lines 52–55 begin multiple consecutive bullet points with "Solvers are," which is somewhat repetitive in a technical list. Consider rewording for variety while maintaining clarity.

- Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
- Solvers are allowed to store funds to cover _network fees_ in the contract.
- Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
- Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
+ _Protocol and partner fees_ should be stored in the settlement contract.
+ Funds may be held to cover _network fees_.
+ The settlement contract may be used to offset price variations on liquidity sources, also referred to as _slippage_.
+ Funds may be used for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between df3f9b7 and ba5492d.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[typographical] ~21-~21: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ...osal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4). - Valid solutions: ...

(CONJUNCTION_AFTER_SEMICOLON)


[grammar] ~25-~25: If ‘chosen’ is used as a verb, it usually requires the infinitive.
Context: ... across solutions, even if submitted by the same solver. - Winner selection: The set...

(AFFORD_VBG)


[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[uncategorized] ~29-~29: Possible missing article found.
Context: ...maining batched bids (batched because, by definition, they contain orders on multiple...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~30-~30: Possible missing comma found.
Context: ... orders on the same directed token pair must be part of the same winning bid. Winning sol...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~34-~34: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~44-~44: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata b. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[style] ~54-~54: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~56-~56: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[grammar] ~165-~165: It appears that hyphens are missing.
Context: ...1](https://snapshot.org/#/cow.eth/proposal/0x16d8c681d52b24f1ccd854084e07a99fce6a7af1e25fd21dd...

(PRE_AND_POST_NN)


[style] ~165-~165: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
docs/cow-protocol/reference/core/auctions/competition_rules.md (2)

50-55: Reduce repetitive sentence openings in Buffer usage section.

Lines 50–55 begin three successive sentences with "Solvers are" and then "Solvers bear responsibility," which is repetitive and reduces readability. Consider restructuring to vary sentence openers while preserving the meaning.

Consider this refactored version for improved readability:

- Buffer usage: solvers are allowed to use funds in the settlement contract for certain types of use cases.
-  - Solvers are supposed to store _protocol and partner fees_ in the settlement contract.
-  - Solvers are allowed to store funds to cover _network fees_ in the contract.
-  - Solvers are allowed to use funds in the settlement contract to offset price variations on liquidity sources, also referred to as _slippage_.
-  - Solvers are allowed to use funds in the settlement contract for executing trades, also referred to as _internalizations_, if the token which accumulates in the contract is among a [list of allowlisted tokens](https://files.cow.fi/token_list.json).
-  Solvers bear responsibility for all changes to balances of the settlement contract. The concrete implementation of buffer accounting is described in the [accounting section](accounting).
+ Buffer usage: solvers are allowed to use funds in the settlement contract for certain types of use cases.
+  - _Protocol and partner fees_ must be stored in the settlement contract.
+  - Funds covering _network fees_ may be held in the contract.
+  - Price variations (also called _slippage_) can be offset using contract funds.
+  - Trading via _internalizations_ is permitted if tokens are among the [allowlisted tokens](https://files.cow.fi/token_list.json).
+  Solvers bear sole responsibility for all settlement contract balance changes. The concrete implementation of buffer accounting is described in the [accounting section](accounting).

34-34: Consider tightening the language: "with respect to" can be more concise.

Line 34 uses "with respect to solver, score, and executed amounts," which is slightly wordy. Consider shortening to "regarding" or "for" to improve clarity.

-  The solution was selected as winner and is executed as specified in the bidding stage with respect to solver, score, and executed amounts.
+  The solution was selected as winner and is executed as specified in the bidding stage regarding solver, score, and executed amounts.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba5492d and 9f24a33.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/competition_rules.md (4 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/cow-protocol/reference/core/auctions/competition_rules.md

[typographical] ~21-~21: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ...osal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4). - Valid solutions: ...

(CONJUNCTION_AFTER_SEMICOLON)


[grammar] ~25-~25: If ‘chosen’ is used as a verb, it usually requires the infinitive.
Context: ... across solutions, even if submitted by the same solver. - Winner selection: The set...

(AFFORD_VBG)


[style] ~28-~28: Consider placing the discourse marker ‘first’ at the beginning of the sentence for more clarity.
Context: ...orresponds to a bid in the auction. - The protocol first considers bids containing only orders o...

(SENT_START_FIRST_PREMIUM)


[uncategorized] ~29-~29: Possible missing article found.
Context: ...maining batched bids (batched because, by definition, they contain orders on multiple...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~30-~30: Possible missing comma found.
Context: ... orders on the same directed token pair must be part of the same winning bid. Winning sol...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~34-~34: ‘with respect to’ might be wordy. Consider a shorter alternative.
Context: ...cuted as specified in the bidding stage with respect to solver, score, and executed amounts. ...

(EN_WORDINESS_PREMIUM_WITH_RESPECT_TO)


[style] ~44-~44: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata 2. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)


[style] ~53-~53: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ver network fees in the contract. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~54-~54: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...es, also referred to as slippage. - Solvers are allowed to use funds in the settlem...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~55-~55: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...ttps://files.cow.fi/token_list.json). Solvers bear responsibility for all changes to ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[grammar] ~164-~164: It appears that hyphens are missing.
Context: ...real tokens). - Illegal use of internal buffers ([CIP-11](https://snapshot.org/#/cow.eth/prop...

(PRE_AND_POST_NN)


[style] ~164-~164: Consider using only “public” to avoid wordiness.
Context: ...imate AMM interactions available to the general public for the purpose of saving transaction c...

(GENERAL_XX)

🪛 markdownlint-cli2 (0.18.1)
docs/cow-protocol/reference/core/auctions/competition_rules.md

39-39: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


40-40: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


42-42: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


44-44: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


45-45: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


46-46: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)

🔇 Additional comments (2)
docs/cow-protocol/reference/core/auctions/competition_rules.md (2)

21-21: Verify grammar: conjunction placement after semicolon.

Line 21 reads "...proposal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4). - Valid solutions: ..." The semicolon followed by a bullet point and new section works contextually, but the LanguageTool analysis suggests reviewing punctuation for clarity. Consider whether a period or em-dash better separates these concepts.


23-31: Approve updated off-chain protocol section structure.

The restructuring of the off-chain protocol into Scores, Valid solutions, Winner selection, and Valid settlements is well-organized and aligns with the PR objectives to clarify auction mechanics and settlement requirements. The addition of hook sequencing rules and Fair Combinatorial Auction details significantly improves protocol transparency.

## Off-chain protocol

- A solution is valid only if it contains at least one user or CoW AMM order and respects Uniform Directional Clearing Prices (UDCP): all orders trading the same tokens in the same direction must receive the same price (with an exception for orders containing hooks to account for the cost of gas). Importantly, each solution must respect UDCP, but there is no obligation to respect UDCP across solutions, even if submitted by the same solver.
- Scores: Every solution is associated with a _score_. The score is computed from executed amounts of all trades and is roughly equivalent to the amount of surplus a solution generates for users. For concrete formulas see [the section on solving](the-problem) or [CIP-38](https://snapshot.box/#/s:cow.eth/proposal/0xfb81daea9be89f4f1c251d53fd9d1481129b97c6f38caaddc42af7f3ce5a52ec) and [CIP-65](https://snapshot.box/#/s:cow.eth/proposal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix snapshot domain: use snapshot.org instead of snapshot.box.

Lines 21 and 27 still use the incorrect snapshot.box domain for CIP links. The canonical Snapshot domain for CoW DAO's CIPs is snapshot.org/#/s:cow.eth. Update both lines to match the correct domain.

Apply this diff to fix the snapshot domains:

-Scores: Every solution is associated with a _score_. The score is computed from executed amounts of all trades and is roughly equivalent to the amount of surplus a solution generates for users. For concrete formulas see [the section on solving](the-problem) or [CIP-38](https://snapshot.box/#/s:cow.eth/proposal/0xfb81daea9be89f4f1c251d53fd9d1481129b97c6f38caaddc42af7f3ce5a52ec) and [CIP-65](https://snapshot.box/#/s:cow.eth/proposal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4).
+Scores: Every solution is associated with a _score_. The score is computed from executed amounts of all trades and is roughly equivalent to the amount of surplus a solution generates for users. For concrete formulas see [the section on solving](the-problem) or [CIP-38](https://snapshot.org/#/s:cow.eth/proposal/0xfb81daea9be89f4f1c251d53fd9d1481129b97c6f38caaddc42af7f3ce5a52ec) and [CIP-65](https://snapshot.org/#/s:cow.eth/proposal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4).

-Winner selection: The set of winning solutions (and corresponding winning solvers) is chosen using a _Fair Combinatorial Auction_ (see [CIP-67](https://snapshot.box/#/s:cow.eth/proposal/0xf9ecb08c4738f04c4525373d6b78085d16635f86adacd1b8ea77b2c176c99d32)) from all valid solutions. Each solution corresponds to a bid in the auction.
+Winner selection: The set of winning solutions (and corresponding winning solvers) is chosen using a _Fair Combinatorial Auction_ (see [CIP-67](https://snapshot.org/#/s:cow.eth/proposal/0xf9ecb08c4738f04c4525373d6b78085d16635f86adacd1b8ea77b2c176c99d32)) from all valid solutions. Each solution corresponds to a bid in the auction.

Also applies to: 27-27

🧰 Tools
🪛 LanguageTool

[typographical] ~21-~21: Conjunctions like ‘and’ should not follow semicolons. Consider using a comma, or removing the conjunction.
Context: ...osal/0xd172281444c48254398881c57a57a2acbf0802a385e6c94384fd358b943aa4f4). - Valid solutions: ...

(CONJUNCTION_AFTER_SEMICOLON)

🤖 Prompt for AI Agents
In docs/cow-protocol/reference/core/auctions/competition_rules.md around lines
21 and 27, the CIP links incorrectly point to snapshot.box; update both URLs to
use the canonical snapshot.org path (snapshot.org/#/s:cow.eth/...) so the two
references to CIP-38 and CIP-65 point to snapshot.org instead of snapshot.box;
verify the corrected full URLs and keep the rest of the link text unchanged.

Comment on lines +39 to +46
1. Should execute the pre-hooks on the first fill only
2. Should execute the post-hooks on every fill
4. Execution of a hook means:
1. There exists an internal CALL in the settlement transaction with a
matching triplet: target, gasLimit, calldata
2. The hook needs to be attempted, meaning the hook reverting is not violating any rules
3. Intermediate calls between the call to settle and hook execution must not revert
4. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix markdown indentation inconsistency in hook execution rules.

Lines 39–46 have inconsistent indentation (6 spaces instead of 4) relative to the parent list item. Normalize the indentation to maintain consistent Markdown formatting.

Apply this diff to fix the indentation:

     3. Partially fillable orders:
-      1. Should execute the pre-hooks on the first fill only
-      2. Should execute the post-hooks on every fill
+    1. Should execute the pre-hooks on the first fill only
+    2. Should execute the post-hooks on every fill
     4. Execution of a hook means:
-      1. There exists an internal CALL in the settlement transaction with a
+    1. There exists an internal CALL in the settlement transaction with a
-      matching triplet: target, gasLimit, calldata
-      2. The hook needs to be attempted, meaning the hook reverting is not violating any rules
-      3. Intermediate calls between the call to settle and hook execution must not revert
-      4. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
+    matching triplet: target, gasLimit, calldata
+    2. The hook needs to be attempted, meaning the hook reverting is not violating any rules
+    3. Intermediate calls between the call to settle and hook execution must not revert
+    4. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Should execute the pre-hooks on the first fill only
2. Should execute the post-hooks on every fill
4. Execution of a hook means:
1. There exists an internal CALL in the settlement transaction with a
matching triplet: target, gasLimit, calldata
2. The hook needs to be attempted, meaning the hook reverting is not violating any rules
3. Intermediate calls between the call to settle and hook execution must not revert
4. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
1. Should execute the pre-hooks on the first fill only
2. Should execute the post-hooks on every fill
4. Execution of a hook means:
1. There exists an internal CALL in the settlement transaction with a
matching triplet: target, gasLimit, calldata
2. The hook needs to be attempted, meaning the hook reverting is not violating any rules
3. Intermediate calls between the call to settle and hook execution must not revert
4. The available gas forwarded to the hook CALL is greater or equal than specified gasLimit
🧰 Tools
🪛 LanguageTool

[style] ~44-~44: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...t, gasLimit, calldata 2. The hook needs to be attempted, meaning the hook revertin...

(REP_NEED_TO_VB)

🪛 markdownlint-cli2 (0.18.1)

39-39: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


40-40: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


42-42: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


44-44: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


45-45: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)


46-46: Inconsistent indentation for list items at the same level
Expected: 4; Actual: 6

(MD005, list-indent)

🤖 Prompt for AI Agents
In docs/cow-protocol/reference/core/auctions/competition_rules.md around lines
39 to 46, the nested list items are indented with 6 spaces instead of the
project's standard 4 spaces; update those lines to use 4-space indentation so
the sublist aligns correctly under the parent list item (reduce leading spaces
on lines 39–46 to 4 spaces and ensure numbering/ordering remains the same).

@fhenneke fhenneke requested a review from harisang December 10, 2025 09:20
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.

5 participants