aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 23508abe..5707d0a7 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -1663,9 +1663,9 @@ CREATE OR REPLACE VIEW globeop_tranche_risk AS
SELECT date, tranche_id as trade_id, security_desc, index, series, maturity, orig_attach,
orig_detach, CASE protection WHEN 'Buyer' THEN notional ELSE -notional END AS notional,
endqty as globeop_notional,
- clean_nav as serenitas_clean_nav,
+ clean_nav * coalesce(fx, 1.) as serenitas_clean_nav,
globeop_clean_nav,
- accrued as serenitas_accrued, globeop_accrued,
+ accrued * coalesce(fx, 1.) as serenitas_accrued, globeop_accrued,
duration, delta, gamma, theta, tranche_factor,
tranche_risk.corr_attach, tranche_risk.corr_detach,
tranche_risk.upfront, tranche_risk.running,
@@ -1679,6 +1679,7 @@ LEFT JOIN (SELECT invid, periodenddate,
FROM valuation_reports GROUP BY invid, periodenddate) a
ON (invid=globeop_id AND periodenddate=date)
LEFT JOIN index_version ON (security_id=redindexcode)
+LEFT JOIN (SELECT date, 'EUR'::currency AS currency, eurusd AS fx FROM fx) fx USING (date, currency)
ORDER BY index, series, orig_attach;