Sha256: 4c7e9383f8766e598c3406ddcfecfb03402e098c0ed697192d0df34fb099ccd6
Contents?: true
Size: 1.23 KB
Versions: 2
Compression:
Stored size: 1.23 KB
Contents
require "SimBot/version" require 'thor' module SimBot class CLI < Thor require 'utils' require 'api_controller' desc 'start', 'Start simulation bot parsing in base-url and auth token.' method_option :base_url, type: :string, default: 'https://platform.test.ovex.io/', desc: 'API base URL' method_option :jwt, type: :string, required: true, desc: 'JWT to be used' method_option :market, type: :string, default: 'bchxrp', required: false, desc: 'OVEX market for SimBot to interact with' method_option :freq, type: :numeric, default: 1, desc: 'Frequency for trades to be added' def start count = 0 api = ApiController.new(options[:base_url], options[:jwt]) loop do vol = rand(0.2...2.9) price = Utils.get_bchxrp_price api.post_order(options[:market], price, vol, 'sell') sleep(1 / options[:freq]) api.post_order(options[:market], price, vol, 'buy') puts "order ##{count} placed" count += 1 end end desc 'bchxrp_price', 'get the price of BCH in XRP' def bchxrp_price puts Utils.get_bchxrp_price end desc 'eoseth_price', 'get the price of EOS in ETH' def eoseth_price puts Utils.get_eoseth_price end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
SimBot-0.1.3 | lib/SimBot.rb |
SimBot-0.1.2 | lib/SimBot.rb |