Skip to content

Add details about overdrafts to the documentation#601

Open
bram-vdberg wants to merge 1 commit intomainfrom
Add-Overdrafts-Manager
Open

Add details about overdrafts to the documentation#601
bram-vdberg wants to merge 1 commit intomainfrom
Add-Overdrafts-Manager

Conversation

@bram-vdberg
Copy link
Contributor

@bram-vdberg bram-vdberg commented Mar 11, 2026

Description

This PR adds details about the overdrafts and overdraft management contract to the documentation.

Changes

  • Add details of overdrafts, checking overdrafts, and paying overdrafts
  • Add screenshot checking a solver's overdrafts

Summary by CodeRabbit

  • Documentation
    • Added an Overdrafts section explaining that penalties and negative slippage are deducted from weekly rewards and tracked on-chain.
    • Included examples and guidance for checking outstanding overdrafts and submitting overdraft payments.
    • Expanded overdraft explanations within both accounting and slippage sections for improved clarity.

@bram-vdberg bram-vdberg requested a review from a team as a code owner March 11, 2026 08:46
@vercel
Copy link

vercel bot commented Mar 11, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Mar 11, 2026 8:59am

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

Adds an Overdrafts section to the accounting reference documenting that penalties and negative slippage are deducted from weekly COW rewards, overdrafts are tracked on-chain via the overdrafts manager, and outlines checking balances and repaying overdrafts.

Changes

Cohort / File(s) Summary
Accounting Documentation
docs/cow-protocol/reference/core/auctions/accounting.md
Inserted a new "Overdrafts" section (added twice: near fee corrections and within Slippage). Describes deduction of penalties/negative slippage from weekly COW rewards, on-chain tracking via the overdrafts manager (solverOverdraftBalance), and repayment via payOverdraft. Includes example image reference and notes amounts are in ETH.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐇 I nibble notes in ledger rows,

Penalties counted where the river flows,
Overdrafts marked on-chain and clear,
Rewards adjusted, repayments near,
A tidy hop for docs sincere.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding documentation about overdrafts, which matches the file changes and PR objectives.
Description check ✅ Passed The description includes both required sections (Description and Changes) with clear details about what was added, though it could be slightly more detailed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Add-Overdrafts-Manager

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: 2

🧹 Nitpick comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)

111-115: Tighten the wording and add one concrete example call.

Use whose instead of who's in both paragraphs, and consider adding a minimal cast/ethers example for solverOverdraftBalance and payOverdraft so the invocation is unambiguous. Based on learnings, docs under the docs directory should include explicit examples to avoid ambiguity.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/reference/core/auctions/accounting.md` around lines 111 -
115, Update the two paragraphs to use "whose" instead of "who's" for the solver
address references and add one concrete invocation example for each method to
remove ambiguity: show a minimal cast or ethers call for solverOverdraftBalance
(passing the solver address and noting the return is in wei) and for
payOverdraft (passing the solver address and amount in ETH), referencing the
overdrafts manager contract and the methods solverOverdraftBalance and
payOverdraft so readers can copy the exact invocation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 109-113: The subsection heading "Paying outstanding overdrafts" is
at the wrong level relative to "Checking outstanding overdrafts"; change the
heading text "### Paying outstanding overdrafts" to "#### Paying outstanding
overdrafts" so it matches the same level as "#### Checking outstanding
overdrafts" and preserves the hierarchy under the "### Overdrafts" section.
- Line 115: The text incorrectly states payOverdraft accepts an amount "in ETH";
update the documentation to say payOverdraft(address solver) has no amount
parameter and the payment is sent via msg.value (denominated in wei) to the
overdrafts manager contract; specifically replace the sentence about passing an
amount in ETH with a note that the transaction's msg.value (wei) is used to pay
the solver's overdraft and mention the function signature payOverdraft(address
solver) to clarify there is no explicit amount parameter.

---

Nitpick comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 111-115: Update the two paragraphs to use "whose" instead of
"who's" for the solver address references and add one concrete invocation
example for each method to remove ambiguity: show a minimal cast or ethers call
for solverOverdraftBalance (passing the solver address and noting the return is
in wei) and for payOverdraft (passing the solver address and amount in ETH),
referencing the overdrafts manager contract and the methods
solverOverdraftBalance and payOverdraft so readers can copy the exact
invocation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1a7c2831-0710-4f06-a332-19eeb4241edf

📥 Commits

Reviewing files that changed from the base of the PR and between 1e54f9f and 8a7970c.

⛔ Files ignored due to path filters (1)
  • docs/cow-protocol/reference/core/auctions/checking_overdraft.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/accounting.md

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.

♻️ Duplicate comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)

115-115: ⚠️ Potential issue | 🔴 Critical

Correct the function signature and denomination (duplicate issue).

Line 115 contains two critical errors that were already flagged in a previous review:

  1. No amount parameter exists: payOverdraft(address solver) takes only the solver address. There is no separate amount parameter to pass.

  2. Payment is in wei, not ETH: The payment amount is sent via the transaction's msg.value field, which is always denominated in wei (not ETH).

The verified contract source shows:

function payOverdraft(address solver) external payable;

Update the documentation to clarify that the payment value is sent as msg.value in wei when calling the function.

📝 Suggested correction
-In order to pay a solver's outstanding overdraft balance you can call the `payOverdraft` method on the overdrafts manager contract using the address of the solver who's outstanding overdraft you would like to pay, together with the amount that you would like to pay. Note, this amount is in ETH and not in wei.
+To pay a solver's outstanding overdraft balance, call the `payOverdraft(address solver)` method on the overdrafts manager contract with the solver's address. Send the payment amount as the transaction value (`msg.value`), denominated in wei.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/reference/core/auctions/accounting.md` at line 115, Update
the docs to reflect the actual function signature and denomination: change the
description of payOverdraft to reference the contract function signature
function payOverdraft(address solver) external payable and explain that there is
no separate amount parameter — the payment is supplied via the transaction's
msg.value field and must be denominated in wei (not ETH); mention the overdrafts
manager contract and the solver address parameter (payOverdraft) so readers know
to send value in msg.value when calling it.
🧹 Nitpick comments (1)
docs/cow-protocol/reference/core/auctions/accounting.md (1)

109-111: LGTM! Accurate description of checking overdrafts.

The documentation correctly describes the solverOverdraftBalance method and its return value in wei.

Optional style note: "In order to check" could be simplified to "To check" for more concise writing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/cow-protocol/reference/core/auctions/accounting.md` around lines 109 -
111, The sentence "In order to check your outstanding overdrafts" is wordy;
update the docs text in the auctions accounting page to use the more concise
phrasing "To check your outstanding overdrafts" while leaving the rest of the
description (mentioning solverOverdraftBalance on the overdrafts manager
contract and the return in wei) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Line 115: Update the docs to reflect the actual function signature and
denomination: change the description of payOverdraft to reference the contract
function signature function payOverdraft(address solver) external payable and
explain that there is no separate amount parameter — the payment is supplied via
the transaction's msg.value field and must be denominated in wei (not ETH);
mention the overdrafts manager contract and the solver address parameter
(payOverdraft) so readers know to send value in msg.value when calling it.

---

Nitpick comments:
In `@docs/cow-protocol/reference/core/auctions/accounting.md`:
- Around line 109-111: The sentence "In order to check your outstanding
overdrafts" is wordy; update the docs text in the auctions accounting page to
use the more concise phrasing "To check your outstanding overdrafts" while
leaving the rest of the description (mentioning solverOverdraftBalance on the
overdrafts manager contract and the return in wei) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3df0ab58-3328-4e04-baf2-b066ec0dd84c

📥 Commits

Reviewing files that changed from the base of the PR and between 8a7970c and ad6b700.

⛔ Files ignored due to path filters (1)
  • docs/cow-protocol/reference/core/auctions/checking_overdraft.png is excluded by !**/*.png
📒 Files selected for processing (1)
  • docs/cow-protocol/reference/core/auctions/accounting.md

@harisang
Copy link
Contributor

There is a small subsection towards the end that is called Overdraft handling (negative net position)

My suggestion would be to just add the content of this PR as an extension of that subsection, and not as a separate section above, as you do now

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.

3 participants