From d0f3bf7ecda99171598a38ffdbbc45f6690e58e9 Mon Sep 17 00:00:00 2001 From: David Galindo <35235550+dagacha@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:17:14 +0100 Subject: [PATCH 1/2] fixing missrepresented losses/redemptions --- trades.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trades.py b/trades.py index b99feae9..a5957282 100644 --- a/trades.py +++ b/trades.py @@ -767,8 +767,8 @@ def parse_user( # pylint: disable=too-many-locals,too-many-statements earnings = 0 output += f" Final answer: {fpmm['outcomes'][current_answer]!r} - The trade was for the loser answer.\n" - if not is_invalid: - statistics_table[MarketAttribute.EARNINGS][ + + statistics_table[MarketAttribute.EARNINGS][ market_status ] += earnings From 244c285cc41aefd1ce2b9cec34139c62b2bab9a3 Mon Sep 17 00:00:00 2001 From: David Galindo <35235550+dagacha@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:50:11 +0100 Subject: [PATCH 2/2] adding valid trades row --- trades.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/trades.py b/trades.py index a5957282..4d4ef2ec 100644 --- a/trades.py +++ b/trades.py @@ -175,6 +175,7 @@ class MarketAttribute(Enum): """Attribute""" NUM_TRADES = "Num_trades" + NUM_VALID_TRADES = "Num_valid_trades" WINNER_TRADES = "Winner_trades" NUM_REDEEMED = "Num_redeemed" NUM_INVALID_MARKET = "Num_invalid_market" @@ -544,6 +545,16 @@ def _format_table(table: Dict[Any, Dict[Any, Any]]) -> str: ) + "\n" ) + table_str += ( + f"{MarketAttribute.NUM_VALID_TRADES:<{column_width}}" + + "".join( + [ + f"{table[MarketAttribute.NUM_VALID_TRADES][c]:>{column_width}}" + for c in STATS_TABLE_COLS + ] + ) + + "\n" + ) table_str += ( f"{MarketAttribute.WINNER_TRADES:<{column_width}}" + "".join( @@ -771,6 +782,14 @@ def parse_user( # pylint: disable=too-many-locals,too-many-statements statistics_table[MarketAttribute.EARNINGS][ market_status ] += earnings + + statistics_table[MarketAttribute.NUM_VALID_TRADES][ + market_status + ] = statistics_table[MarketAttribute.NUM_TRADES][ + market_status + ] - statistics_table[MarketAttribute.NUM_INVALID_MARKET][ + market_status + ] if 0 < earnings < DUST_THRESHOLD: output += "Earnings are dust.\n"