aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/serenitasdb.sql15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql
index d50bf2d7..96ef9167 100644
--- a/sql/serenitasdb.sql
+++ b/sql/serenitasdb.sql
@@ -153,7 +153,7 @@ CREATE TABLE tranche_quotes (
IndexRefSpread smallint,
IndexDuration real,
TrancheDuration real,
- TrancheDelta real,
+ TrancheDelta numeric(5, 3),
CorrAtDetachment real,
Basis real,
QuoteSource varchar(4),
@@ -161,6 +161,19 @@ CREATE TABLE tranche_quotes (
deleted bool DEFAULT False NOT NULL,
UNIQUE (QuoteDate, Index, Series, Version, Tenor, Attach, Detach, QuoteSource, trancheupfrontmid)
);
+
+CREATE TABLE tranche_skew
+(id integer GENERATED ALWAYS AS IDENTITY,
+ date date NOT NULL,
+ INDEX index_type NOT NULL,
+ series SMALLINT NOT NULL,
+ VERSION SMALLINT NOT NULL,
+ tenor tenor NOT NULL,
+ el double PRECISION NOT NULL,
+ x bytea NOT NULL,
+ c bytea NOT NULL,
+ UNIQUE (date, INDEX, series, VERSION, tenor));
+
-- partial index constraint, didn't clean the db further back
CREATE UNIQUE INDEX
ON tranche_quotes(quotedate, index, series, version, tenor, attach, detach, quotesource, trancherunningmid)