DRRK/main.py
Raykov-MS c1c73e96f5 Add funding rates, positions, business calendar and xlsx export
- funding_rate table and "Фондирование" page: rate from date, history, rate on date (D27)
- positions by issue: BUY - SELL per portfolio, "Остатки" page (D29)
- quotes are loaded only for securities with an open position (D10)
- business calendar from xmlcalendar.ru: yearly file upload, report date
  and update job use previous working day (D30)
- xlsx download for positions, quotes and funding rate history
- manual operation type as radio buttons
- QUIK instruments with purchase marks ("МТС 2Р-18_1") match the issue,
  file name kept in operation.instrument (D17)
- migrations d3a6f8b1c254, e7b2c9d4a813, f1c4a7e9b352
- project.md: decisions and questions after customer meetings
2026-10-29 11:20:15 +03:00

56 lines
1.6 KiB
Python

from __future__ import annotations
import streamlit as st
from dotenv import load_dotenv
from app.auth.service import AuthService, clear_session
from app.core.logging import setup_logging
from app.ui.pages import (
business_calendar,
funding,
manual_operations,
market_data,
positions,
quik_import,
securities,
)
def main() -> None:
load_dotenv()
setup_logging()
st.set_page_config(
page_title="Портфели ДРРК", page_icon=":bar_chart:", layout="wide"
)
if not AuthService().run():
return
navigation = st.navigation(
[
st.Page(securities.render, title="Бумаги", url_path="securities"),
st.Page(market_data.render, title="Рыночные данные", url_path="market"),
st.Page(quik_import.render, title="Загрузка сделок", url_path="quik"),
st.Page(
manual_operations.render, title="Ручные операции", url_path="manual"
),
st.Page(positions.render, title="Остатки", url_path="positions"),
st.Page(funding.render, title="Фондирование", url_path="funding"),
st.Page(business_calendar.render, title="Календарь", url_path="calendar"),
]
)
with st.sidebar:
profile = st.session_state.get("user_profile", {})
st.caption(profile.get("name") or profile.get("email", ""))
if st.button("Выйти", type="secondary"):
clear_session()
st.rerun()
navigation.run()
if __name__ == "__main__":
main()