Skip to content

Commit

Permalink
Don't send cow amm orders with missing prices (#2871)
Browse files Browse the repository at this point in the history
# Description
Fixes
#2863 (comment)

Do not send cow amm order owner to driver if auction prices don't
contain prices for that cow amm traded tokens.
  • Loading branch information
sunce86 authored Aug 9, 2024
1 parent 9f10adf commit 8e42e32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/autopilot/src/solvable_orders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,12 @@ impl SolvableOrdersCache {

let surplus_capturing_jit_order_owners = cow_amms
.iter()
.filter(|cow_amm| {
cow_amm
.traded_tokens()
.iter()
.all(|token| prices.contains_key(token))
})
.map(|cow_amm| cow_amm.address())
.cloned()
.map(eth::Address::from)
Expand Down

0 comments on commit 8e42e32

Please sign in to comment.