Skip to content

Commit

Permalink
fix showing one-sided-liquidity-error when it should not
Browse files Browse the repository at this point in the history
  • Loading branch information
aforaleka committed Aug 22, 2024
1 parent d51fc82 commit c25b912
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ internal class TradeMarketOrderInputValidator(
)
}

val summary = parser.asNativeMap(trade["summary"]) ?: return null
// summary can be empty even though there's input e.g. leverage input is set to the same as current position leverage
val summary = parser.asNativeMap(trade["summary"])?.takeIf { it.isNotEmpty() } ?: return null
// if there's liquidity for market order to be filled but is missing orderbook slippage (mid price)
// it is a one sided liquidity situation and should place limit order instead
parser.asDouble(summary["slippage"])
Expand Down

0 comments on commit c25b912

Please sign in to comment.