Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.

Commit 244c285

Browse files
committed
adding valid trades row
1 parent d0f3bf7 commit 244c285

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

trades.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ class MarketAttribute(Enum):
175175
"""Attribute"""
176176

177177
NUM_TRADES = "Num_trades"
178+
NUM_VALID_TRADES = "Num_valid_trades"
178179
WINNER_TRADES = "Winner_trades"
179180
NUM_REDEEMED = "Num_redeemed"
180181
NUM_INVALID_MARKET = "Num_invalid_market"
@@ -544,6 +545,16 @@ def _format_table(table: Dict[Any, Dict[Any, Any]]) -> str:
544545
)
545546
+ "\n"
546547
)
548+
table_str += (
549+
f"{MarketAttribute.NUM_VALID_TRADES:<{column_width}}"
550+
+ "".join(
551+
[
552+
f"{table[MarketAttribute.NUM_VALID_TRADES][c]:>{column_width}}"
553+
for c in STATS_TABLE_COLS
554+
]
555+
)
556+
+ "\n"
557+
)
547558
table_str += (
548559
f"{MarketAttribute.WINNER_TRADES:<{column_width}}"
549560
+ "".join(
@@ -771,6 +782,14 @@ def parse_user( # pylint: disable=too-many-locals,too-many-statements
771782
statistics_table[MarketAttribute.EARNINGS][
772783
market_status
773784
] += earnings
785+
786+
statistics_table[MarketAttribute.NUM_VALID_TRADES][
787+
market_status
788+
] = statistics_table[MarketAttribute.NUM_TRADES][
789+
market_status
790+
] - statistics_table[MarketAttribute.NUM_INVALID_MARKET][
791+
market_status
792+
]
774793

775794
if 0 < earnings < DUST_THRESHOLD:
776795
output += "Earnings are dust.\n"

0 commit comments

Comments
 (0)