aboutsummaryrefslogtreecommitdiffstats
path: root/sql/dawn.sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql/dawn.sql')
-rw-r--r--sql/dawn.sql15
1 files changed, 5 insertions, 10 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index 1d61979f..abe47ce6 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -2792,7 +2792,7 @@ CREATE TABLE beta_crt(
PRIMARY KEY (date, strategy)
);
-CREATE OR REPLACE VIEW payment_settlements2
+CREATE OR REPLACE VIEW payment_settlements
AS SELECT trades.settle_date,
trades.fund,
cps.name,
@@ -2833,14 +2833,10 @@ AS SELECT trades.settle_date,
swaptions.fund,
swaptions.cp_code,
'swaption'::text AS asset_class,
- swaptions.cash_account as account,
- swaptions.currency,
- CASE
- WHEN swaptions.buysell THEN (- swaptions.notional) * swaptions.price / 100::double precision
- WHEN NOT swaptions.buysell THEN swaptions.notional * swaptions.price / 100::double precision
- ELSE NULL::double precision
- END AS payment_amount
- FROM swaptions
+ 'Bilateral Trade' as account,
+ 'USD' AS currency,
+ -swaptions.fee AS payment_amount
+ FROM swaption_trades swaptions
UNION
SELECT spots.id,
spots.settle_date,
@@ -2855,7 +2851,6 @@ AS SELECT trades.settle_date,
UNION
SELECT fx_swaps.id,
unnest(ARRAY[near_settle_date, near_settle_date, far_settle_date, far_settle_date]) AS settle_date,
-
fx_swaps.fund,
fx_swaps.cp_code,
'spot'::text AS asset_class,