aboutsummaryrefslogtreecommitdiffstats
path: root/python/populate_tranche_cashflows.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/populate_tranche_cashflows.py')
-rw-r--r--python/populate_tranche_cashflows.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/python/populate_tranche_cashflows.py b/python/populate_tranche_cashflows.py
index 99080597..a46d169a 100644
--- a/python/populate_tranche_cashflows.py
+++ b/python/populate_tranche_cashflows.py
@@ -65,7 +65,11 @@ def insert_tranche_accrued(d: datetime.date, dawndb, fund="SERCGMAST"):
(
t.cs["payment_dates"][0],
t.trade_id,
- -t.cs["coupons"][0] * t.tranche_running * t.notional * 1e-4,
+ -t.cs["coupons"][0]
+ * t.tranche_running
+ * t.notional
+ * t.tranche_factor
+ * 1e-4,
t.currency,
),
)
@@ -75,12 +79,25 @@ def insert_tranche_accrued(d: datetime.date, dawndb, fund="SERCGMAST"):
if __name__ == "__main__":
dawndb = dbconn("dawndb")
# conn = serenitas_pool.getconn()
- # auction_date = datetime.date(2020, 8, 4)
+ # auction_date = datetime.date(2022, 6, 7)
# severity, acc = get_default_information(auction_date, conn)
- # insert_tranche_cashflows(auction_date, severity, acc, (1590, 1413), dawndb)
+ # insert_tranche_cashflows(auction_date, severity, acc, (3157,
+ # 3154,
+ # 3096,
+ # 3078,
+ # 3715,
+ # 3156,
+ # 3153,
+ # 3126,
+ # 3102,
+ # 3088,
+ # 3070,
+ # 3030,
+ # 2993,
+ # 3400), dawndb)
# serenitas_pool.putconn(conn)
import serenitas.analytics
serenitas.analytics._include_todays_cashflows = True
for fund in ("SERCGMAST", "BOWDST", "BRINKER"):
- insert_tranche_accrued(datetime.date(2021, 12, 17), dawndb, fund)
+ insert_tranche_accrued(datetime.date(2022, 6, 17), dawndb, fund)