aboutsummaryrefslogtreecommitdiffstats
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/dawn.sql6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index ff6e7de8..ccac41b9 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -677,7 +677,8 @@ CREATE TYPE LIST_CDS AS(
attach float,
detach float,
fcm text,
- initial_margin_percentage float
+ initial_margin_percentage float,
+ cpty_id text
);
CREATE OR REPLACE function list_cds(p_date date, p_fund fund DEFAULT 'SERCGMAST'::fund)
@@ -686,7 +687,8 @@ BEGIN
RETURN QUERY
SELECT id, trade_date, security_id, security_desc, maturity, fixed_rate, currency,
folder, protection, notional - coalesce(terminated_amount, 0.) AS notional,
- orig_attach, orig_detach, attach, detach, account_code, initial_margin_percentage
+ orig_attach, orig_detach, attach, detach, account_code, initial_margin_percentage,
+ cpty_id
FROM cds LEFT JOIN (
SELECT id, SUM(termination_amount ) AS terminated_amount
FROM (SELECT id, unnest(termination_amount) as termination_amount,