@@ -547,7 +547,8 @@ protected override async Task<Dictionary<string, decimal>> OnGetAmountsAvailable
547
547
548
548
protected override async Task < ExchangeOrderResult > OnPlaceOrderAsync ( ExchangeOrderRequest order )
549
549
{
550
- if ( order . Price == null ) throw new ArgumentNullException ( nameof ( order . Price ) ) ;
550
+ if ( order . Price == null && order . OrderType != OrderType . Market ) throw new ArgumentNullException ( nameof ( order . Price ) ) ;
551
+
551
552
Dictionary < string , object > payload = await GetNoncePayloadAsync ( ) ;
552
553
payload [ "symbol" ] = order . MarketSymbol ;
553
554
payload [ "newClientOrderId" ] = order . ClientOrderId ;
@@ -564,14 +565,14 @@ protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrd
564
565
565
566
// Binance has strict rules on which prices and quantities are allowed. They have to match the rules defined in the market definition.
566
567
decimal outputQuantity = await ClampOrderQuantity ( order . MarketSymbol , order . Amount ) ;
567
- decimal outputPrice = await ClampOrderPrice ( order . MarketSymbol , order . Price . Value ) ;
568
568
569
569
// Binance does not accept quantities with more than 20 decimal places.
570
570
payload [ "quantity" ] = Math . Round ( outputQuantity , 20 ) ;
571
571
payload [ "newOrderRespType" ] = "FULL" ;
572
572
573
573
if ( order . OrderType != OrderType . Market )
574
574
{
575
+ decimal outputPrice = await ClampOrderPrice ( order . MarketSymbol , order . Price . Value ) ;
575
576
payload [ "timeInForce" ] = "GTC" ;
576
577
payload [ "price" ] = outputPrice ;
577
578
}
@@ -942,7 +943,8 @@ private ExchangeOrderResult ParseOrder(JToken token)
942
943
ClientOrderId = token [ "clientOrderId" ] . ToStringInvariant ( )
943
944
} ;
944
945
945
- result . Result = ParseExchangeAPIOrderResult ( token [ "status" ] . ToStringInvariant ( ) , result . AmountFilled ) ;
946
+ result . ResultCode = token [ "status" ] . ToStringInvariant ( ) ;
947
+ result . Result = ParseExchangeAPIOrderResult ( result . ResultCode , result . AmountFilled ) ;
946
948
ParseAveragePriceAndFeesFromFills ( result , token [ "fills" ] ) ;
947
949
948
950
return result ;
0 commit comments