Skip to main content

Price Engine

Overview

Price Engine (PE) is the central real-time pricing service for the KeySquare platform. It manages per-instrument price controls and produces bid/mid/ask prices and yields for Fixed Income Bonds (fixed maturity, callable, and floating rate).

PE combines three inputs to produce a live price:

  • Instrument data — sourced from Static Data Server, including coupon, maturity, benchmark, and settlement conventions
  • Calculation parameters — per-instrument PriceControl records that define the pricing model, adjustments, and workout methodology
  • Market prices / yields — published by one or more external Data Providers over the platform bus

For each priced instrument, PE optionally sends a ValuationRequest to Analytics Engine to compute yield and PV01 from the resulting clean price.

Installation

Price Engine can be run via binaries or Docker.

The package for this component is price-engine-{version}.tar.gz.
Please reach out to us if you'd like to try price-engine.

Please follow the instructions in deployment guide on how to install components.

Remember to register the new application. The simplest way is to import the app-permissions.json included in the component's package.

Entitlements

The following entitlements must be configured in KeyAccess for the price-engine application.

If you imported the permissions using the supplied app-permissions.json then most of these should already be set up for you. However, any custom data providers will need to be added. See the Data Provider guide.

Simplified

PUB/SUBSchemaSourceGroup
SUB**price-engine
SUBKsPricing.PriceProfileprice-engine*
SUBKsPricing.PriceControlprice-engine*
SUBKsCanonical.Price**
PUB*price-engine*

Full Detail

PUB/SUBSchemaSourceGroup
SUBKsPricing.* (RPC Requests)*price-engine
SUBKsPricing.* (RPC Responses)analytics-engineprice-engine
SUBKsStaticDataServer.InstrumentIdReverseMappingstatic-data-server*
SUBKsCanonical.InstrumentProfilestatic-data-server*
SUBKsCanonical.Instrumentstatic-data-server*
SUBKsCanonical.BusinessDatesstatic-data-server*
SUBKsCanonical.Indexstatic-data-server*
SUBKsPricing.Curvecurve-engine*
SUBKsCanonical.Price{data-provider}*
SUBKsPricing.PriceProfileprice-engine*
SUBKsPricing.PriceControlprice-engine*
SUBKsPricing.ResolvedPriceControlprice-engine*
PUBKsPricing.* (RPC Responses)price-engine*
PUBKsPricing.* (RPC Requests)price-engineanalytics-engine
PUBKsCanonical.Priceprice-engine*
PUBKsPricing.PriceProfileprice-engine*
PUBKsPricing.PriceControlprice-engine*
PUBKsPricing.ResolvedPriceControlprice-engine*

Startup Dependencies

PE depends on keysquare-platform and Static Data Server being healthy before it starts.

In a typical platform boot sequence:

  1. aeron-media-driver
  2. key-access
  3. sequencer
  4. relay-cache, relay-live
  5. static-data-server
  6. price-engine ← starts here

PE signals readiness via a ReadinessState.READY monitoring event once all instrument subscriptions are complete.

note

Price Engine will publish prices with ok=false while it is waiting for Analytics Engine to return valuation results. Monitor ApplicationStatus on PE to check health: LivenessState.ONLINE + ReadinessState.READY indicates it is fully operational.

System Interaction

Workflow

Managing Prices

Price Engine maintains one PriceControl record per instrument, specifying the pricing model, spread adjustments, and workout methodology. Controls are grouped into Price Profiles that share yield conventions and new-instrument defaults.

See the dedicated pages for technical details:

Troubleshooting

When price.ok=false, the price.message field explains why Price Engine could not produce a valid price. Messages may be concatenated when multiple conditions apply.

Resolved PriceControl Validation

These errors appear before any pricing calculation and indicate a configuration or data-availability issue.

MessageReasonResolution
Instrument not foundInstrument data has not yet arrived from Static Data ServerWait for SDS ReadinessState.READY
Benchmark instrument not foundInstrument references a benchmark ID that has not been receivedVerify the benchmark is configured in SDS
Price topic not foundPrice source name cannot be resolved to a platform topicCheck KS_PE_PRICE_SOURCES for a matching source name
Benchmark price topic not foundBenchmark price source cannot be resolved to a topicVerify benchmark source name in KS_PE_PRICE_SOURCES
Invalid modelmodel field is UNKNOWN or unsetSet a valid pricing model
Invalid sideside field is UNKNOWN or unsetSet a valid driver side
Invalid spread typespreadType is UNKNOWN or unsetSet YIELD or PRICE
Invalid workout typeworkoutType is UNKNOWN or unsetSet a valid workout type
Invalid workout dateworkoutType = MANUAL but workoutDate is zeroSupply a valid workout date
No profile setInstrument has no profileNameAssign a Price Profile in Static Data Server
Price profile not foundProfile name is set but PriceProfile has not been receivedVerify the profile exists and PE has started
FRN forecast curve topic not foundFloat bond's reference index has no forecast curveConfigure forecastCurve on the index in SDS

Pricing Model Errors

MessageReasonResolution
Source Price is missingModel is SOURCE or PASSTHROUGH but source price data has not arrivedVerify priceSource is configured and the data provider is running
Invalid PriceSource price bid and ask are both zero or NaNCheck data provider health for the affected instrument
Invalid Price and YieldSOURCE + YIELD mode: both price and yield from source are invalidCheck data provider is publishing yield data
Benchmark Price is missingModel is BENCHMARK but no benchmark price has been receivedConfirm benchmark instrument is being priced and benchmarkPriceSource is set
Invalid Benchmark YieldBenchmark price has no valid yieldEnsure the benchmark data provider publishes yield values
Benchmark Pricing Model not supported for CouponType = FloatFloat bonds cannot use the BENCHMARK modelSwitch to DISCOUNT_MARGIN for floating rate bonds
Manual Pricing Model does not support SpreadType = Yield for CouponType = Float - Please use Discount Margin Pricing ModelMANUAL model with spreadType = YIELD is invalid for float bondsUse DISCOUNT_MARGIN model or set spreadType = PRICE
Adjustment / Drivers must be supplied in Yield terms - Please check the spreadType setBENCHMARK model requires spreadType = YIELD or SPREADUpdate spreadType
Adjustment / Drivers must be supplied in Discount Margin terms - Please check the spreadType set.DISCOUNT_MARGIN model requires spreadType = YIELD or SPREADUpdate spreadType
Discount Margin Pricing Model not supported for CouponType <> FloatDISCOUNT_MARGIN is only valid for floating rate bondsUse MANUAL, SOURCE, or BENCHMARK for non-float bonds
Spread Type not supportedspreadType is set to an unsupported value for this modelSet spreadType to YIELD or PRICE
Invalid InputMANUAL model: bid/mid/ask spread values are NaN or missingSupply valid adjustment values in the PriceControl
Unsupported pricing modelModel is unrecognisedSet a supported model: MANUAL, SOURCE, BENCHMARK, PASSTHROUGH, or DISCOUNT_MARGIN
Invalid Bid / Invalid Ask / Invalid Mid / Invalid Bid or AskThe designated primary side has no valid valueCheck that the data source provides data for the configured driver side
Invalid Pricing SideSide field is set to an invalid valueSet a valid driver side

Analytics Engine Interaction

MessageReasonResolution
Analytics Engine unavailable - Can't calculate Workout DateAE is offline; PE cannot determine the workout date for a callable bondVerify Analytics Engine is running and healthy
Invalid Price - Can't calculate Workout DateSource price is invalid; PE cannot send a workout date requestFix the source price issue first
Failed to get workout date. <detail>AE returned an error computing the workout dateCheck Analytics Engine logs for the specific instrument
Workout Date PendingA workout date request is in-flight to AETransient — resolves when AE responds
Analytics Engine unavailableAE is offline or disconnected during a yield/price conversionStart Analytics Engine and wait for reconnection
Invalid Price - Can't calculate YieldPrice is invalid before sending price-to-yield requestFix the source price issue
Price to Yield failed: <detail>AE returned an error on price-to-yield conversionSee Analytics Engine troubleshooting
Price to Yield requestedA price-to-yield request is in-flightTransient
Invalid Yield - Can't calculate PriceYield is invalid before sending yield-to-price requestEnsure the source publishes valid yield data
Yield to Price failed. <detail>AE returned an error on yield-to-price conversionSee Analytics Engine troubleshooting
Yield to Price requestedA yield-to-price request is in-flightTransient
Invalid Price - Can't calculate DMPrice is invalid before sending price-to-discount-margin requestFix the source price issue
Price to DM failed: <detail>AE returned an error on price-to-DM conversionSee Analytics Engine troubleshooting
Price to DM requestedA price-to-DM request is in-flightTransient
Invalid Discount - Can't calculate PriceDiscount margin is invalid before sending DM-to-price requestVerify DM input values
Discount to Price failed: <detail>AE returned an error on DM-to-price conversionSee Analytics Engine troubleshooting
DM to Price requestedA DM-to-price request is in-flightTransient
Invalid Workout DateComputed workout date is zero — bond has no valid redemption scheduleVerify maturity/call date data in Static Data Server

User Interface

PE key-ui module ships two pre-canned views that can be used as a starting point for your pricing views. The module named price-engine provides these as two pages:

  • Prices — per-instrument price controls, live prices, yields, PV01, spreads, and position data
  • Price Profiles — group-level yield convention and curve configuration

To enable the price-engine user interface:

  1. Update the configuration for web-data-server:
    • Append price-engine to KS_WEB_DATA_SERVER_UI_MODULES (comma-separated)
      e.g. KS_WEB_DATA_SERVER_UI_MODULES=static-data-server,price-engine,curve-engine,analytics-engine
    • Restart web-data-server
  2. Log in to Key UI with an admin account
    • Navigate to Admin → Modules
    • Select Price Engine from the module list
    • Toggle Enabled on and click Save
    • Ensure the appName parameter matches the registered application name (default: price-engine)

price engine module configuration

RPC Functions

RPC NameGroupDescription
GetPriceSourcesOperationalReturns the list of configured price source names
GetPricePriceReturns the current price for a given instrumentId

Detailed Topics

  • Price Controls — PriceControl field reference, all pricing models, logical model diagrams, recalculation triggers, and ResolvedPriceControl assembly
  • Price Profiles — yield conventions, curve settings, and new instrument defaults
  • Prices View — user guide for the Prices grid: column reference, editing controls, and driver side walkthrough
  • Price Profiles View — user guide for the Price Profiles grid
  • Configuration Reference — all KS_PE_* environment variables and module parameters
  • Data Provider — how to implement PriceDataProvider and contribute prices to the platform