diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/serenitasdb.sql | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql index 2ed20248..01b9ad9b 100644 --- a/sql/serenitasdb.sql +++ b/sql/serenitasdb.sql @@ -938,11 +938,36 @@ CREATE TABLE JPY_curves( effective_date date PRIMARY KEY,
curve bytea);
+CREATE TYPE rate_type AS ENUM('OIS', 'FUT', 'SWP', 'DEP', 'IND', 'BASIS');
+
+CREATE TABLE bbg_rate_tickers(
+ bbg_ticker text PRIMARY KEY,
+ quote_type rate_type NOT NULL,
+ currency curr NOT NULL,
+ tenor text,
+ start_date date
+);
+
+CREATE TABLE bbg_rate_quotes(
+ date date,
+ bbg_ticker text REFERENCES bbg_rate_tickers,
+ quote1 double,
+ quote2 double,
+ PRIMARY KEY (date, bbg_ticker)
+);
+
+-- require the btree_gist extension
+CREATE TABLE bbg_curves(
+ curve_type smallint,
+ members text[] NOT NULL,
+ in_effect daterange,
+ EXCLUDE USING gist (curve_type WITH =, in_effect WITH &&)
+);
+
CREATE TABLE bbg_curves(
- curve_date date,
curve_type smallint,
- quotes jsonb,
- PRIMARY KEY (curve_date, curve_type)
+ members text[] NOT NULL,
+ in_effect daterange
);
CREATE TABLE cds_curves(
|
