diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/dawn.sql | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index baaf386e..b80ac5d4 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -3094,6 +3094,12 @@ AS SELECT trades.settle_date, FROM cds_trades WHERE cds_trades.orig_attach IS NOT NULL UNION + SELECT tranche_id::TEXT AS id, tc.date AS settle_date, + cds.fund, cds.cp_code, 'TRANCHE_PAYMENT' AS asset_class, + 'Bilateral Trade'::text AS account, tc.currency, + (COALESCE(tc.principal,0) + COALESCE(tc.accrued,0))::numeric(11,2) AS payment_amount + FROM tranche_cashflows tc LEFT JOIN cds ON tranche_id=cds.id + UNION SELECT swaptions.id::text AS id, swaptions.settle_date, swaptions.fund, @@ -3997,7 +4003,8 @@ CREATE TABLE custodian_wires( currency currency, amount float8 NOT NULL, wire_details text, - unique_ref text PRIMARY KEY); + unique_ref text PRIMARY KEY, + custodian custodian NOT NULL); @@ -4193,6 +4200,8 @@ FROM strategy_im si WHERE si.fund=p_fund AND si.date<=p_date ORDER BY date DESC) LEFT JOIN portfolio_folder_mapping pfm ON pfm.clean_folder=si.strategy::TEXT WHERE RANK=1 and abs(amount) >= .01; END $$ LANGUAGE plpgsql; +CREATE TYPE custodian AS ENUM('BNY', 'UMB', 'NT'); + CREATE TABLE iams ( id int4 NOT NULL GENERATED ALWAYS AS IDENTITY, |
