11using System ;
2+ using System . Linq ;
23using System . Threading . Tasks ;
34using Binance . Net . Clients ;
5+ using Binance . Net . Enums ;
46using Binance . Net . Interfaces . Clients ;
57using Binance . Net . Objects ;
68using BinanceBot . Market ;
@@ -21,7 +23,7 @@ internal static class Program
2123 private const string Secret = "***" ;
2224
2325 // WARN: set necessary token here
24- private const string Symbol = "DOGEBTC " ;
26+ private const string Symbol = "SOLUSDT " ;
2527 private static readonly TimeSpan ReceiveWindow = TimeSpan . FromMilliseconds ( 1000 ) ;
2628 #endregion
2729
@@ -38,12 +40,12 @@ static async Task Main(string[] args)
3840
3941 // 2. test connection
4042 Logger . Info ( "Testing connection..." ) ;
41- var pingAsyncResult = await binanceRestClient . PingAsync ( ) ;
43+ var pingAsyncResult = await binanceRestClient . SpotApi . ExchangeData . PingAsync ( ) ;
4244 Logger . Info ( $ "Ping { pingAsyncResult . Data } ms") ;
4345
4446
4547 // 2.1. check permissions
46- var permissionsResponse = await binanceRestClient . General . GetAPIKeyPermissionsAsync ( ) ;
48+ var permissionsResponse = await binanceRestClient . SpotApi . Account . GetAPIKeyPermissionsAsync ( ) ;
4749 if ( ! permissionsResponse . Success )
4850 {
4951 Logger . Error ( $ "{ permissionsResponse . Error ? . Message } ") ;
@@ -57,12 +59,12 @@ static async Task Main(string[] args)
5759
5860
5961 // 3. set bot strategy config
60- var exchangeInfoResult = binanceRestClient . Spot . System . GetExchangeInfoAsync ( Symbol ) ;
62+ var exchangeInfoResult = binanceRestClient . SpotApi . ExchangeData . GetExchangeInfoAsync ( Symbol ) ;
6163
6264 var symbolInfo = exchangeInfoResult . Result . Data . Symbols
6365 . Single ( s => s . Name . Equals ( Symbol , StringComparison . InvariantCultureIgnoreCase ) ) ;
6466
65- if ( ! ( symbolInfo . Status == SymbolStatus . Trading && symbolInfo . OrderTypes . Contains ( OrderType . Market ) ) )
67+ if ( ! ( symbolInfo . Status == SymbolStatus . Trading && symbolInfo . OrderTypes . Contains ( SpotOrderType . Market ) ) )
6668 {
6769 Logger . Error ( $ "Symbol { symbolInfo . Name } doesn't suitable for this strategy") ;
6870 return ;
@@ -85,10 +87,10 @@ static async Task Main(string[] args)
8587 // WARN: set thresholds for strategy here
8688 var strategyConfig = new MarketStrategyConfiguration
8789 {
88- TradeWhenSpreadGreaterThan = .02M , // or 0.02 %, (price spread*min_volume) should be greater than broker's commissions for trade
90+ TradeWhenSpreadGreaterThan = .05M , // or 0.05 %, (price spread*min_volume) should be greater than broker's commissions for trade
8991 MinOrderVolume = symbolInfo . LotSizeFilter . MinQuantity * 10 ,
9092 MaxOrderVolume = symbolInfo . LotSizeFilter . MinQuantity * 100 ,
91- QuoteAssetPrecision = symbolInfo . QuoteAssetPrecision ,
93+ BaseAssetPrecision = symbolInfo . BaseAssetPrecision ,
9294 PricePrecision = pricePrecision ,
9395 ReceiveWindow = ReceiveWindow
9496 } ;
0 commit comments