Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions crates/driver/src/domain/competition/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ impl Competition {
balances: Arc<Balances>,
app_data: Arc<HashMap<order::app_data::AppDataHash, Arc<app_data::ValidatedAppData>>>,
cow_amm_orders: Arc<Vec<Order>>,
settlement_contract: &eth::Address,
_settlement_contract: &eth::Address,
Comment thread
jmg-duarte marked this conversation as resolved.
Outdated
) -> Auction {
// Clone balances since we only aggregate data once but each solver needs
// to use and modify the data individually.
Expand Down Expand Up @@ -632,13 +632,12 @@ impl Competition {
// Update order app data if it was fetched.
if let Some(fetched_app_data) = app_data.get(&order.app_data.hash()) {
order.app_data = fetched_app_data.clone().into();
if order.app_data.flashloan().is_some() {
// If an order requires a flashloan we assume all the necessary
// sell tokens will come from there. But the receiver must be the
// settlement contract because that is how the driver expects
// the flashloan to be repaid for now.
return order.receiver.as_ref() == Some(settlement_contract);
}
}

// Flashloan orders get their sell tokens from the flashloan at
// settlement time, so skip the balance check.
if order.app_data.flashloan().is_some() {
return true;
}
Comment thread
felixjff marked this conversation as resolved.

// wrappers can produce the required funds at settlement time
Expand Down
Loading