aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/markit_tranche_quotes_csv.py2
-rw-r--r--sql/serenitasdb.sql27
2 files changed, 28 insertions, 1 deletions
diff --git a/python/markit_tranche_quotes_csv.py b/python/markit_tranche_quotes_csv.py
index 6393edc1..b73d2cdd 100644
--- a/python/markit_tranche_quotes_csv.py
+++ b/python/markit_tranche_quotes_csv.py
@@ -10,7 +10,7 @@ index_mapping = {'ITRAXX-Europe': 'EU',
'CDX-NAIG': 'IG',
'CDX-NAHY': 'HY'}
-sql_str = f"""INSERT INTO tranche_quotes_test(quotedate, index, series, version, tenor, attach, detach,
+sql_str = f"""INSERT INTO tranche_quotes_csv(quotedate, index, series, version, tenor, attach, detach,
trancheupfrontbid, trancheupfrontmid, trancheupfrontask,
trancherunningbid, trancherunningmid, trancherunningask,
indexrefprice, indexrefspread, tranchedelta, quotesource, markit_id)
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql
index 7afa1e54..25ce6006 100644
--- a/sql/serenitasdb.sql
+++ b/sql/serenitasdb.sql
@@ -140,6 +140,33 @@ CREATE TABLE tranche_quotes (
UNIQUE (QuoteDate, Index, Series, Version, Tenor, Attach, Detach, QuoteSource, trancherunningmid, markit_id)
);
+CREATE TABLE tranche_quotes_csv(
+ id serial PRIMARY KEY,
+ QuoteDate timestamptz,
+ Index index_type,
+ Series smallint,
+ Version smallint,
+ Tenor tenor,
+ Attach smallint,
+ Detach smallint,
+ TrancheUpfrontBid float,
+ TrancheUpfrontMid float,
+ TrancheUpfrontAsk float,
+ TrancheRunningBid float,
+ TrancheRunningMid float,
+ TrancheRunningAsk float,
+ IndexRefPrice real,
+ IndexRefSpread smallint,
+ IndexDuration real,
+ TrancheDuration real,
+ TrancheDelta real,
+ CorrAtDetachment real,
+ Basis real,
+ QuoteSource varchar(4),
+ markit_id integer UNIQUE,
+ UNIQUE (QuoteDate, Index, Series, Version, Tenor, Attach, Detach, QuoteSource, trancherunningmid, markit_id)
+);
+
CREATE INDEX tranche_quotes_idx ON
tranche_quotes(index, series, DATE(quotedate AT TIME ZONE 'localtime'), tenor, attach ASC)