diff options
Diffstat (limited to 'sql')
| -rw-r--r-- | sql/dawn.sql | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index 089c76f0..4c74cc93 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -1450,7 +1450,7 @@ BEGIN RETURN QUERY SELECT a.dealid, folder, (CASE WHEN buysell = 't' THEN 1 ELSE -1 END) * (a.notional - coalesce(terminated_amount, 0.)), - a.option_type, a.strike, a.security_id, a.expiration_date, a.maturity, a.initial_margin_percentage, + a.option_type, a.strike/100, a.security_id, a.expiration_date, a.maturity, a.initial_margin_percentage, a.cp_code, c.base_nav FROM swaptions a LEFT JOIN (SELECT dealid, SUM(termination_amount) AS terminated_amount @@ -2263,8 +2263,9 @@ CREATE TYPE cash_rate AS ENUM('FED_FUND', '1M_LIBOR', '3M_LIBOR'); CREATE OR REPLACE VIEW swaption_trades AS SELECT swaptions.id, dealid, - termination_date as trade_date, - termination_amount as notional, + termination_date AS trade_date, + fee_payment_date AS settle_date, + termination_amount AS notional, security_desc, security_id, CASE WHEN termination_cp=cp_code THEN @@ -2273,6 +2274,7 @@ SELECT swaptions.id, 'Assignment' END AS trade_type, folder, + portfolio, fund, termination_cp AS cp_code, name, @@ -2288,11 +2290,13 @@ UNION ALL ( SELECT id, dealid, trade_date, + settle_date, notional, security_desc, security_id, 'New' AS trade_type, folder, + portfolio, fund, cp_code, name, |
