Skip to content

Update description of consistency metric#639

Open
fhenneke wants to merge 2 commits into
mainfrom
consistency_v2
Open

Update description of consistency metric#639
fhenneke wants to merge 2 commits into
mainfrom
consistency_v2

Conversation

@fhenneke

@fhenneke fhenneke commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

The consistency metric has changed, as announced in this forum post. This PR updates the documentation accordingly.

Summary by CodeRabbit

  • Documentation
    • Updated the “consistency rewards” guidance (CIP-85) to use a new consistency metric effective June 30, 2026.
    • Replaced order-count consistency with a metric derived from bid quality and settlement success rate, and clarified how consistency budgets are allocated proportionally.
    • Explained how late, missing, or repeated unsettled wins—and cases where no orders are settled—impact scores.
    • Revised the solver strategy section to reflect the new incentives for competitive bidding and reliable settlement.

Replace the order-count consistency metric description with the new
metric combining bid quality and settlement success rate, effective
June 30, 2026, and link the announcement forum post.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@fhenneke fhenneke requested a review from a team July 3, 2026 12:10
@fhenneke fhenneke requested a review from a team as a code owner July 3, 2026 12:10
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Jul 3, 2026 4:08pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 78b4c1b6-dde7-4311-8dcc-19b6f470cd26

📥 Commits

Reviewing files that changed from the base of the PR and between ec9083b and 5974925.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/rewards.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/cow-protocol/reference/core/auctions/rewards.md

📝 Walkthrough

Walkthrough

This PR updates the Consistency rewards documentation under CIP-85, replacing the order-count metric with a June 30, 2026 metric based on bid quality and settlement success rate, and revises the Solver’s strategy text accordingly.

Changes

Consistency Rewards Documentation

Layer / File(s) Summary
New consistency metric and strategy note
docs/cow-protocol/reference/core/auctions/rewards.md
Replaces the order-count consistency metric with consistencyMetric based on bid quality (orderShare) and settlement success rate, and updates the Solver’s strategy paragraph to match the new incentive description.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • cowprotocol/docs#603: Also updates the Consistency rewards documentation and the metric description in docs/cow-protocol/reference/core/auctions/rewards.md.

Suggested reviewers: pretf00d, harisang

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is on-topic but misses the required # Description and # Changes sections from the template. Add the template headings and a short changes list explaining what was updated and why; include related issues if applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the documentation update for the consistency metric.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch consistency_v2

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/cow-protocol/reference/core/auctions/rewards.md`:
- Around line 80-84: The bid-quality formula in rewards.md leaves
`orderShare_i(o)` undefined when all bidders have zero surplus, so add the
intended zero-surplus fallback directly in this section. Update the
`orderShare_i(o)` definition to specify what happens when the denominator is
zero, and keep the explanation consistent with the surrounding `Bid quality`
description so readers can see how solver shares are assigned in that edge case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc7af1c7-e036-4358-8824-d47312de33b0

📥 Commits

Reviewing files that changed from the base of the PR and between d956c5a and ec9083b.

📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/rewards.md

Comment on lines +80 to +84
**1. Bid quality.** A solver bids on an order if it submits a solution containing that order. For each executed order, the solvers that bid on the order in the auction in which it was executed share a total weight of one, in proportion to the surplus they proposed. The share of solver $$i$$ for order $$o$$ is

$$
\textrm{orderShare}_i(o) = \frac{\textrm{surplus}_i(o)}{\sum_{j} \textrm{surplus}_j(o)},
$$

@coderabbitai coderabbitai Bot Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Define the zero-surplus fallback.

orderShare_i(o) divides by the sum of surplus values. If every fair bid on an order has zero surplus, the denominator is zero and the metric is undefined. Please document the intended fallback here.

🧰 Tools
🪛 LanguageTool

[style] ~80-~80: ‘in proportion to’ might be wordy. Consider a shorter alternative.
Context: ...s executed share a total weight of one, in proportion to the surplus they proposed. The share of...

(EN_WORDINESS_PREMIUM_IN_PROPORTION_TO)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/cow-protocol/reference/core/auctions/rewards.md` around lines 80 - 84,
The bid-quality formula in rewards.md leaves `orderShare_i(o)` undefined when
all bidders have zero surplus, so add the intended zero-surplus fallback
directly in this section. Update the `orderShare_i(o)` definition to specify
what happens when the denominator is zero, and keep the explanation consistent
with the surrounding `Bid quality` description so readers can see how solver
shares are assigned in that edge case.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agree with the comment; would be good to clarify this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@harisang, glad this is helpful. Here's a suggested addition to handle the zero-surplus edge case, which you could place right after the orderShare_i(o) formula:

where $$\textrm{surplus}_i(o)$$ is the largest surplus that any of solver $$i$$'s solutions proposed for order $$o$$ in that auction (the difference between the proposed execution amounts and the order's limit amounts), and the sum runs over all solvers that bid on the order. Only solutions that pass the fairness filtering are considered. If every fair bid on the order has zero surplus, the weight of one is instead split equally among all bidding solvers. Since each order distributes a total weight of one, orders with few bidders yield a larger share for each of them, an incentive for solvers to join competitions with little participation.

Feel free to adjust the exact fallback rule (equal split vs. some other convention) to match the actual behavior described in the forum post — I just wanted to make sure the edge case is explicitly called out so readers aren't left wondering what happens when the denominator is zero.


🧠 Learnings used
Learnt from: MarcusWentz
Repo: cowprotocol/docs PR: 586
File: docs/cow-protocol/tutorials/solvers/local_test.md:26-31
Timestamp: 2026-01-21T21:57:26.174Z
Learning: Document that the --native-price-estimators argument for the CoW Protocol autopilot CLI must use the Driver|name|url format (e.g., 'Driver|baseline|http://driver/baseline'), not just 'name|url'. Apply this guidance broadly in docs under the docs directory and include explicit examples to avoid ambiguity.

Learnt from: alfetopito
Repo: cowprotocol/docs PR: 606
File: docs/cow-protocol/tutorials/solvers/onboard.md:124-124
Timestamp: 2026-03-26T09:21:38.746Z
Learning: In the cowprotocol/docs documentation, treat the hostnames `barn.cow.fi` and `dev.cow.fi` as intentionally different environments. When reviewing docs, do NOT flag references where `barn.cow.fi` is replaced with `dev.cow.fi` (including `dev.swap.cow.fi`) as inconsistent—this swap is intentional because `barn.cow.fi` is being decommissioned and replaced by `dev.cow.fi`. Note that `barn.api.cow.fi` remains the backend staging API and should continue to be referred to as `barn`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I do not agree with this comment. The current rules prohibit zero surplus. Adding a comment here sounds just confusing to me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

\textrm{orderShare}_i(o) = \frac{\textrm{surplus}_i(o)}{\sum_{j} \textrm{surplus}_j(o)},
$$

where $$\textrm{surplus}_i(o)$$ is the largest surplus that any of solver $$i$$'s solutions proposed for order $$o$$ in that auction (the difference between the proposed execution amounts and the order's limit amounts), and the sum runs over all solvers that bid on the order. Only solutions that pass the fairness filtering are considered. Since each order distributes a total weight of one, orders with few bidders yield a larger share for each of them, an incentive for solvers to join competitions with little participation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
where $$\textrm{surplus}_i(o)$$ is the largest surplus that any of solver $$i$$'s solutions proposed for order $$o$$ in that auction (the difference between the proposed execution amounts and the order's limit amounts), and the sum runs over all solvers that bid on the order. Only solutions that pass the fairness filtering are considered. Since each order distributes a total weight of one, orders with few bidders yield a larger share for each of them, an incentive for solvers to join competitions with little participation.
where $$\textrm{surplus}_i(o)$$ is the largest surplus that any of solver $$i$$'s solutions proposed for order $$o$$ in that auction (the difference between the proposed execution amounts and the order's limit amounts), and the sum runs over all solvers that bid on the order. We stress that only solutions that pass the fairness filtering are considered in the above computations. Since each executed order distributes a total weight of one, orders with few bidders yield a larger share for each of them, an incentive for solvers to join competitions with little participation.

@harisang harisang Jul 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

orders with few bidders yield a larger share for each of them, an incentive for solvers to join competitions with little participation.

Not sure i agree with this one; in the sense that if we have 100 bids close to limit price and 2 good bids far from limit price, then the full share will be split among the 2 good bids while everyone else will get essentially zero

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One approach would be to say few competitive bids instead of few bidders. Alternatively, the reasoning can also be removed from the docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added your suggestion and changed the formulation towards competitive bids (from bidders).


where the sum runs over all order executions in the period (an order that is executed in several auctions, e.g., a partially fillable order, counts once per execution).

For example, suppose four solvers bid on an order with proposed surplus of 0.1, 0.08, 0.019, and 0.001 ETH. The total proposed surplus is 0.2 ETH, so the order shares are 0.5, 0.4, 0.095, and 0.005. If the solvers have success rates of 0.8, 0.9, 1.0, and 0.5 in the accounting period, this order contributes 0.4, 0.36, 0.095, and 0.0025, respectively, to their consistency metrics.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, suppose four solvers bid on an order with proposed surplus of 0.1, 0.08, 0.019, and 0.001 ETH. The total proposed surplus is 0.2 ETH, so the order shares are 0.5, 0.4, 0.095, and 0.005. If the solvers have success rates of 0.8, 0.9, 1.0, and 0.5 in the accounting period, this order contributes 0.4, 0.36, 0.095, and 0.0025, respectively, to their consistency metrics.
For example, suppose four solvers bid on an order with proposed surplus of 0.1, 0.08, 0.019, and 0.001 ETH. The total proposed surplus is 0.2 ETH, so the order shares are 0.5, 0.4, 0.095, and 0.005, respectively. If the solvers have success rates of 0.8, 0.9, 1.0, and 0.5 in the accounting period, this order contributes 0.4, 0.36, 0.095, and 0.0025, respectively, to their consistency metrics.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added this suggestion.

@@ -73,7 +73,41 @@ where $$\textrm{protocolFee}_i$$ is the protocol fee (excluding partner fees) ea

The consistency budget is distributed at the end of each accounting period according to a consistency metric. The core team has a mandate to adapt this metric when they see fit; every change will be announced in advance on the [CoW Protocol forum](https://forum.cow.fi).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@fhenneke should we also clarify here that once you have consistency metric, you distribute the budget proportionally to that metric, i.e., each solver i gets

consistency_budget * consistency_metric(i) / sum_{all solvers s} consistency_metric(s)

?

or do you think this is clear enough already?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I added the formula.

- stress that only fair solutions count towards bid quality
- attribute the larger share on uncontested orders to competitive
  bids rather than the number of bidders
- add explicit formula for the proportional distribution of the
  consistency budget
- add "respectively" to the example order shares

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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