Skip to content

Commit

Permalink
[Easy] Add minimal documentation on slippage (#130)
Browse files Browse the repository at this point in the history
* add some documentation on slippage

* layout fixes

* fix link

* rename main file

* Update cowprotocol/accounting/slippage/README.md

---------

Co-authored-by: Haris Angelidakis <64154020+harisang@users.noreply.github.com>
  • Loading branch information
fhenneke and harisang authored Feb 1, 2025
1 parent 8f8c1aa commit dd87627
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cowprotocol/accounting/slippage/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Slippage accounting

The queries in this folder are used for slippage accounting on CoW Protocol.
Results are used for solver payments in https://github.com/cowprotocol/solver-rewards.
Additional information can be found in the [documentation](https://docs.cow.fi/cow-protocol/reference/core/auctions/accounting#slippage).

## Query structure

![Structure of slippage query](slippage.svg)

The figure was generated using https://app.diagrams.net/.

## Notes

- Slippage depends on raw token imbalances as well as information on protocol and network fees.
- Slippage in different tokens is converted to ETH using the Dune price feed `prices.usd`, as implemented in `slippage_prices_4064601.sql`. The price feed uses hourly prices. If a price is _not_ available in the feed, exchange rates from CoW Protocol are used to reconstruct a price. If no price can be reconstructed, settlements are excluded from slippage.
- The file `slippage_query_3427730.sql` is a wrapper to make results from slippage conform to the format used in `solver-rewards`.
Loading

0 comments on commit dd87627

Please sign in to comment.