Skip to content

Commit

Permalink
Update price shock cached to show slot
Browse files Browse the repository at this point in the history
  • Loading branch information
SinaKhalili committed Nov 25, 2024
1 parent 5521d3b commit c569417
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/page/price_shock_cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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])
Expand Down

0 comments on commit c569417

Please sign in to comment.