Skip to content

Document how fees are charged#646

Open
fhenneke wants to merge 2 commits into
mainfrom
partner_fee_example
Open

Document how fees are charged#646
fhenneke wants to merge 2 commits into
mainfrom
partner_fee_example

Conversation

@fhenneke

@fhenneke fhenneke commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Adds a "How fees are charged" section to the fees page, documenting how protocol and partner fees are computed from publicly available data.

  • Describes the three inputs that fully determine the fees of an executed order: the on-chain execution, the fee policies attached to the order in each auction, and the quote.
  • Documents the iterative computation in reverse policy order, including the modified factor formulas and why the protocol computes fees this way (only the settled amounts are observable on-chain).
  • Adds a worked example with three fee policies.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added detailed guidance on how protocol and partner fees are charged during order execution.
    • Documented fee calculation rules, ordering, formulas, caps, and zero-fee scenarios.
    • Included a worked example explaining fee and amount calculations.
    • Added information about viewing computed protocol fees through the trades API.
    • Noted that fee behavior and ordering may change through governance.

@fhenneke
fhenneke requested a review from a team as a code owner July 24, 2026 10:48
@vercel

vercel Bot commented Jul 24, 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 24, 2026 10:48am

Request Review

@fhenneke
fhenneke requested a review from a team July 24, 2026 10:48
@coderabbitai

coderabbitai Bot commented Jul 24, 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 Plus

Run ID: f8de5495-dfd6-4106-b929-122122878389

📥 Commits

Reviewing files that changed from the base of the PR and between c582f1d and f3117ae.

📒 Files selected for processing (1)
  • docs/governance/fees/fees.md

📝 Walkthrough

Walkthrough

The fees guide now explains how fees are embedded in settlement, calculated from ordered fee policies and quotes, and derived iteratively. It adds formulas, a worked example, API exposure details, and notes about implementation-dependent ordering.

Changes

Fee charging documentation

Layer / File(s) Summary
Fee calculation model
docs/governance/fees/fees.md
Documents embedded settlement fees, fee-policy ordering, reverse iterative calculation, fee-factor references, volume fees, and surplus or quote-improvement formulas.
Worked example and implementation notes
docs/governance/fees/fees.md
Adds step-by-step fee calculations, the executedProtocolFees API field, order-dependence details, and a governance caveat about current implementation behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • cowprotocol/docs#596: Documents related fee and amount composition concepts in the order-formation flow.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: documenting how fees are charged.
Description check ✅ Passed The description covers the purpose and key changes, though it does not use the exact template headings.
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 partner_fee_example

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.

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.

1 participant