def run(self): log_content = "" # A_prices,B_prices = self._get_prices_for_test() A_prices,B_prices = self._get_prices() log_content += self._ex_A.name() + ":" + str(A_prices) + "\n" log_content += self._ex_B.name() + ":" + str(B_prices) + "\n" m_max = max(A_prices[self._currency_m], B_prices[self._currency_m]) m_min = min(A_prices[self._currency_m], B_prices[self._currency_m]) n_max = max(A_prices[self._currency_n], B_prices[self._currency_n]) n_min = min(A_prices[self._currency_n], B_prices[self._currency_n]) is_same_side = (A_prices[self._currency_m] == m_max and A_prices[self._currency_n] == n_max) or (B_prices[self._currency_m] == m_max and B_prices[self._currency_n] == n_max) if is_same_side: symbol = 1 else: symbol = -1 rate = round(abs((m_max - m_min)*100/ m_min - (n_max - n_min) * 100 * symbol / n_min), 2) log_content += "Rate: {0}%".format(rate) core.log(log_content) if rate > MIN_EXPECT_RATE: core.pushover(push_over_id, log_content) self._send_sms(rate)
def run(): core.log('='*50 + 'arbitrage run ' + '='*50) try: # exchange_bittrex = bittrex_wrapper(conf.get_account_value('bittrex','apikey'), conf.get_account_value('bittrex', 'secret')) exchange_poloniex = poloniex_wrapper(conf.get_account_value('poloniex','apikey'), conf.get_account_value('poloniex','secret'), "USDT") exchange_yunbi = yunbi_wrapper(conf.get_account_value('yunbi','apikey'), conf.get_account_value('yunbi','secret')) ex_pair = exchange_pair('zec', exchange_yunbi, exchange_poloniex, 6.91) message = ex_pair.run() if len(message) > 0: core.info('message = ' + message) _send_sms(message) except Exception,e: core.info('Exception = ' + str(e))
def run(): core.log('=' * 50 + 'arbitrage run ' + '=' * 50) try: # exchange_bittrex = bittrex_wrapper(conf.get_account_value('bittrex','apikey'), conf.get_account_value('bittrex', 'secret')) exchange_poloniex = poloniex_wrapper( conf.get_account_value('poloniex', 'apikey'), conf.get_account_value('poloniex', 'secret'), "USDT") exchange_yunbi = yunbi_wrapper( conf.get_account_value('yunbi', 'apikey'), conf.get_account_value('yunbi', 'secret')) ex_pair = exchange_pair('zec', exchange_yunbi, exchange_poloniex, 6.91) message = ex_pair.run() if len(message) > 0: core.info('message = ' + message) _send_sms(message) except Exception, e: core.info('Exception = ' + str(e))
def mainLoop(): procStartTime = time.time() procEndTime = time.time() draw.updateScreen() while share.running: procEndTime = time.time() sleepTime = define.drawDelay - (procEndTime - procStartTime) #core.logdebug("sleep", sleepTime) if sleepTime > 0: time.sleep(define.drawDelay - (procEndTime - procStartTime)) procStartTime = time.time() draw.drawScreen() keyboard.procKeypress() while core.pollEvent(): evtype = core.event.type if evtype == SDL_QUIT: core.log("SDL_QUIT event") share.running = False elif evtype == SDL_KEYDOWN: #str(core.sdl.String) keyboard.keydown(str(SDL_GetKeyName( core.event.key.keysym.sym))) elif evtype == SDL_KEYUP: keyboard.keyup(str(SDL_GetKeyName(core.event.key.keysym.sym)))
import core.core as core import core.modules as cmodules import core.commands as comm from core.colors import bc as bc except: import sys sys.path.append('././') import core.core as core import core.modules as cmodules import core.commands as comm from core.colors import bc as bc # START Log files, global variables, etc. config = core.config() logger = core.log() DIG_SYM = (config['TOOLS']['DIG_SYM']) # END Log files, global variables, etc. # OPTIONS class options(): Author = 'Thomas TJ (TTJ)' Name = 'Domain info groper' Call = 'dig' Modulename = 'dnsdig' Category = 'recon' Type = 'dns' # sin = single action/program, aut = multiple programs combined for attack Version = '0.1' License = 'MIT'