From c569417c57c5dfe24598fb9d4bf45931b745625c Mon Sep 17 00:00:00 2001 From: sina <20732540+SinaKhalili@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:06:05 -0800 Subject: [PATCH] Update price shock cached to show slot --- src/page/price_shock_cached.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/page/price_shock_cached.py b/src/page/price_shock_cached.py index dbbcb02..fc48ee9 100644 --- a/src/page/price_shock_cached.py +++ b/src/page/price_shock_cached.py @@ -14,6 +14,8 @@ from solana.rpc.async_api import AsyncClient import streamlit as st +from utils import get_current_slot + class UserLeveragesResponse(TypedDict): leverages_none: list[Any] @@ -154,6 +156,10 @@ def price_shock_cached_page(): st.write("Check again in one minute!") st.stop() + current_slot = get_current_slot() + st.info( + f"This data is for slot {result['slot']}, which is now {int(current_slot) - int(result['slot'])} slots old" + ) fig = price_shock_plot(result, oracle_distort) st.plotly_chart(fig) oracle_down_max = pd.DataFrame(result["leverages_down"][-1])