aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sql/dawn.sql8
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql
index c14be071..55805023 100644
--- a/sql/dawn.sql
+++ b/sql/dawn.sql
@@ -3221,6 +3221,7 @@ CREATE TABLE equityoptions (
cpty_id text NULL,
figi text NULL,
globeop_id int4 NULL,
+ underlyingshares int NOT NULL,
CONSTRAINT equity_options2_pkey PRIMARY KEY (id),
CONSTRAINT equity_options2_cash_account_fkey FOREIGN KEY (cash_account) REFERENCES public.accounts2(cash_account) ON UPDATE CASCADE,
CONSTRAINT equity_options2_cp_code_fkey FOREIGN KEY (cp_code) REFERENCES public.counterparties(code) ON UPDATE CASCADE
@@ -3249,7 +3250,8 @@ SELECT eo.id,
eo.expiration_date,
eo.strike,
NOT eo.buysell AS buysell,
- -t.termination_fee AS fee
+ -t.termination_fee AS fee,
+ eo.underlyingshares AS underlyingshares
FROM terminations t RIGHT JOIN equityoptions eo USING (dealid)
LEFT JOIN counterparties cps ON termination_cp = code
WHERE termination_date IS NOT NULL
@@ -3271,9 +3273,9 @@ SELECT eo.id,
eo.expiration_date,
eo.strike,
eo.buysell,
- eo.quantity * price * (2* buysell::integer -1.)
+ eo.quantity * eo.underlyingshares * price * (2* buysell::integer -1.)
+ eo.underlyingshares
FROM equityoptions eo JOIN counterparties cps ON cp_code = code) ORDER BY trade_date DESC;
-
CREATE TABLE bond_tickets (
bbg_ticket_id text NOT NULL,
"Match" text NULL,