diff options
Diffstat (limited to 'python/ops/funds.py')
| -rw-r--r-- | python/ops/funds.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/python/ops/funds.py b/python/ops/funds.py index 12de1110..101deea2 100644 --- a/python/ops/funds.py +++ b/python/ops/funds.py @@ -1,10 +1,11 @@ import csv import datetime import pathlib -from csv_headers.citco import GTL +from csv_headers.citco import GTL, GIL from serenitas.utils.remote import FtpClient, SftpClient from serenitas.utils.exchange import ExchangeMessage, FileAttachment from io import StringIO +from pickle import dumps from typing import Tuple, Union from serenitas.utils.env import DAILY_DIR from .file_gen import get_headers, build_line @@ -122,7 +123,9 @@ class Selene(Fund, fund_name="ISOSEL"): @classmethod def set_headers(cls, trade_type): - pass + if trade_type == "product": + cls.headers = GIL + cls.filepath_pattern = "i.innocap_serenitas.{timestamp:%Y%m%d%H%M%S}.csv" @staticmethod def upload(buf, dest): @@ -130,13 +133,13 @@ class Selene(Fund, fund_name="ISOSEL"): sftp.put(buf, dest) @classmethod - def stage(cls, trade, *, trade_type, action="NEW", **kwargs): + def stage(cls, trade, *, trade_type, redis_pipeline, **kwargs): obj = DealKind[trade_type].from_dict(**trade) if ( (trade_type not in ("cds", "irs", "swaption", "trs")) or (trade_type == "cds" and obj.attach is None) - or obj.product.committed + or obj.product.status == "Acknowledged" ): - cls.staging_queue.append(obj.to_citco(action)) + cls.staging_queue.append(obj.to_citco(trade["action"])) else: - pass + redis_pipeline.rpush("product_queue", dumps((trade_type, trade))) |
