aboutsummaryrefslogtreecommitdiffstats
path: root/python/recon_bowdst.py
blob: a83262244b51515e7312caae66abdef669146f91 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import pandas as pd
from serenitas.utils.db import dbconn

dawndb = dbconn("dawndb")


# Bonds

df = pd.read_excel("/home/serenitas/flint/rec.xlsx")

security_balance = df[df["Asset Type"] == "FIXED INCOME SECURITIES"][
    "Base Market Value"
].sum()
print(f"The current security balance is {security_balance}")

bowd_bond_trades = df[df["CUSIP"].notnull()]
db_bond_trades = pd.read_sql_query(
    "select * from risk_positions('2021-02-25', null, 'BOWDST')", dawndb
)

bowd_bond_trades.merge(
    db_bond_trades, left_on="Mellon Security ID", right_on="identifier", how="outer"
)[
    [
        "description",
        "identifier",
        "notional",
        "factor",
        "Shares/Par",
        "Base Market Value",
        "usd_market_value",
    ]
]

# market value differences