aboutsummaryrefslogtreecommitdiffstats
path: root/python/collateral/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/collateral/common.py')
-rw-r--r--python/collateral/common.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/python/collateral/common.py b/python/collateral/common.py
index de63f35e..6dac36bc 100644
--- a/python/collateral/common.py
+++ b/python/collateral/common.py
@@ -1,7 +1,6 @@
import logging
import pandas as pd
from exchangelib import HTMLBody
-from . import ExchangeMessage
logger = logging.getLogger(__name__)
@@ -25,20 +24,23 @@ def compare_notionals(df, positions, fcm: str):
def get_dawn_trades(d, engine):
df_cds = pd.read_sql_query(
- "SELECT cpty_id, folder FROM cds "
+ "SELECT cpty_id, folder, initial_margin_percentage * notional / 100 as IA "
+ "FROM cds "
"WHERE cpty_id IS NOT NULL AND trade_date <= %s",
engine,
params=(d,),
)
df_swaptions = pd.read_sql_query(
- "SELECT cpty_id, folder FROM swaptions "
+ "SELECT cpty_id, folder, initial_margin_percentage * notional / 100 AS IA "
+ "FROM swaptions "
"WHERE cpty_id IS NOT NULL "
"AND trade_date <= %s",
engine,
params=(d,),
)
df_caps = pd.read_sql_query(
- "SELECT cpty_id, folder FROM capfloors "
+ "SELECT cpty_id, folder, initial_margin_percentage * amount / 100 AS IA "
+ "FROM capfloors "
"WHERE cpty_id IS NOT NULL "
"AND trade_date <= %s",
engine,
@@ -68,6 +70,8 @@ def get_dawn_trades(d, engine):
def send_email(d, df):
+ from exchange import ExchangeMessage
+
pd.set_option("display.float_format", "{:.2f}".format)
df = df.drop("date", axis=1).set_index("broker")
cp_mapping = {
@@ -75,7 +79,7 @@ def send_email(d, df):
"MS": "Morgan Stanley",
"GS": "Goldman Sachs",
"BAML_FCM": "Baml FCM",
- # "BAML_ISDA": "Baml OTC",
+ "BAML_ISDA": "Baml OTC",
"WELLS": "Wells Fargo",
}
html = "<html><body>"