Skip to content

Commit

Permalink
Get fee_amount from trade (#2342)
Browse files Browse the repository at this point in the history
# Description
Now that we [killed the
subsidies](cowprotocol/infrastructure#1031), the
`trade.fee_amount` is always equal to `order.metadata.solver_fee` so we
get this data directly from onchain data instead of querying the
database.

Not super important since we will drop the support for market orders in
the following period, but important for moving this part of the code
into `domain` and simplifying the `surplus` and `fee` calculation on the
future
[domain::settlement](https://github.com/cowprotocol/services/blob/domain-settlement/crates/autopilot/src/domain/settlement/mod.rs#L14-L18)
object.

## How to test
Existing tests.
  • Loading branch information
sunce86 authored Feb 6, 2024
1 parent f945fdd commit c2425a8
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 187 deletions.
1 change: 0 additions & 1 deletion crates/autopilot/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ pub mod fee_policies;
pub mod on_settlement_event_updater;
pub mod onchain_order_events;
pub mod order_events;
pub mod orders;
mod quotes;
pub mod recent_settlements;

Expand Down
40 changes: 0 additions & 40 deletions crates/autopilot/src/database/orders.rs

This file was deleted.

Loading

0 comments on commit c2425a8

Please sign in to comment.