aboutsummaryrefslogtreecommitdiffstats
path: root/sql/serenitasdb.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/serenitasdb.sql')
-rw-r--r--sql/serenitasdb.sql39
1 files changed, 29 insertions, 10 deletions
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql
index 46f56076..afa9e575 100644
--- a/sql/serenitasdb.sql
+++ b/sql/serenitasdb.sql
@@ -615,7 +615,7 @@ CREATE TABLE USD_rates(
"15Y" real,
"20Y" real,
"25Y" real,
- "30Y" real)
+ "30Y" real);
CREATE TABLE EUR_rates(
effective_date date PRIMARY KEY,
@@ -638,15 +638,15 @@ CREATE TABLE EUR_rates(
"15Y" real,
"20Y" real,
"25Y" real,
- "30Y" real)
+ "30Y" real);
CREATE TABLE USD_curves(
effective_date date PRIMARY KEY,
- curve bytea)
+ curve bytea);
CREATE TABLE EUR_curves(
effective_date date PRIMARY KEY,
- curve bytea)
+ curve bytea);
CREATE TABLE USD_swap_fixings(
fixing_date date PRIMARY KEY,
@@ -663,11 +663,30 @@ CREATE TABLE USD_swap_fixings(
"15y" numeric(5, 3),
"20y" numeric(5, 3),
"30y" numeric(5, 3)
-)
+);
CREATE TYPE VOL_SOURCE AS ENUM('BVOL', 'CMPN', 'BBIR');
-CREATE TABLE swaption_vol(
+CREATE TABLE swaption_normal_vol(
+ date date,
+ "1y" float[18],
+ "2y" float[18],
+ "3y" float[18],
+ "4y" float[18],
+ "5y" float[18],
+ "6y" float[18],
+ "7y" float[18],
+ "8y" float[18],
+ "9y" float[18],
+ "10y" float[18],
+ "15y" float[18],
+ "20y" float[18],
+ "25y" float[18],
+ "30y" float[18],
+ source VOL_SOURCE,
+ PRIMARY KEY(date, source));
+
+CREATE TABLE swaption_lognormal_vol(
date date,
"1y" float[18],
"2y" float[18],
@@ -684,7 +703,7 @@ CREATE TABLE swaption_vol(
"25y" float[18],
"30y" float[18],
source VOL_SOURCE,
- PRIMARY KEY(date, source))
+ PRIMARY KEY(date, source));
CREATE TABLE swaption_quotes(
quotedate timestamptz,
@@ -704,7 +723,7 @@ CREATE TABLE swaption_quotes(
tail float,
quote_source varchar(4),
PRIMARY KEY(quotedate, index, series, expiry, strike),
- FOREIGN KEY(quotedate, index, series, expiry) REFERENCES swaption_ref_quotes)
+ FOREIGN KEY(quotedate, index, series, expiry) REFERENCES swaption_ref_quotes);
CREATE TABLE swaption_ref_quotes(
quotedate timestamptz,
@@ -715,7 +734,7 @@ CREATE TABLE swaption_ref_quotes(
fwdprice float,
fwdspread float,
fwdbpv float,
- PRIMARY KEY(quotedate, index, series, expiry))
+ PRIMARY KEY(quotedate, index, series, expiry));
CREATE TABLE swaption_calib(
quotedate timestamptz,
@@ -727,4 +746,4 @@ CREATE TABLE swaption_calib(
vol_receiver float
vol_payer_black float,
vol_receiver_black float,
- PRIMARY KEY(quotedate, index, series, expiry, strike))
+ PRIMARY KEY(quotedate, index, series, expiry, strike));