Skip to content

Commit 0302969

Browse files
authored
Reject sell=buy orders (#192)
1 parent bf932a6 commit 0302969

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/domain/solver/dex/fills.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ impl Fills {
3838
/// Returns which dex query should be tried for the given order. Takes
3939
/// information of previous partial fill attempts into account.
4040
pub fn dex_order(&self, order: &order::Order, tokens: &auction::Tokens) -> Option<dex::Order> {
41+
// Do not attempt solving for same sell and buy token
42+
if order.sell.token == order.buy.token {
43+
return None;
44+
}
4145
if !order.partially_fillable {
4246
return Some(dex::Order::new(order));
4347
}

0 commit comments

Comments
 (0)