rosacastillo
commited on
Commit
·
be3f31a
1
Parent(s):
f7c2ff7
Added check for unknown traders size
Browse files
app.py
CHANGED
@@ -303,40 +303,41 @@ with demo:
|
|
303 |
outputs=[trade_no_details_plot],
|
304 |
)
|
305 |
# Unknown traders graph
|
306 |
-
|
307 |
-
gr.
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
|
|
316 |
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
trades_df=unknown_trades,
|
322 |
trader_filter="all",
|
323 |
)
|
324 |
-
|
325 |
-
trade_details_text = get_trade_metrics_text()
|
326 |
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
trader_filter="all",
|
332 |
)
|
333 |
-
return new_u_plot
|
334 |
-
|
335 |
-
trade_u_details_selector.change(
|
336 |
-
update_na_trade_details,
|
337 |
-
inputs=[trade_u_details_selector, trade_u_details_plot],
|
338 |
-
outputs=[trade_u_details_plot],
|
339 |
-
)
|
340 |
|
341 |
with gr.TabItem("🔒 Staking traders"):
|
342 |
with gr.Row():
|
|
|
303 |
outputs=[trade_no_details_plot],
|
304 |
)
|
305 |
# Unknown traders graph
|
306 |
+
if len(unknown_trades) > 0:
|
307 |
+
with gr.Row():
|
308 |
+
gr.Markdown(
|
309 |
+
"# Weekly trading metrics for trades coming from unknown traders"
|
310 |
+
)
|
311 |
+
with gr.Row():
|
312 |
+
trade_u_details_selector = gr.Dropdown(
|
313 |
+
label="Select a trade metric",
|
314 |
+
choices=trade_metric_choices,
|
315 |
+
value=default_trade_metric,
|
316 |
+
)
|
317 |
|
318 |
+
with gr.Row():
|
319 |
+
with gr.Column(scale=3):
|
320 |
+
trade_u_details_plot = plot_trade_metrics(
|
321 |
+
metric_name=default_trade_metric,
|
322 |
+
trades_df=unknown_trades,
|
323 |
+
trader_filter="all",
|
324 |
+
)
|
325 |
+
with gr.Column(scale=1):
|
326 |
+
trade_details_text = get_trade_metrics_text()
|
327 |
+
|
328 |
+
def update_na_trade_details(trade_detail, trade_u_details_plot):
|
329 |
+
new_u_plot = plot_trade_metrics(
|
330 |
+
metric_name=trade_detail,
|
331 |
trades_df=unknown_trades,
|
332 |
trader_filter="all",
|
333 |
)
|
334 |
+
return new_u_plot
|
|
|
335 |
|
336 |
+
trade_u_details_selector.change(
|
337 |
+
update_na_trade_details,
|
338 |
+
inputs=[trade_u_details_selector, trade_u_details_plot],
|
339 |
+
outputs=[trade_u_details_plot],
|
|
|
340 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
341 |
|
342 |
with gr.TabItem("🔒 Staking traders"):
|
343 |
with gr.Row():
|