aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql24
1 files changed, 23 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 0762210c..8cb6e519 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -3096,4 +3096,26 @@ CREATE TABLE public.irs (
CREATE TYPE public."bbg_code_type" AS ENUM (
'BOND',
'CDS',
- 'FX'); \ No newline at end of file
+ 'FX');
+
+
+ CREATE TABLE public.trs (
+ id serial4 NOT NULL PRIMARY KEY,
+ dealid text NULL GENERATED ALWAYS AS ('TRS'::text || id::text) STORED,
+ "portfolio" public."portfolio" NOT NULL,
+ folder public."cds_strat" NOT NULL,
+ cash_account text NOT NULL REFERENCES accounts2(cash_account) ON UPDATE CASCADE,
+ cp_code varchar(12) NOT NULL REFERENCES counterparties(code) ON UPDATE CASCADE,
+ trade_date date NOT NULL,
+ effective_date date NOT NULL,
+ maturity_date date NOT NULL,
+ buysell bool NOT NULL,
+ underlying varchar(32) NOT NULL,
+ price float8 NOT NULL,
+ upfront float8 NOT NULL,
+ initial_margin_percentage float8 NOT NULL,
+ notional float8 NOT NULL,
+ "fund" public."fund" NOT NULL DEFAULT 'SERCGMAST'::fund,
+ "currency" public."currency" NOT NULL DEFAULT 'USD'::currency,
+ cpty_id text NULL,
+); \ No newline at end of file