Skip to content

Commit

Permalink
no margin requirement for reduceOnly orders (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
atvanguard authored Jan 3, 2024
1 parent 024fdf5 commit b1cab61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugin/evm/orderbook/matching_pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func areMatchingOrders(longOrder, shortOrder Order, marginMap map[common.Address
}

func getRequiredMargin(order *Order, fillAmount, minAllowableMargin, takerFee, upperBound *big.Int) *big.Int {
if order.OrderType != IOC {
if order.OrderType != IOC || order.ReduceOnly {
return big.NewInt(0) // no extra margin required because for limit orders it is already reserved
// @todo change for signed orders
}
Expand Down

0 comments on commit b1cab61

Please sign in to comment.