diff --git a/bin/marketmaker b/bin/marketmaker index 0ab3241..dab701d 100755 --- a/bin/marketmaker +++ b/bin/marketmaker @@ -271,7 +271,7 @@ model_state = mango.marketmaking.ModelState(market, latest_account_observer, add_file_health("marketmaker_pulse", market_maker.pulse_complete, disposer) -logging.info("Current assets in account:") +logging.info(f"Current assets in account {account.address} (owner: {account.owner}):") mango.TokenValue.report([asset for asset in account.net_assets if asset is not None], logging.info) pulse_disposable = rx.interval(args.pulse_interval).subscribe( diff --git a/mango/account.py b/mango/account.py index 7688715..7f5c29f 100644 --- a/mango/account.py +++ b/mango/account.py @@ -28,6 +28,7 @@ from .group import Group from .layouts import layouts from .metadata import Metadata from .perpaccount import PerpAccount +from .token import Token from .tokenvalue import TokenValue from .version import Version @@ -256,10 +257,11 @@ class Account(AddressableAccount): item_to_update.spot_open_orders = spot_open_orders def __str__(self) -> str: + shared_quote_token: str = f"{self.shared_quote_token}".replace("\n", "\n ") basket_count = len(self.basket) basket = "\n ".join([f"{item}".replace("\n", "\n ") for item in self.basket]) - tokens_in_basket = Account._map_sequence_to_basket_indices( + tokens_in_basket: typing.Sequence[typing.Optional[Token]] = Account._map_sequence_to_basket_indices( self.basket, self.basket_indices, lambda item: item.token_info.token) symbols_in_basket = list([tok.symbol for tok in tokens_in_basket if tok is not None]) in_margin_basket = ", ".join(symbols_in_basket) or "None" @@ -270,6 +272,8 @@ class Account(AddressableAccount): MSRM: {self.msrm_amount} Bankrupt? {self.is_bankrupt} Being Liquidated? {self.being_liquidated} + Shared Quote Token: + {shared_quote_token} In Basket: {in_margin_basket} Basket [{basket_count} in basket]: {basket} diff --git a/mango/perpaccount.py b/mango/perpaccount.py index dbc2d12..fc4d4b4 100644 --- a/mango/perpaccount.py +++ b/mango/perpaccount.py @@ -50,7 +50,7 @@ class PerpAccount: return PerpAccount(base_position, quote_position, long_settled_funding, short_settled_funding, mngo_accrued, open_orders) def __str__(self) -> str: - if self.base_position == Decimal(0) and self.quote_position == Decimal(0) and self.long_settled_funding == Decimal(0) and self.short_settled_funding == Decimal(0) and self.mngo_accrued == Decimal(0) and self.open_orders.free_slot_bits == 0xFFFFFFFF: + if self.base_position == Decimal(0) and self.quote_position == Decimal(0) and self.long_settled_funding == Decimal(0) and self.short_settled_funding == Decimal(0) and self.mngo_accrued.value == Decimal(0) and self.open_orders.free_slot_bits == 0xFFFFFFFF: return "Β« π™ΏπšŽπš›πš™π™°πšŒπšŒπš˜πšžπš—πš (empty) Β»" open_orders = f"{self.open_orders}".replace("\n", "\n ") return f"""Β« π™ΏπšŽπš›πš™π™°πšŒπšŒπš˜πšžπš—πš