aboutsummaryrefslogtreecommitdiffstats
path: root/python/ops/funds.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/ops/funds.py')
-rw-r--r--python/ops/funds.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/python/ops/funds.py b/python/ops/funds.py
index 44b31cdc..aea44f1e 100644
--- a/python/ops/funds.py
+++ b/python/ops/funds.py
@@ -8,6 +8,7 @@ from io import StringIO
from typing import Tuple, Union
from serenitas.utils.env import DAILY_DIR
from .file_gen import get_headers, build_line
+from .trade_dataclasses import DealKind
class Fund:
@@ -127,13 +128,12 @@ class Selene(Fund, fund_name="ISOSEL"):
@classmethod
def stage(cls, trade, *, trade_type, action="NEW", **kwargs):
- if (trade_type not in ("cds", "irs", "swaption", "trs")) or (
- trade_type == "cds" and trade.attach is None
+ obj = DealKind[trade_type].from_dict(**trade)
+ if (
+ (trade_type not in ("cds", "irs", "swaption", "trs"))
+ or (trade_type == "cds" and trade.attach is None)
+ or obj.product.commited
):
- cls.staging_queue.append(trade.to_citco(action))
+ cls.staging_queue.append(obj.to_citco(action))
else:
- if trade.product.committed:
- cls.staging_queue.append(trade.to_citco(action))
- else:
- # Push to product queue
- pass
+ pass