aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/mtm_upload.py10
-rw-r--r--python/process_queue.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/python/mtm_upload.py b/python/mtm_upload.py
index 58244b81..225cddcf 100644
--- a/python/mtm_upload.py
+++ b/python/mtm_upload.py
@@ -192,13 +192,15 @@ def process_upload(trades, asset_type, upload):
dest.write_bytes(buf)
-def upload_mtm_trades(trade_type, tradeids, conn):
+def upload_mtm_trades(trade_type, tradeid):
_funs = {
- "swaption": (swaption_trades, "swaption"),
- "cds": (tranche_trades, "tranche"),
+ "swaption": (SwaptionDeal, "swaption"),
+ "cds": (CDSDeal, "tranche"),
}
process_upload(
- _funs[trade_type][0](tradeids, conn), _funs[trade_type][1], upload=False
+ (_funs[trade_type][0].from_tradeid(tradeid).to_markit(),),
+ _funs[trade_type][1],
+ upload=True,
)
diff --git a/python/process_queue.py b/python/process_queue.py
index 71e0fe26..b446d3ab 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -88,7 +88,7 @@ def process_indicative(
(trade_type == "cds" and trade.get("attach"))
or (trade_type == "swaption" and trade.get("swap_type", "CD_INDEX_OPTION"))
) and trade.get("upload", True):
- upload_mtm_trades(trade_type, (trade["id"],), conn)
+ upload_mtm_trades(trade_type, trade["id"])
p.delete(trade_type)