aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index b930501c..1eb6b5a9 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -1653,7 +1653,7 @@ RETURNS TABLE(security_id varchar(12), security_desc varchar(32), index index_ty
version smallint, tenor tenor, maturity date, notional float,
factor float, coupon float, duration float, theta float, price float,
closespread float, clean_nav float, accrued float,
- globeop_nav float, globeop_notional float) AS $$
+ globeop_nav float, globeop_notional float, globeop_price numeric(6,2)) AS $$
DECLARE
sqlquery text;
and_clause text;
@@ -1669,7 +1669,7 @@ ELSE
END IF;
IF p_fund = 'SERCGMAST' OR p_fund = 'BOWDST' THEN
sqlquery := format('
-SELECT l.*, b.globeop_nav, b.globeop_notional FROM list_cds_marks_pre($1, $2, $3) l
+SELECT l.*, b.globeop_nav, b.globeop_notional, 100 - ((b.globeop_nav-l.accrued)/(b.globeop_notional*(factor/100)))::numeric(6,2)FROM list_cds_marks_pre($1, $2, $3) l
JOIN (SELECT a.security_id, a.maturity, sum(endbooknav) AS globeop_nav,
sum(endqty) AS globeop_notional
FROM (SELECT periodenddate as date,
@@ -1687,7 +1687,7 @@ ELSIF p_fund = 'BRINKER' THEN
sqlquery := 'SELECT *, 0::double precision, 0::double precision FROM list_cds_marks_pre($1, $2, $3)';
ELSIF p_fund = 'ISOSEL' THEN
sqlquery := format('
-SELECT l.*, b.dirty_nav, b.position FROM list_cds_marks_pre($1, $2, $3) l
+SELECT l.*, b.dirty_nav, b.position, 100 - ((b.dirty_nav-l.accrued)/(b.position*(factor/100)))::numeric(6,2) FROM list_cds_marks_pre($1, $2, $3) l
LEFT JOIN index_version ON security_id=redindexcode
LEFT JOIN index_maturity USING (INDEX, series, maturity)
LEFT JOIN (