Use Case Position Service

Position Services

Position services are used in a number of scenarios from web-store inventory list to complex asset iformation for gobal banking:

  • Posstion list for asset asset trading
  • real-time market risk
  • stock lending and repo (especially during controls on short selling)
  • Stock ladders
  • trade matching
  • working capital/ cash-in-hand

Traditionally positions would have been calculated by aggregating positions over a number of trading books, but the high number of queries can presented an unacceptble load on the system-of-record, and potentially lock-serialisation. For complex businesses this need is often addressed by using a caching service that is updated with each trade.


Hiperspace Cube solution

Hiperspace Cube functionality enables read-time delta aggregation as the inventory of assets are bought and sold, with aggregates at every level of book and contry holding.

Type │ When │ Trigger │ Notes
Full │ Often Daily │ Scheduled │ reaggregates the base level of Cube fact
Delta │ Continuous │ Whenever a fact changes │ aggregates the facts and summaries affected by the change to the fact, but no others
Dependency │ Continuous │ Whenever a @DeltaIndex element references by a fact changes │ aggregates the facts and summaries affected by the change to a fact dependency, but no others
Related │ Frequently │ Whenever a @DeltaIndex element related is some way to fact changes │ aggregates the facts and summaries affected by the change, but no others
Dimension │ Frequently │ Change to a dimension with a @DeltaIndex changes │ Clears any summaries that might now be invalid due to restructure
│ as needed │ read │ Any summaries that are not currently stored are recalculated from base facts

This HiLang schema maintains a cube for Instrument and quantity by country holding the asset:

@CubeDimension
entity Country (ISO : String) [Instruments : Instrument (Country = this)];

@CubeDimension, Versioned
entity Instrument 
(ISIN : String)
{Country : Country, Product : Product} 
[Price : Price, Market = Price.Market];

@CubeFact, DeltaIndex
entity Trade : Versioned
	(id : Int64) 
{
	@CubeMeasure(Aggregate.Sum) 
	Quantity : Decimal, 
	Instrument : Instrument, 
	Portfolio : Portfolio,
	Account : Account
} 

The Hiperspace cubes hold the aggregate total with a time dimension


Hiperspace Cube aggregation obviates the need for seperate position servers and caches because hiperspace elements are stored using the fastest durable storage available with KV-SDD devices

Copyright © Cepheis 2024