Skip to main content

Quote Engine

Overview

Quote Engine (QE) is the real-time indicative quoting service for the KeySquare platform. It subscribes to prices produced by Price Engine (or any other configured price source), applies per-instrument spread adjustments and size strategies, and publishes live two-sided bid/ask quotes for each instrument across one or more configurable tiers.

QE is designed to support multi-tier quoting out of the box — for example, publishing different spreads for retail vs. institutional counterparties, or tighter quotes during normal conditions and wider quotes during fast markets.

QE combines three inputs to produce a live quote:

  • Instrument data — sourced from Static Data Server, including profile assignment and trade restriction flags
  • Quote controls — per-instrument, per-tier QuoteControl records that define spreads, size strategy, and enabled/firm flags
  • Input prices — live bid/mid/ask prices and yields from a configured price source (typically Price Engine)

Optionally, QE can also subscribe to a position source to dynamically size quotes using live book positions.

Installation

Quote Engine can be run via binaries or Docker.

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

Please follow the instructions in the 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 quote-engine application.

If you imported the permissions using the supplied app-permissions.json then most of these should already be set up for you. Any custom price or position sources will need to be added separately — see the Configuration Reference.

Simplified

PUB/SUBSchemaSourceGroup
SUB**quote-engine
SUBKsQuoteEngine.QuoteProfilequote-engine*
SUBKsQuoteEngine.QuoteControlquote-engine*
SUBKsQuoteEngine.ResolvedQuoteControlquote-engine*
SUBKsCanonical.Price**
PUB*quote-engine*

Full Detail

PUB/SUBSchemaSourceGroup
SUBKsQuoteEngine.* (RPC Requests)*quote-engine
SUBKsCanonical.InstrumentProfilestatic-data-server*
SUBKsCanonical.Instrumentstatic-data-server*
SUBKsCanonical.BusinessDatesstatic-data-server*
SUBKsCanonical.Price{price-provider}*
SUBKsQuoteEngine.QuoteProfilequote-engine*
SUBKsQuoteEngine.QuoteControlquote-engine*
SUBKsQuoteEngine.ResolvedQuoteControlquote-engine*
PUBKsPlatform.MessageStoreEnvelopestatic-data-server*
PUBKsQuoteEngine.* (RPC Responses)quote-engine*
PUBKsCanonical.Quotequote-engine*
PUBKsQuoteEngine.QuoteProfilequote-engine*
PUBKsQuoteEngine.QuoteControlquote-engine*
PUBKsQuoteEngine.ResolvedQuoteControlquote-engine*

Startup Dependencies

QE 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
  7. quote-engine ← starts here

QE signals readiness once all instrument subscriptions are complete and initial quote controls have been loaded from the database.

note

QE will publish quotes with ok=false until the input price is available and the resolved quote control is valid. Monitor ApplicationStatus to check health: LivenessState.ONLINE + ReadinessState.READY indicates it is fully operational.

System Interaction

Workflow

Managing Quotes

Quote Control

Each instrument and tier combination is governed by a KsQuoteEngine.QuoteControl. This record defines the per-instrument quoting behaviour for that tier.

See Quote Controls for full field reference and configuration scenarios.

Quote Profile

Quote profiles group instruments together and provide shared tier-level settings such as price source, spread multiplier, and reference tier configuration. Every instrument belongs to a profile via its profileName field in Static Data Server.

See Quote Profiles for full detail.

Output Quote Fields

The published KsCanonical.Quote message carries the following fields:

FieldDescription
instrumentIdPlatform instrument ID
tierTier number (1…n)
okWhether the quote is valid
enabledWhether the quote is currently enabled for distribution
firmWhether this is a firm (binding) quote
priceSourceThe price source used to derive this quote
bidPrice / askPrice / midPriceSpread-adjusted clean prices
bidYield / askYield / midYieldSpread-adjusted yields
pv01Dollar value of 1bp, copied from input price
bidSize / askSizeQuoted sizes, computed from size strategy
messageError message when ok=false
marketInstrumentIdExternal market identifier (e.g. ISIN) used to distribute the quote

Quotes also carry through reference instrument data (benchmark bond id, reference bid/ask yields, spread-to-reference) directly from the input price.

Troubleshooting

When quote.ok=false, the quote.message field explains why Quote Engine could not produce a valid quote.

Error MessageReasonResolution
Price is missingNo input price has arrived yet from the configured price sourceVerify the price source is publishing. Check KS_QE_PRICE_SOURCES configuration.
Source price is not okThe input price has ok=falseFix the underlying price issue — see Price Engine Troubleshooting
Can't adjust bid yield - pv01 is zerospreadType=YIELD but the input price has zero PV01Ensure Price Engine is producing a valid PV01 for this instrument
Can't adjust bid price - pv01 is zerospreadType=PRICE and QE needs PV01 to recalculate yieldSame as above
Instrument not foundInstrument has not yet arrived from Static Data ServerWait for SDS to become ready
No profile setInstrument has no profileName assignedAssign a profile in Static Data Server
Quote profile not foundThe profile referenced by the instrument does not have a matching QuoteProfileEnsure the corresponding Instrument Profile exists in SDS
Price topic not foundThe configured price source name does not match any registered entryVerify KS_QE_PRICE_SOURCES contains a matching name
Ref Quote control with tier: N not foundreferenceTier is set but the referenced tier's control has not arrived yetWait for startup to complete; verify the referenced tier exists
Ref Quote control not okThe referenced tier's own control is invalidFix the error on the reference tier first
Spread multiplier is zeroEffective spread multiplier evaluated to zeroEnsure both master and profile spread multipliers are non-zero
Size multiplier is zeroEffective size multiplier evaluated to zeroEnsure both master and profile size multipliers are non-zero
Restricted; Instrument has a trade restriction flag setRemove the restriction on the instrument in Static Data Server
Invalid spread typeSpread type is UNKNOWN or unsetSet a valid spreadType (YIELD or PRICE) on the QuoteControl
Invalid bid/ask size strategySize strategy is UNKNOWN or unsetSet a valid size strategy on the QuoteControl

User Interface

QE ships a key-ui module named quote-engine that provides two management pages:

  • Quote Controls — per-instrument, per-tier spread, size, and flag settings
  • Quote Profiles — profile-level settings, multipliers, and reference tier configuration

To enable the quote-engine user interface:

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

Detailed Topics

  • Quote Controls — per-instrument control fields, spread/size configuration, reference tier sync, and size model detail
  • Quote Profiles — profile-level settings, multiplier calculation, and reference tier configuration
  • Configuration Reference — all KS_QE_* environment variables and module parameters