aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/dawn.sql16
-rw-r--r--sql/serenitasdb.sql2
2 files changed, 16 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index c6360a70..6b221da4 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -13,7 +13,15 @@ CREATE TYPE swaption_strat AS ENUM('IGPAYER', 'IGREC', 'HYPAYER', 'HYREC');
CREATE TYPE repo_strat AS ENUM('');
-CREATE TYPE asset_class AS ENUM('CSO', 'Subprime', 'CLO', 'Tranches', 'Futures', 'Cash', 'FX', 'Cleared');
+CREATE TYPE future_strat AS ENUM('M_STR_MAV', 'M_MTG_IO', 'M_STR_MEZZ', 'M_MTG_RW',
+ 'SER_ITRXCURVE');
+
+CREATE TYPE cash_strat AS ENUM('M_CSH_CASH', 'MBSCDSCSH', 'SER_IGCVECSH',
+ 'SER_ITRXCVCSH', 'CSOCDSCSH', 'IGCDSCSH', 'HYCDSCSH', 'CLOCDSCSH',
+ 'IGTCDSCSH', 'MACCDSCSH');
+
+CREATE TYPE asset_class AS ENUM('CSO', 'Subprime', 'CLO', 'Tranches', 'Futures',
+ 'Cash', 'FX', 'Cleared');
CREATE TYPE action AS ENUM('NEW', 'UPDATE', 'CANCEL');
CREATE TYPE currency AS ENUM('USD', 'CAD', 'EUR', 'YEN');
@@ -35,6 +43,12 @@ CREATE TYPE protection AS ENUM('Buyer', 'Seller');
CREATE TYPE call_notice AS ENUM('24H', '48H', '3D', '4D', '5D', '6D',
'1W', '8D', '9D', '10D', '2W', '1M', '2M');
+CREATE TABLE accounts(
+ code varchar(5) PRIMARY KEY,
+ custodian text,
+ cash_account text,
+ counterparty text REFERENCES counterparties(code))
+
CREATE TABLE counterparties(code varchar(12) primary key,
name text,
city text,
diff --git a/sql/serenitasdb.sql b/sql/serenitasdb.sql
index edac65f7..f423c3fd 100644
--- a/sql/serenitasdb.sql
+++ b/sql/serenitasdb.sql
@@ -137,7 +137,7 @@ CREATE TABLE tranche_quotes (
Basis real,
QuoteSource varchar(4),
markit_id integer
- UNIQUE (QuoteDate, Index, Series, Version, Tenor, Attach, Detach, QuoteSource, trancherunningmid)
+ UNIQUE (QuoteDate, Index, Series, Version, Tenor, Attach, Detach, QuoteSource, trancherunningmid, markit_id)
);
CREATE INDEX tranche_quotes_idx ON