You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Description
Rank by surplus implementation for the Price Improvement fee policy.
# Changes
To properly calculate both `native_surplus ` and `native_protocol_fee`,
the `surplus` function was refactored into `surplus_over_limit_price`
where limit sel/buy amounts should be provided explicitly.
`fee::adjust_quote_to_order_limits` function is used to adjust the limit
amounts in case of the Price Improvement fee policy.
# Current limitations
Either my understanding is incorrect or `fee_from_volume` function
doesn't work correctly for the `max_volume_factor=1.0`. For the sell
order kind, it returns `inf` and for the buy, the factor is adjusted
into `0.5`, which is not really expected.
## How to test
I tested it by adding some logs and running protocol fee driver tests.
## Related Issues
Fixes#2466
Problem
For rank by surplus, we added a function for calculating protocol fees based on the trades as seen onchain.
We miss the implementation for price improvement type:
https://github.com/cowprotocol/services/pull/2448/files#diff-808128d3e1821263540033959417d656a85a317e6e640ec294d271030f88c3cbR200
The text was updated successfully, but these errors were encountered: