Skip to main content

Deep Dive: Pricing Module (pricing + rmbestx)

Narrative

The Pricing module is the quantitative engine of PowerSeller. It handles the complete lifecycle of mortgage pricing -- from ingesting raw market prices through DDE feeds, through validation, par rate computation, DPC calculation, feature adjustments, all the way to Best Execution analysis that determines the optimal investor and delivery scenario for every loan in a portfolio.

The module operates across two folders:

  • pricing/ -- Core price ingestion, validation, calculation (par rates, DPCs, feature adjustments, coupon shifts), and archiving
  • rmbestx/ -- Best Execution analysis engine that ranks investor/delivery scenarios per loan

Best Execution Process Flow


Key Calculations

Par Rate Formula

The par rate is the note rate at which an instrument prices at par (100).

Interpolation (standard case):

par_rate = low_rate + (par_basis - low_price) * (high_rate - low_rate) / (high_price - low_price)

Daily price change (for window interpolation):

daily_price_change = (price_from - price_to) / (window_to - window_from)
price = days_to_delivery * daily_price_change + base_price

DPC (Dollar Price Change)

Raw DPCs:

lower_rate_dpc = (next_price - current_price) / (next_rate - current_rate)
higher_rate_dpc = (current_price - prev_price) / (current_rate - prev_rate)

Continuum DPCs extend raw DPCs to arbitrary rate shifts using increment bias weighting:

potential_dpc = primary_dpc * increment_bias + contrary_dpc * (1 - increment_bias)
computed_dpc = |achieved_value_shift + potential_dpc * residual_shift| / |total_shift|

Total Price Calculation

calc_price = base_price
+ required_servicing + excess_servicing_value + msr_price_adjustment
- msr_fee_adjustment_normalized
+ buyup_value
- junk_fee
+ total_price_adjustment
- fee_adjustment_normalized
+ early_delivery_credit

total_price = MIN(calc_price, investor_max_price) [if cap exists]
total_price += warehouse_income - finance_cost

Unit Gain

unit_gain = total_price - cost_basis
profit_amount = ROUND((total_price - cost_basis) / 100 * loan_amount, 2)

Scenario Ranking

Profiles define ranking criteria applied via SQL RANK():

CodeMeaning
tpeTotal price excluding factor (DESC)
tpiTotal price including factor (DESC)
ipfInvestor price factor
invInvestor rank from counterparty config
delDelivery window (days)
edcEarly delivery credit

Business Rules

Price Validity

  • Prices must be no more than 7 days old
  • Only numeric, positive result values are accepted
  • MBS/WL/BE prices must be monotonic (higher rate = higher price; non-monotonic rows are deleted)
  • Each instrument/window combination requires at least 3 rate/price pairs
  • Only active instruments with authorized hedging flag are included
  • Prices exactly equal to 100 are deleted post-archiving (prevents pollution of par rate calcs)

Feature Adjustments

  • Grouped by price_adjustment_group and price_adjustment_name
  • Each has a sequence_number; when multiple adjustments in the same group match a loan, only the lowest sequence number applies
  • Three dimensions: price_adjustment, rate_adjustment, fee_adjustment
  • 9 distinct contexts (Risk, BestEx, Bulk Sales, What-If variants, Rate Sheet variants, Best Efforts)

Interpolated Pricing

  • Only for instruments with interpolate_prices = 'y'
  • Only for FRE, FNM, FHLB guarantors
  • Handles both pass-through and note-rate cash grid types
  • Uses linear interpolation between rate brackets

Source Price Management

  • Prices are either 'd' (DDE) or 'm' (modified/manual)
  • Modified prices cannot be auto-removed when DDE links change
  • New BestEx instrument mappings auto-configure with DDE delivery windows

Data Model

Price Source Tables

TableRole
pscat_instrument_dde_linksSingle-value DDE prices (treasury/futures)
pscat_inst_dde_links_multiMulti-rate DDE prices (MBS/WL/BE)
rmcat_inv_modified_pricesManually entered non-MBS prices
rmcat_inv_mbs_modified_pricesManually entered MBS prices
pscat_rm_inv_delivery_winDelivery window config per instrument/investor

Calculated Price Tables

TableRole
rmtmp_pricesStaging table for raw ingested prices
rmcat_todays_pricesValidated current prices
rmcat_todays_par_ratesComputed par rates
rmcat_dpcsRaw DPC values
rmcat_dpc_valuesContinuum DPC values

Feature Adjustment Tables

TableRole
rmcat_price_adjustmentsAdjustment rule definitions
rmcat_price_adjustment_valuesAdjustment values by investor
rmcat_adj_agg_values_*Aggregated adjustments (by context)
rmcat_adj_ind_values_*Individual adjustments (by context)

Archive Tables

TableRole
rmarc_pricesArchived prices (MBS/WL/BE/FC)
rmarc_yieldsArchived yields (Treasury)
rmarc_par_ratesArchived par rates
rmcat_pricing_analysis_historyAnalysis run history