diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/book_bbg.py | 2 | ||||
| -rw-r--r-- | python/mtm_upload.py | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/python/book_bbg.py b/python/book_bbg.py index 7d345789..dcbc0025 100644 --- a/python/book_bbg.py +++ b/python/book_bbg.py @@ -49,7 +49,7 @@ def get_bbg_data(bbg_id, trade_date, conn): with conn.cursor() as c: c.execute(sql_str, (indextype, series, tenor, trade_date)) redcode, maturity, coupon = c.fetchone() - return str(maturity), redcode, coupon + return str(maturity), redcode, coupon / 100 def cdx_booking_process(path): diff --git a/python/mtm_upload.py b/python/mtm_upload.py index d6dbb25e..e48a26b6 100644 --- a/python/mtm_upload.py +++ b/python/mtm_upload.py @@ -87,7 +87,7 @@ def tranche_trades(conn): with conn.cursor() as c: trades = [] c.execute( - "SELECT * FROM cds where attach is not NULL and trade_date > %s and id=3395", + "SELECT * FROM cds where attach is not NULL and trade_date > %s and id=3445", (datetime.date(2020, 12, 1),), ) for row in c: @@ -106,8 +106,9 @@ def tranche_trades(conn): "security_id": "RED", "orig_attach": "Attachment Point", "orig_detach": "Exhaustion Point", - "currency": "Currency Code" - # "upfront_settle_date": "First Payment Date", + "currency": "Currency Code", + "upfront_settle_date": "First Payment Date", + "cp_code": "Broker Id", }, ) if obj["Initial Payment"] >= 0: @@ -115,6 +116,7 @@ def tranche_trades(conn): else: obj["Initial Payment"] = abs(obj["Initial Payment"]) obj["Transaction Code"] = "Pay" + obj["Swap ID"] = "test_1" obj["Trade ID"] = obj["Swap ID"] obj["Product Type"] = "TRN" obj["Transaction Type"] = "NEW" @@ -130,7 +132,7 @@ def tranche_trades(conn): obj["Account Abbreviation"] = "Serenitas-test1" # obj["Initial Payment Currency"] = "USD" # obj["First Payment Date"] = "2022-01-18" - obj["Broker Id"] = "0000571T" + # obj["Broker Id"] = "0000571T" # obj['DTCC Ineligible'] = 'N' obj["Master Document Date"] = "2016-02-17" trades.append(obj) |
