File tree Expand file tree Collapse file tree
src/Crypto.Websocket.Extensions/Orders/Sources Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55 <PropertyGroup >
66 <LangVersion >latest</LangVersion >
7- <Version >2.13.3 </Version >
7+ <Version >2.13.4 </Version >
88 </PropertyGroup >
99
1010</Project >
Original file line number Diff line number Diff line change @@ -119,8 +119,11 @@ private void HandleFill(Fill fill)
119119 private void HandleFillsSnapshot ( Fill [ ] fills )
120120 {
121121 var orders = fills
122+ . Where ( x => ! ExistingOrders . ContainsKey ( x . OrderId . ToString ( ) ) )
122123 . Select ( ConvertFill )
123124 . ToArray ( ) ;
125+ if ( orders . Length == 0 )
126+ return ;
124127 foreach ( var order in orders )
125128 order . IsSnapshot = true ;
126129 OrderSnapshotSubject . OnNext ( orders ) ;
@@ -190,11 +193,6 @@ private CryptoOrder ConvertFill(Fill fill)
190193 var existingPartial = _partiallyFilledOrders . GetValueOrDefault ( id ) ;
191194 var existing = existingPartial ?? existingCurrent ;
192195
193- if ( existingCurrent ? . OrderStatus == CryptoOrderStatus . Executed )
194- return existingCurrent ;
195- if ( existingPartial ? . OrderStatus == CryptoOrderStatus . Executed )
196- return existingPartial ;
197-
198196 var price = Math . Abs ( FirstNonZero ( fill . Price , existing ? . Price ) ?? 0 ) ;
199197
200198 var currentStatus = ( existing ? . AmountFilledCumulative ?? 0 ) > ( existing ? . AmountOrig ?? 0 ) + fill . Size ? CryptoOrderStatus . PartiallyFilled : CryptoOrderStatus . Executed ;
You can’t perform that action at this time.
0 commit comments