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
QuoteControlrecords 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.jsonthen 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/SUB | Schema | Source | Group |
|---|---|---|---|
| SUB | * | * | quote-engine |
| SUB | KsQuoteEngine.QuoteProfile | quote-engine | * |
| SUB | KsQuoteEngine.QuoteControl | quote-engine | * |
| SUB | KsQuoteEngine.ResolvedQuoteControl | quote-engine | * |
| SUB | KsCanonical.Price | * | * |
| PUB | * | quote-engine | * |
Full Detail
| PUB/SUB | Schema | Source | Group |
|---|---|---|---|
| SUB | KsQuoteEngine.* (RPC Requests) | * | quote-engine |
| SUB | KsCanonical.InstrumentProfile | static-data-server | * |
| SUB | KsCanonical.Instrument | static-data-server | * |
| SUB | KsCanonical.BusinessDates | static-data-server | * |
| SUB | KsCanonical.Price | {price-provider} | * |
| SUB | KsQuoteEngine.QuoteProfile | quote-engine | * |
| SUB | KsQuoteEngine.QuoteControl | quote-engine | * |
| SUB | KsQuoteEngine.ResolvedQuoteControl | quote-engine | * |
| PUB | KsPlatform.MessageStoreEnvelope | static-data-server | * |
| PUB | KsQuoteEngine.* (RPC Responses) | quote-engine | * |
| PUB | KsCanonical.Quote | quote-engine | * |
| PUB | KsQuoteEngine.QuoteProfile | quote-engine | * |
| PUB | KsQuoteEngine.QuoteControl | quote-engine | * |
| PUB | KsQuoteEngine.ResolvedQuoteControl | quote-engine | * |
Startup Dependencies
QE depends on keysquare-platform and Static Data Server being healthy before it starts.
In a typical platform boot sequence:
aeron-media-driverkey-accesssequencerrelay-cache,relay-livestatic-data-serverprice-enginequote-engine← starts here
QE signals readiness once all instrument subscriptions are complete and initial quote controls have been loaded from the database.
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:
| Field | Description |
|---|---|
instrumentId | Platform instrument ID |
tier | Tier number (1…n) |
ok | Whether the quote is valid |
enabled | Whether the quote is currently enabled for distribution |
firm | Whether this is a firm (binding) quote |
priceSource | The price source used to derive this quote |
bidPrice / askPrice / midPrice | Spread-adjusted clean prices |
bidYield / askYield / midYield | Spread-adjusted yields |
pv01 | Dollar value of 1bp, copied from input price |
bidSize / askSize | Quoted sizes, computed from size strategy |
message | Error message when ok=false |
marketInstrumentId | External 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 Message | Reason | Resolution |
|---|---|---|
Price is missing | No input price has arrived yet from the configured price source | Verify the price source is publishing. Check KS_QE_PRICE_SOURCES configuration. |
Source price is not ok | The input price has ok=false | Fix the underlying price issue — see Price Engine Troubleshooting |
Can't adjust bid yield - pv01 is zero | spreadType=YIELD but the input price has zero PV01 | Ensure Price Engine is producing a valid PV01 for this instrument |
Can't adjust bid price - pv01 is zero | spreadType=PRICE and QE needs PV01 to recalculate yield | Same as above |
Instrument not found | Instrument has not yet arrived from Static Data Server | Wait for SDS to become ready |
No profile set | Instrument has no profileName assigned | Assign a profile in Static Data Server |
Quote profile not found | The profile referenced by the instrument does not have a matching QuoteProfile | Ensure the corresponding Instrument Profile exists in SDS |
Price topic not found | The configured price source name does not match any registered entry | Verify KS_QE_PRICE_SOURCES contains a matching name |
Ref Quote control with tier: N not found | referenceTier is set but the referenced tier's control has not arrived yet | Wait for startup to complete; verify the referenced tier exists |
Ref Quote control not ok | The referenced tier's own control is invalid | Fix the error on the reference tier first |
Spread multiplier is zero | Effective spread multiplier evaluated to zero | Ensure both master and profile spread multipliers are non-zero |
Size multiplier is zero | Effective size multiplier evaluated to zero | Ensure both master and profile size multipliers are non-zero |
Restricted; | Instrument has a trade restriction flag set | Remove the restriction on the instrument in Static Data Server |
Invalid spread type | Spread type is UNKNOWN or unset | Set a valid spreadType (YIELD or PRICE) on the QuoteControl |
Invalid bid/ask size strategy | Size strategy is UNKNOWN or unset | Set 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:
- Update the configuration for
web-data-server:- Append
quote-enginetoKS_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
- Append
- 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
appNameparameter 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