Skip to content

Commit

Permalink
Merge branch 'main' into make-settle-call-blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD authored Oct 20, 2023
2 parents 00b020c + 11f62fd commit b0c26e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 6 additions & 3 deletions crates/solvers/src/boundary/legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,12 @@ fn to_domain_solution(
order::Side::Buy => execution.exec_buy_amount,
order::Side::Sell => execution.exec_sell_amount,
},
match execution.exec_fee_amount {
Some(fee) => solution::Fee::Surplus(fee),
None => solution::Fee::Protocol,
match order.solver_determines_fee() {
true => execution
.exec_fee_amount
.map(solution::Fee::Surplus)
.context("no surplus fee")?,
false => solution::Fee::Protocol,
},
)
.context("invalid trade execution")?,
Expand Down
2 changes: 2 additions & 0 deletions crates/solvers/src/tests/legacy/market_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ async fn quote() {
"0": {
"exec_sell_amount": "133700000000000000",
"exec_buy_amount": "6000000000000000000000",
"exec_fee_amount": "6900000000000000"
}
},
"prices": {
Expand Down Expand Up @@ -295,6 +296,7 @@ async fn solve() {
"0": {
"exec_sell_amount": "133700000000000000",
"exec_buy_amount": "6000000000000000000000",
"exec_fee_amount": "6900000000000000",
}
},
"prices": {
Expand Down

0 comments on commit b0c26e7

Please sign in to comment.