diff options
Diffstat (limited to 'sql/dawn.sql')
| -rw-r--r-- | sql/dawn.sql | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/dawn.sql b/sql/dawn.sql index cca1bfaa..8de66e28 100644 --- a/sql/dawn.sql +++ b/sql/dawn.sql @@ -2282,13 +2282,13 @@ END $$ LANGUAGE plpgsql; CREATE OR REPLACE function list_crt_data(p_date date, fund fund DEFAULT 'SERCGMAST'::fund) -RETURNS TABLE(identifier varchar(9), model_time timestamp, pv float, duration float4, dm float4, delta_ir float4, delta_economy float4, +RETURNS TABLE(identifier varchar(9), model_time timestamp, notional double precision, factor double precision, pv float, duration float4, dm float4, delta_ir float4, delta_economy float4, convexity_ir float4, convexity_economy float4, bondtype crt_bond_type, delta numeric) as $$ BEGIN RETURN QUERY - SELECT c.identifier, a.timestamp, a.pv, duration_fw, a.dm, "delta.ir", "delta.economy", + SELECT c.identifier, a.timestamp, c.notional, c.factor, a.pv, duration_fw, a.dm, "delta.ir", "delta.economy", "convexity.ir", "convexity.economy", bond_type, value - from (select * from list_positions(p_date, 'CRT', true, fund)) c + from (select * from risk_positions(p_date, 'CRT', fund)) c left join priced_at_market a on c.identifier = a.cusip JOIN (SELECT cusip, MAX(timestamp) timestamp FROM priced_at_market where timestamp between p_date |
