aboutsummaryrefslogtreecommitdiffstats
path: root/python/trade_dataclasses.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/trade_dataclasses.py')
-rw-r--r--python/trade_dataclasses.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/python/trade_dataclasses.py b/python/trade_dataclasses.py
index 4d910578..ead475cb 100644
--- a/python/trade_dataclasses.py
+++ b/python/trade_dataclasses.py
@@ -871,6 +871,31 @@ class TRSDeal(
def to_globeop(self):
obj = self.serialize("globeop")
+ if obj["buysell"]:
+ key1, key2 = "Pay", "Receive"
+ else:
+ key1, key2 = "Receive", "Pay"
+ d = {
+ f"{key1}LegRateType": "Floating",
+ f"{key1}Underlying": "Interest",
+ f"{key1}FloatRate": line["funding_index"],
+ f"{key1}FixedRate": 0,
+ f"{key1}Daycount": line["funding_daycount"],
+ f"{key1}Frequency": line["funding_freq"],
+ f"{key1}PaymentBDC": obj["funding_payment_roll_convention"],
+ f"{key1}Arrears": obj["funding_arrears"],
+ f"{key1}InterestCalc": obj["interest_calc_method"],
+ f"{key1}Compound": obj["compound_avg_frequency"],
+ f"{key1}Fixing": obj["fixing_frequency"],
+ f"{key2}LegRateType": "Fixed",
+ f"{key2}Underlying": "Bond",
+ f"{key2}FloatRate": line["underlying_security"],
+ f"{key2}DayCount": line["asset_daycount"],
+ f"{key2}Frequency": line["asset_freq"],
+ f"{key2}PaymentBDC": obj["asset_payment_roll_convention"],
+ f"{key2}Price": obj["price"],
+ }
+ obj["swap_type"] = "TOTAL_RETURN_SWAP"
obj["TerminationAmount"] *= self.factor
obj["FeesPaid"] = (
-obj["termination_fee"] if obj["termination_fee"] < 0 else None