aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/process_queue.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/process_queue.py b/python/process_queue.py
index 503af5bb..e8ddd606 100644
--- a/python/process_queue.py
+++ b/python/process_queue.py
@@ -760,6 +760,21 @@ def cds_trade_process(conn, session, trade):
trade["curr_notional"] = trade["notional"] * tranche_factor
else:
trade["curr_notional"] = trade["notional"] * factor
+ if not is_tranche_trade(trade):
+ index = CreditIndex(
+ redcode=trade["security_id"],
+ maturity=trade["maturity"],
+ notional=trade["notional"],
+ value_date=trade["trade_date"],
+ )
+ index.ref = trade["ref"]
+ trade["upfront"] = -index.pv
+ with conn.cursor() as c:
+ c.execute(
+ "UPDATE cds SET upfront=%s WHERE dealid=%s",
+ (trade["upfront"], trade["dealid"]),
+ )
+ conn.commit()
return trade