Skip to content

Commit

Permalink
Update health page
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKhalili committed Oct 8, 2024
1 parent 5545176 commit f334c3e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 45 deletions.
87 changes: 46 additions & 41 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from dotenv import load_dotenv
from lib.page import header
from lib.page import needs_backend
Expand All @@ -19,50 +21,53 @@
header()
sidebar()

pg = st.navigation(
[
st.Page(
welcome_page,
url_path="welcome",
title="Welcome",
icon=":material/home:",
),
st.Page(
orderbook_page,
url_path="orderbook",
title="Orderbook",
icon="📈",
),
st.Page(
needs_backend(health_page),
url_path="health",
title="Health",
icon="🏥",
),
st.Page(
needs_backend(price_shock_page),
url_path="price-shock",
title="Price Shock",
icon="💸",
),
st.Page(
needs_backend(asset_liab_matrix_page),
url_path="asset-liab-matrix",
title="Asset-Liab Matrix",
icon="📊",
),
st.Page(
needs_backend(plot_liquidation_curve),
url_path="liquidation-curves",
title="Liquidation Curves",
icon="🌊",
),
pages = [
st.Page(
welcome_page,
url_path="welcome",
title="Welcome",
icon=":material/home:",
),
st.Page(
orderbook_page,
url_path="orderbook",
title="Orderbook",
icon="📈",
),
st.Page(
needs_backend(health_page),
url_path="health",
title="Health",
icon="🏥",
),
st.Page(
needs_backend(price_shock_page),
url_path="price-shock",
title="Price Shock",
icon="💸",
),
st.Page(
needs_backend(asset_liab_matrix_page),
url_path="asset-liab-matrix",
title="Asset-Liab Matrix",
icon="📊",
),
st.Page(
needs_backend(plot_liquidation_curve),
url_path="liquidation-curves",
title="Liquidation Curves",
icon="🌊",
),
]
if os.getenv("DEV"):
pages.append(
st.Page(
needs_backend(backend_page),
url_path="backend",
title="Control Backend",
icon="🧪",
),
]
)
)
)

pg = st.navigation(pages)
pg.run()
8 changes: 4 additions & 4 deletions src/page/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def health_page():

with perp_col:
st.markdown("### **Largest perp positions:**")
st.write(largest_perp_positions)
st.dataframe(largest_perp_positions, hide_index=True)
st.markdown("### **Most levered perp positions > $1m:**")
st.write(most_levered_positions)
st.dataframe(most_levered_positions, hide_index=True)

with spot_col:
st.markdown("### **Largest spot borrows:**")
st.write(largest_spot_borrows)
st.dataframe(largest_spot_borrows, hide_index=True)
st.markdown("### **Most levered spot borrows > $750k:**")
st.write(most_levered_borrows)
st.dataframe(most_levered_borrows, hide_index=True)

0 comments on commit f334c3e

Please sign in to comment.