From d653917c8b1162bccb1950647d790488cc0cde8c Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Aug 2025 09:53:03 -0400 Subject: [PATCH 1/3] point view to new target math --- tables/target_prices_view.pg.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tables/target_prices_view.pg.sql b/tables/target_prices_view.pg.sql index 386f8fa..1261820 100644 --- a/tables/target_prices_view.pg.sql +++ b/tables/target_prices_view.pg.sql @@ -8,4 +8,4 @@ SELECT ,price ,to_jsonb(math)::text AS math FROM - pricequote.target_prices; \ No newline at end of file + pricequote.target_prices_base; From 3c854ed0a4c28bd87f420494517d70ecd2352850 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Aug 2025 10:31:37 -0400 Subject: [PATCH 2/3] repoint postgres targets to new targets --- procs/matrix_guidance.pg.sql | 4 ++-- procs/single_price_call.pg.sql | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/procs/matrix_guidance.pg.sql b/procs/matrix_guidance.pg.sql index 9c8f3e9..85920b9 100644 --- a/procs/matrix_guidance.pg.sql +++ b/procs/matrix_guidance.pg.sql @@ -194,7 +194,7 @@ BEGIN tprice = tp.price, tmath = to_json(tp.math), volume_range = tp.vol::TEXT - FROM pricequote.target_prices tp + FROM pricequote.target_prices_base tp WHERE tp.stlc = q.stlc AND tp.ds = q.v1ds @@ -209,7 +209,7 @@ BEGIN UPDATE pricequote.queue q SET tprice_last = tp2.price - FROM pricequote.target_prices tp2 + FROM pricequote.target_prices_base tp2 WHERE q.last_dataseg IS NOT NULL AND tp2.stlc = q.stlc diff --git a/procs/single_price_call.pg.sql b/procs/single_price_call.pg.sql index c3d7d54..457c7f6 100644 --- a/procs/single_price_call.pg.sql +++ b/procs/single_price_call.pg.sql @@ -265,7 +265,7 @@ BEGIN ,_tmath ,_volume_range FROM - pricequote.target_prices tp + pricequote.target_prices_base tp WHERE tp.stlc = _stlc AND tp.ds = _v1ds @@ -283,7 +283,7 @@ BEGIN INTO _tprice_last FROM - pricequote.target_prices tp + pricequote.target_prices_base tp WHERE tp.stlc = _stlc AND tp.ds = _last_dataseg From 6bb0172c2debb025660bed10fa5a8b0ee9a41c84 Mon Sep 17 00:00:00 2001 From: Paul Trowbridge Date: Wed, 27 Aug 2025 10:45:55 -0400 Subject: [PATCH 3/3] label parameters and adjust last to 5% --- procs/single_price_call.ms.sql | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/procs/single_price_call.ms.sql b/procs/single_price_call.ms.sql index b572d3f..830be9c 100644 --- a/procs/single_price_call.ms.sql +++ b/procs/single_price_call.ms.sql @@ -383,7 +383,12 @@ BEGIN TRY_CAST(q.last_price_norm AS NUMERIC(20,5)), TRY_CAST(q.listprice_eff AS NUMERIC(20,5)), TRY_CAST(q.last_date AS DATE), - .15, 1.0, 1.0 + --allowable price drop percent + .05, + --cap on last price + 1.0, + --cap on list percent + 1.0 ) g; --------------------------------------------------------------------------------