Skip to content

Commit

Permalink
fix trace log
Browse files Browse the repository at this point in the history
  • Loading branch information
sunce86 committed Jan 24, 2024
1 parent a0e14b2 commit 28fe3d4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
25 changes: 12 additions & 13 deletions crates/autopilot/src/domain/fee/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ impl ProtocolFee {
return vec![];
};

tracing::debug!(?order.metadata.uid, ?self.policy, ?order.data.sell_amount, ?order.data.buy_amount, ?quote, "checking if order is outside market price");
if boundary::is_order_outside_market_price(
&boundary::Amounts {
sell: order.data.sell_amount,
buy: order.data.buy_amount,
fee: order.data.fee_amount,
},
&boundary::Amounts {
sell: quote.sell_amount,
buy: quote.buy_amount,
fee: quote.fee,
},
) {
let order_ = boundary::Amounts {
sell: order.data.sell_amount,
buy: order.data.buy_amount,
fee: order.data.fee_amount,
};
let quote = boundary::Amounts {
sell: quote.sell_amount,
buy: quote.buy_amount,
fee: quote.fee,
};
tracing::debug!(?order.metadata.uid, ?self.policy, ?order_, ?quote, "checking if order is outside market price");
if boundary::is_order_outside_market_price(&order_, &quote) {
vec![self.policy]
} else {
vec![]
Expand Down
1 change: 1 addition & 0 deletions crates/shared/src/order_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ async fn get_or_create_quote(
}

/// Amounts used for market price checker.
#[derive(Debug)]
pub struct Amounts {
pub sell: U256,
pub buy: U256,
Expand Down

0 comments on commit 28fe3d4

Please sign in to comment.