randomize_cjfee = int(random.uniform(float(self.cjfee_a) * (1 - float(self.cjfee_factor)), float(self.cjfee_a) * (1 + float(self.cjfee_factor)))) randomize_cjfee = randomize_cjfee + randomize_txfee else: randomize_cjfee = random.uniform(float(f) * (1 - float(self.cjfee_factor)), float(f) * (1 + float(self.cjfee_factor))) randomize_cjfee = "{0:.6f}".format(randomize_cjfee) # round to 6 decimals order = {'oid': 0, 'ordertype': self.ordertype, 'minsize': randomize_minsize, 'maxsize': randomize_maxsize, 'txfee': randomize_txfee, 'cjfee': str(randomize_cjfee)} # sanity check assert order['minsize'] >= 0 assert order['maxsize'] > 0 assert order['minsize'] <= order['maxsize'] if order['ordertype'] in ['swreloffer', 'sw0reloffer']: while order['txfee'] >= (float(order['cjfee']) * order['minsize']): order['txfee'] = int(order['txfee'] / 2) jlog.info('Warning: too high txfee to be profitable, halfing it to: ' + str(order['txfee'])) return [order] if __name__ == "__main__": ygmain(YieldGeneratorPrivacyEnhanced, nickserv_password='') jmprint('done', "success")
'minsize': randomize_minsize, 'maxsize': randomize_maxsize, 'txfee': randomize_txfee, 'cjfee': str(randomize_cjfee) } # sanity check assert order['minsize'] >= 0 assert order['maxsize'] > 0 assert order['minsize'] <= order['maxsize'] if order['ordertype'] == 'swreloffer': while order['txfee'] >= (float(order['cjfee']) * order['minsize']): order['txfee'] = int(order['txfee'] / 2) jlog.info( 'Warning: too high txfee to be profitable, halfing it to: ' + str(order['txfee'])) return [order] if __name__ == "__main__": ygmain(YieldGeneratorPrivacyEnhanced, txfee=txfee, cjfee_a=cjfee_a, cjfee_r=cjfee_r, ordertype=ordertype, nickserv_password='', minsize=minsize, gaplimit=gaplimit) jmprint('done', "success")
txfee = 100 cjfee_a = 500 cjfee_r = '0.00002' ordertype = 'swreloffer' nickserv_password = '' minsize = 100000 gaplimit = 6 class YieldGeneratorAcyclic(YieldGeneratorBasic): """A yield-generator bot that sends funds linearly through the mixdepths, but not back from the "lowest" depth to the beginning. Instead, it lets funds accumulate there, so that they can then be manually sent elsewhere as needed.""" def __init__(self, wallet_service, offerconfig): super(YieldGeneratorAcyclic, self).__init__(wallet_service, offerconfig) def get_available_mixdepths(self): balances = self.wallet_service.get_balance_by_mixdepth(verbose=False) return {m: b for m, b in iteritems(balances) if m < self.wallet_service.mixdepth} if __name__ == "__main__": ygmain(YieldGeneratorAcyclic, txfee=txfee, cjfee_a=cjfee_a, cjfee_r=cjfee_r, ordertype=ordertype, nickserv_password=nickserv_password, minsize=minsize, gaplimit=gaplimit) jmprint('done', "success")
#!/usr/bin/env python3 from jmbase import jmprint from jmclient import YieldGeneratorBasic, ygmain # YIELD GENERATOR SETTINGS ARE NOW IN YOUR joinmarket.cfg CONFIG FILE # (You can also use command line flags; see --help for this script). if __name__ == "__main__": ygmain(YieldGeneratorBasic, nickserv_password='') jmprint('done', "success")
from builtins import * # noqa: F401 from future.utils import iteritems from jmbase import jmprint from jmclient import YieldGeneratorBasic, ygmain # YIELD GENERATOR SETTINGS ARE NOW IN YOUR joinmarket.cfg CONFIG FILE # (You can also use command line flags; see --help for this script). class YieldGeneratorAcyclic(YieldGeneratorBasic): """A yield-generator bot that sends funds linearly through the mixdepths, but not back from the "lowest" depth to the beginning. Instead, it lets funds accumulate there, so that they can then be manually sent elsewhere as needed.""" def __init__(self, wallet_service, offerconfig): super(YieldGeneratorAcyclic, self).__init__(wallet_service, offerconfig) def get_available_mixdepths(self): balances = self.wallet_service.get_balance_by_mixdepth(verbose=False) return { m: b for m, b in iteritems(balances) if m < self.wallet_service.mixdepth } if __name__ == "__main__": ygmain(YieldGeneratorAcyclic, nickserv_password='') jmprint('done', "success")