diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/process_queue.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/process_queue.py b/python/process_queue.py index 1d9870c5..8c37fbc4 100644 --- a/python/process_queue.py +++ b/python/process_queue.py @@ -354,6 +354,8 @@ def get_bbg_data( "FLOATER", "FLT_SPREAD", "CPN", + "CPN_TYP", + "STRUCTURED_NOTE_CPN_FORMULA", "CPN_FREQ", "FIRST_CPN_DT", "MTG_PAY_DELAY", @@ -399,6 +401,10 @@ def get_bbg_data( "asset_class", "start_accrued_date", "issuer", + "coupon_formula", + "coupon_cap", + "coupon_floor", + "coupon_type", ] placeholders = ",".join(["%s"] * len(sql_fields)) columns = ",".join(sql_fields) @@ -414,6 +420,14 @@ def get_bbg_data( day_count = m.group(0) if isinstance(pay_delay, str): pay_delay = int(pay_delay.split(" ")[0]) + cpn_formula = bbg_data.get("STRUCTURED_NOTE_CPN_FORMULA") + if cpn_formula is not None: + t = cpn_formula.loc[0] + t = ( + t["Coupon Formula"], + float(t["Coupon Floor"]) if t["Coupon Floor"] else None, + float(t["Coupon Cap"]) if t["Coupon Cap"] else None, + ) with conn.cursor() as c: c.execute( sqlstr, @@ -436,6 +450,8 @@ def get_bbg_data( asset_class, bbg_data.get("START_ACC_DT") or bbg_data.get("PREV_CPN_DT"), bbg_data["ISSUER"], + bbg_data["CPN_TYP"], + *t, ), ) conn.commit() |
