Пример #1
0
def generate_complete_merkato_configs(merkato_objects):
    merkato_complete_configs = []
    print('merkato_objects', merkato_objects)
    for merkato in merkato_objects:
        complete_config = {}
        config = {"limit_only": True}
        exchange = get_exchange_from_db(merkato['exchange'])

        config['exchange'] = merkato['exchange']
        config['public_api_key'] = exchange['public_api_key']
        config['private_api_key'] = exchange['private_api_key']

        complete_config['configuration'] = config
        complete_config['base'] = merkato['base']
        complete_config['coin'] = merkato['alt']
        complete_config['spread'] = merkato['spread']
        complete_config['starting_price'] = merkato['starting_price']
        complete_config['ask_reserved_balance'] = merkato[
            'ask_reserved_balance']
        complete_config['bid_reserved_balance'] = merkato[
            'bid_reserved_balance']
        complete_config['quote_volume'] = merkato['quote_volume']
        complete_config['base_volume'] = merkato['base_volume']
        merkato_complete_configs.append(complete_config)
    return merkato_complete_configs
Пример #2
0
def load_config():
    # Loads an existing configuration file
    # Returns a dictionary
    exchange_name = input("what is the exchange name? ")
    exchange = get_exchange_from_db(exchange_name)
    decrypt_keys(exchange)
    return exchange
Пример #3
0
def create_new_merkato():
    password = getpass.getpass()
    exchange_name = get_exchange()
    exchange = get_exchange_from_db(exchange_name)

    merkato_args = {}
    merkato_args['configuration'] = decrypt_keys(exchange, password)
    merkato_args['coin'] = get_asset('quote')
    merkato_args['base'] = get_asset('base')
    merkato_args['ask_reserved_balance'] = get_reserve_balance('quote')
    merkato_args['bid_reserved_balance'] = get_reserve_balance('base')
    merkato_args['spread'] = get_merkato_variable('spread')
    merkato_args['profit_margin'] = get_merkato_variable('profit margin')
    merkato_args['step'] = get_merkato_variable('step')
    Merkato(**merkato_args)
    return password
Пример #4
0
def generate_complete_merkato_configs(merkato_tuples):
    merkato_complete_configs = []
    for tuple in merkato_tuples:
        complete_config = {}
        config = {"limit_only": True}
        exchange = get_exchange_from_db(tuple[0])

        config['exchange'] = tuple[0]
        config['public_api_key'] = exchange['public_api_key']
        config['private_api_key'] = exchange['private_api_key']

        complete_config['configuration'] = config
        complete_config['base'] = tuple[2]
        complete_config['coin'] = tuple[3]
        complete_config['spread'] = tuple[4]
        complete_config['ask_reserved_balance'] = tuple[7]
        complete_config['bid_reserved_balance'] = tuple[8]
        merkato_complete_configs.append(complete_config)

    return merkato_complete_configs
Пример #5
0
def create_new_merkato():
    password = getpass.getpass()
    exchange_name = get_exchange()
    exchange = get_exchange_from_db(exchange_name)

    merkato_args = {}
    merkato_args['configuration'] = decrypt_keys(exchange, password)
    merkato_args['coin'] = get_asset('quote')
    merkato_args['base'] = get_asset('base')
    merkato_args['ask_reserved_balance'] = get_reserve_balance('quote')
    merkato_args['bid_reserved_balance'] = get_reserve_balance('base')
    merkato_args['spread'] = get_merkato_variable('spread',
                                                  'for 5% spread use .05')
    merkato_args['profit_margin'] = get_merkato_variable('profit margin')
    merkato_args['step'] = get_merkato_variable('step',
                                                'for 5% step use "1.05"')
    merkato_args['distribution_strategy'] = get_merkato_variable(
        'distribution strategy',
        'Input "1 for aggressive, "2" for neutral, "3" for hyper aggro:')
    merkato_args['increased_orders'] = get_merkato_variable(
        'Increased Orders', 'SUGGESTED IS 0, 1, or 2')
    Merkato(**merkato_args)
    return password