Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cow-protocol/reference/core/auctions/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ An example Fill-or-Kill user limit buy order that sells 1000 [COW](https://ether
}
```

The above entry should be interpreted as follows. It is a Fill-or-Kill order since the flag `partiallyFillable` is set to `false`. Moreover, it is a sell order since its `kind` is set to `sell`. Finally, this is a `limit` order, meaning that it has a zero-signed fee, which implies that the solver is free to choose an appropriate fee to cover its execution cost. This means that, if executed, the user will send a total of 1000000000000000000000 COW atoms to the settlement contract, and the user has signed for a minimum of 284138335 USDC atoms (`fullBuyAmount`). The order also carries a 2 bps volume fee, which the driver will deduct from the buy side once the trade settles. Since the order has not been partially filled, `sellAmount` still equals `fullSellAmount`, but `buyAmount` is scaled up from `fullBuyAmount` to net out that fee: `buyAmount` = `fullBuyAmount` / (1 - 0.0002) = 284138335 / 0.9998 ≈ 284195174.03, rounded down to 284195174. Solvers can then route on `sellAmount`/`buyAmount` while ignoring fees entirely, and once the driver charges its 2 bps cut of the 284195174 USDC bought (≈56839 USDC atoms), the user is left with exactly the signed minimum of 284138335 USDC atoms — so the original limit is never violated. This is the usual case in practice: on most chains essentially every order carries some volume-based protocol or partner fee, so `buyAmount`/`sellAmount` differ from `fullBuyAmount`/`fullSellAmount` even without any partial fill; the two only coincide when there is no such fee, which is rare.
The above entry should be interpreted as follows. It is a Fill-or-Kill order since the flag `partiallyFillable` is set to `false`. Moreover, it is a sell order since its `kind` is set to `sell`. Finally, this is a `limit` order, meaning that it has a zero-signed fee, which implies that the solver is free to choose an appropriate fee to cover its execution cost. This means that, if executed, the user will send a total of 1000000000000000000000 COW atoms to the settlement contract, and the user has signed for a minimum of 284138335 USDC atoms (`fullBuyAmount`). The order also carries a 2 bps volume fee, which the driver will deduct from the buy side once the trade settles. Since the order has not been partially filled, `sellAmount` still equals `fullSellAmount`, but `buyAmount` is scaled up from `fullBuyAmount` to net out that fee: `buyAmount` = `fullBuyAmount` / (1 - 0.0002) = 284138335 / 0.9998 ≈ 284195174.03, rounded down to 284195174. Solvers can then route on `sellAmount`/`buyAmount` while ignoring fees entirely, and once the driver charges its 2 bps cut of the 284195174 USDC bought (≈56839 USDC atoms), the user is left with exactly the signed minimum of 284138335 USDC atoms — so the original limit is never violated. This is the usual case in practice: on most chains, orders between uncorrelated tokens carry a volume-based protocol fee and many orders carry a partner fee, so `buyAmount`/`sellAmount` differ from `fullBuyAmount`/`fullSellAmount` even without any partial fill; the two only coincide when there is no such fee, e.g. for an order between correlated tokens (which are not charged a protocol volume fee) without a partner fee.

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.

This is a perfect example, of why we should always have 1 line per sentence in MD files. Otherwise reading a diff can become really hard for straightforward changes.



### `deadline`
Expand Down
10 changes: 5 additions & 5 deletions docs/governance/fees/fees.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ The purpose of this page is to let users know which fee models are active at any
>
> **Fee calculation:** quote improvement \* 0.5 **OR** volume \* 0.0098 [whichever number is lower]

### Volume Fee
### Protocol volume fee

> **Definition:** A tiered fee based on the total volume of the order, adjusted by asset type
>
> **Eligible orders:** all orders
> **Eligible orders:** all orders, except orders between correlated assets (e.g. stablecoin to stablecoin), which are currently not charged a volume fee
>
> **Fee structure:**
> - **Standard Assets:** 2 basis points (bps)
> - **Correlated Assets (Stables/RWAs):** 0.3 basis points (bps)
>
> - **Correlated Assets (Stables/RWAs):** 0 basis points (bps)
>
> **Fee calculation:**
> - **Standard**: Volume * 0.0002
> - **Correlated:** Volume * 0.00003
> - **Correlated:** no protocol volume fee


:::note
Expand Down
Loading