def main(): arbitrer = arbitrage.Arbitrer() depths = arbitrer.depths = json.load(open("speed-test.json")) start_time = time.time() testobs = TestObserver() arbitrer.observers = [testobs] arbitrer.arbitrage_opportunity("BitstampUSD", depths["BitstampUSD"]["asks"][0], "KrakenEUR", depths["KrakenEUR"]["asks"][0]) # FIXME: add asserts (from Maxme) elapsed = time.time() - start_time print("Time: %.3f" % elapsed)
def main(): comment('initiate arbitrer') arbitrer = arbitrage.Arbitrer() comment('load depths') depths = arbitrer.depths = json.load(open("speed-test.json")) start_time = time.time() comment('initiate obs') testobs = TestObserver() arbitrer.observers = [testobs] comment('arbitrer.arbitrage_opportunity') arbitrer.tick() elapsed = time.time() - start_time comment("Time: %.3f" % elapsed) arbitrer.arbitrage_opportunity("BitstampUSD", depths["BitstampUSD"]["asks"][0], "MtGoxEUR", depths["MtGoxEUR"]["asks"][0]) # FIXME: add asserts elapsed = time.time() - start_time - elapsed comment("Time: %.3f" % elapsed)
def setUp(self): self.arbitrer = arbitrage.Arbitrer()