Skip to content

chore: Store fee policies for all proposed orders #4789

Description

@fhenneke

Background

The autopilot currently does not store fee policies for each order which is proposed for execution by solvers. This makes it difficult to exactly replicate the filtering and winner selection logic. Storing all fee policies for orders with at least one solution would resolve this.

Details

The post processing of auctions involves a step where fee policies are stored.

let fee_policies: Vec<_> = ranking
.ranked()
.flat_map(|bid| bid.solution().order_ids())
.unique()
.filter_map(|order_id| match order_lookup.get(order_id) {
Some(auction_order) => {
Some((auction_order.uid, auction_order.protocol_fees.clone()))
}
None => {
tracing::debug!(?order_id, "order not found in auction");
None
}
})
.collect();

The code restricts to orders in ranked solutions, i.e. solutions which were not filtered out. I think that changing the implementation to use all() instead of ranked() could resolve this problem. This would make it consistent with how solutions themselves are stored.

Acceptance criteria

  • store fee policies for all orders which are part of at least one proposed solution, for each auction
  • update db docs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    team:solversIssues / PRs scoped to solvers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions