Skip to content

Commit 41193d8

Browse files
committed
Validate ask-bid price relationship
1 parent 4820145 commit 41193d8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/BinanceBot.Market/Core/MarketDepthPair.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ public MarketDepthPair(Quote ask, Quote bid, long updateTime)
1313
throw new ArgumentNullException(nameof(ask));
1414
if (bid == null)
1515
throw new ArgumentNullException(nameof(bid));
16+
if (ask.Price < bid.Price)
17+
throw new ArgumentException("Ask price must be greater than or equal to bid price.");
1618
if (updateTime <= 0)
1719
throw new ArgumentOutOfRangeException(nameof(updateTime));
1820

0 commit comments

Comments
 (0)