aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/dawn.sql39
1 files changed, 38 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 50775091..de38b3a4 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -2,6 +2,9 @@
CREATE TYPE bond_strat AS ENUM('M_STR_MAV', 'M_STR_SMEZZ', 'CSO_TRANCH',
'M_CLO_BB20', 'M_CLO_AAA', 'M_CLO_BBB', 'M_MTG_IO', 'M_MTG_THRU',
'M_MTG_GOOD', 'M_MTG_B4PR', 'M_MTG_RW');
+CREATE TYPE cds_strat AS ENUM('HEDGE_CSO', 'HEDGE_CLO', 'HEDGE_MAC', 'HEDGE_MBS',
+ 'SER_IGSNR', 'SER_IGMEZ', 'SER_IGEQY', 'SER_IGINX', 'SER_HYSNR',
+ 'SER_HYMEZ', 'SER_HYEQY', 'SER_HYINX', 'SER_IGCURVE', 'MBSCDS');
CREATE TYPE asset_class AS ENUM('CSO', 'Subprime', 'CLO', 'Tranches', 'Futures', 'Cash', 'FX', 'Cleared');
@@ -9,7 +12,11 @@ CREATE TYPE action AS ENUM('NEW', 'UPDATE', 'CANCEL');
CREATE TYPE currency AS ENUM('USD', 'CAD', 'EUR', 'YEN');
CREATE TYPE bbg_type AS ENUM('Mtge', 'Corp');
CREATE type day_count AS ENUM('ACT/360', 'ACT/ACT', '30/360', 'ACT/365');
-CREATE type index_type AS ENUM('IG', 'HY', 'EU');
+CREATE type bus_day_convention AS ENUM('Modified Following', 'Following', 'Modified Preceding', 'Preceding',
+ 'Second-Day-After', 'End-of-Month');
+CREATE type index_type AS ENUM('IG', 'HY', 'EU', 'XO', 'LCDX');
+CREATE TYPE swap_type AS ENUM('CD_INDEX', 'CD_INDEX_TRANCHE', 'CD_BASKET_TRANCHE', 'ABS_CDS');
+CREATE type isda AS ENUM('ISDA2014', 'ISDA2003Cred');
CREATE TABLE counterparties(code varchar(12) primary key,
name text,
@@ -55,6 +62,36 @@ CREATE TABLE bonds(id serial primary key,
principal_payment float,
accrued_payment float);
+CREATE TABLE cds(is serial primary key,
+ dealid varchar(28),
+ lastupdate timestamp,
+ action action,
+ folder cds_strat,
+ custodian varchar(12),
+ cashaccount varchar(10),
+ cp_code varchar(12),
+ trade_date date,
+ effective_date date,
+ maturity date,
+ currency currency,
+ payment_rolldate bus_day_convention,
+ notional float,
+ fixed_rate float,
+ day_count day_count,
+ frequency samllint,
+ protection protection,
+ security_id varchar(12),
+ security_desc varchar(32),
+ upfront float,
+ upfront_settle_date date,
+ swap_type swap_type,
+ attach smallint,
+ detach smallint,
+ clearing_facility varchar(12),
+ isda_definition isda);
+
+
+
CREATE TABLE securities(identifier varchar(12) PRIMARY KEY,
cusip varchar(9),
isin varchar(12),