Risk Limits and Inventory Skew
Updated
Problem statement
Decide whether to accept, widen, or reject one market-making quote request while respecting liquidity-scaled inventory limits.
Use these values:
hard = baseLimit * liquidityScoresoft = softFraction * hardsignedQuantity = -quantityforBUYand+quantityforSELLprojected = currentInventory + signedQuantity
Apply the rules in order:
- If
abs(projected) > hard, return["reject", "null"]. - Otherwise compute
skew = -skewCoefficient * currentInventory. The baseBUYquote isreference + halfSpread + skew; the baseSELLquote isreference - halfSpread + skew. - If
abs(projected) > soft, the action iswidenand one extrahalfSpreadis added forBUYor subtracted forSELL. Otherwise the action isaccept.
Every decimal input is exact and has at most seven digits after the decimal point. Return a two-element string array [action, quote]. A non-rejected quote is rounded half upward to six decimal places and serialized with exactly six digits after the decimal point.
Function
decideRequest(currentInventory: int, side: String, quantity: int, reference: double, halfSpread: double, liquidityScore: double, baseLimit: int, softFraction: double, skewCoefficient: double) → String[]Examples
Example 1
currentInventory = 0side = "BUY"quantity = 100reference = 100.0halfSpread = 0.05liquidityScore = 1.0baseLimit = 50000softFraction = 0.6skewCoefficient = 0.0001return = ["accept","100.050000"]The projected inventory is -100, which is inside both limits. Current inventory is zero, so skew is zero and the base BUY quote is 100.050000.
Example 2
currentInventory = 300side = "BUY"quantity = 50reference = 100.0halfSpread = 0.05liquidityScore = 0.5baseLimit = 1000softFraction = 0.3skewCoefficient = 0.001return = ["widen","99.800000"]The hard and soft limits are 500 and 150. Projected inventory is 250, so the request is widened. Skew is -0.3; the base quote 99.75 receives one extra 0.05 on the BUY side.
Constraints
-10^9 <= currentInventory <= 10^9sideis eitherBUYorSELL.1 <= quantity <= 10^90 < reference <= 2 * 10^8and0 <= halfSpread <= 10^6.0.1 <= liquidityScore <= 1.1 <= baseLimit <= 10^9and0 <= softFraction <= 1.0 <= skewCoefficient <= 10^3.- Each decimal input has at most seven digits after the decimal point.
- Every non-rejected quote is positive and at most
10^12.
Source note: The original assessment screenshot defines the liquidity-scaled limits, signed trade direction, skew, widening rule, and output action.
More Millennium Online Assessment questions
- Calculate the Half SpreadOA · Seen Sep 2026
- Debug the Impact ModelOA · Seen Sep 2026
- Debug the Risk-Limit QuoterOA · Seen Sep 2026
- Hedge Inventory with Return CovarianceOA · Seen Sep 2026
- Quote One RequestOA · Seen Sep 2026
- Track the Book and Mark Final PnLOA · Seen Sep 2026
- Clean the TapeOA · Seen Sep 2026
- Client Markout AnalysisOA · Seen Sep 2026
- Debug Fair-Value LookupOA · Seen Sep 2026
- Debug the Tape CleanerOA · Seen Sep 2026
Similar questions at other companies
- Bold Play to Reach a GoalSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Last Object Exit TimeIBM · OAIBM interview questions
- Capping Portfolio WeightsCapstone Investment Advisors · OA
- Repeated Mirror XORMathWorks · OAMathWorks interview questions
- Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
- Find Total CostJP Morgan Chase · OAJP Morgan Chase interview questions
- Macaron Order PriceOpenAI · OAOpenAI interview questions
- Daily Settlement for Long and Short PositionsBelvedere Trading · OA
- Prime Factor VisitationMaven Securities · OAMaven Securities interview questions
- Proportional Momentum Investment StatisticsOptiver · OAOptiver interview questions