return decorate
max_digits = 18
-current_assets = {
- "ETH": int(2.00000000 * 10**max_digits),
- "BTC": int(1.23000000 * 10**max_digits),
- "ZEC": int(2.00000000 * 10**max_digits),
- "SC" : int(2.000000000 * 10**max_digits),
- }
repartition_pertenthousand = {
"BTC": 2857,
get_ticker.cache[(c1, c2, market.__class__)] = None
return get_ticker(c1, c2, market)
+def fetch_balances(market):
+ balances = {}
+ fetched_balance = market.fetch_balance()
+ for key, value in fetched_balance["total"].items():
+ if value > 0:
+ balances[key] = int(value * 10**max_digits)
+ return balances
+
def assets_value(assets, market, base_currency="BTC"):
repartition_in_base_currency = {}
for currency, asset_value in assets.items():
for currency, value in new_repartition.items():
print("holding {} {}".format(formatted_price(value), currency))
+current_assets = fetch_balances(market)
give_orders(current_assets, repartition_pertenthousand, market)