diff --git a/lib/rbtc_arbitrage/cli.rb b/lib/rbtc_arbitrage/cli.rb index a2d337a..a76345f 100644 --- a/lib/rbtc_arbitrage/cli.rb +++ b/lib/rbtc_arbitrage/cli.rb @@ -6,8 +6,8 @@ class CLI < Thor option :cutoff, type: :numeric, default: 2, desc: "The minimum profit level required to execute a trade." option :volume, type: :numeric, default: 0.01, desc: "The amount of bitcoins to trade per transaction." option :verbose, type: :boolean, default: true, desc: "Whether you wish to log information." - option :buyer, type: :string, default: "campbx" - option :seller, type: :string, default: "bitstamp" + option :buyer, type: :string, default: "bitstamp" + option :seller, type: :string, default: "campbx" option :repeat, type: :numeric, default: nil option :notify, type: :boolean, default: false def trade diff --git a/lib/rbtc_arbitrage/trader.rb b/lib/rbtc_arbitrage/trader.rb index 16cc526..b367502 100644 --- a/lib/rbtc_arbitrage/trader.rb +++ b/lib/rbtc_arbitrage/trader.rb @@ -94,7 +94,13 @@ def log_info logger.info "#{higher_ex}: $#{seller[:price].round(2)}" logger.info "buying #{@options[:volume]} btc from #{lower_ex} for $#{@paid.round(2)}" logger.info "selling #{@options[:volume]} btc on #{higher_ex} for $#{@received.round(2)}" - logger.info "profit: $#{(@received - @paid).round(2)} (#{@percent.round(2)}%)" + + profit_msg = "profit: $#{(@received - @paid).round(2)} (#{@percent.round(2)}%)" + if cutoff = @options[:cutoff] + profit_msg << " is #{@percent < cutoff ? 'below' : 'above'} cutoff" + profit_msg << " of #{cutoff}%." + end + logger.info profit_msg end def get_balance