Tenant - Book Hierarchy
The book hierarchy is a tree structure by which the portfolios risk books are organised. When a trade/adjustment is applied to a book it is also applied to its parent's book, that parent's parent, etc until it reaches the root (HOUSE).
If we add book adjustments/trades to CLIENTS or CLIENTS_HEDGING then the CLIENTS_NET book, the parent of both books, will have the same net position.
It is possible to see parent-child relationships between books. This can be useful when investigating overall performance to see which books have been most costly/profitable.
Please view your position management tab for a visualisation:
https://[your server]/dashboard/trading/position-management
Distribution and Books
The Risk Control Profile defines which books are used for booking certain trades against.
Risk Control Profiles can be found at distribution.riskControlProfiles they are currently editable via the server configuration editor
tradeInBook - the book with which the channel will book client trades against CLIENTS_LDN
For internalised trades
- a position is booked to tradeInBook (including markup)
For brokered trades
- a position is booked to tradeInBook (including markup)
- the reverse position is booked to washBookClientSide (without markup applied leaving markup pnl in tradeInBook)
- a position is booked to washBookMarketSide without markup. It is expected that this position sits outside of the net hierarchy and is used for analysing external LP markouts
pnlSweepWashBook - the target book with which trade positions are moved to after 30 seconds. Leaving risk that is 30 seconds or less in the tradeInBook. If this is not set, the tradeInBook becomes the sum of all client trade positions over time. Please see footnote *2
BrokerRiskManagementConfig.washBookClientSide - BROKERED_CLIENT_WASH. The reversal position booking when trades are brokered (the broker/bank does not bare any risk). This is the reverse of the client trade.
BrokerRiskManagementConfig.washBookMarketSide - something like A_EXTERNAL_WASH. This is expected to sit outside of the risk book hierarchy and is used for booking trades for LP analysis.
SIMPLE / RISKPATH BOOKS
analytics.riskpath.book - this is the book that RiskPath or SimplePath uses to analyse trades e.g. produce Yield Profiles/Markouts. Any trade in this book or child books is considered.
Outsider parties
Zoltan when he wrote this, belived in convention over configuration (to minimise repetitive setup tasks)
As part of the brokering workflow in distribution "outsider" parties was coined.
Identifies a "Root" party from the risk path book i.e. the first parent party with the phrase "HOUSE" in it above the risk book.
Outsider parties are parties below the "Root" book that are not part of the analytics.riskpath.book's hierarchy.
To break from convention and use configuration please use analytics.riskpath.outsiderBooks
Hedging Books
Hedgers also have a sweep book. They sweep the trade positions into the sweep book so that the hedging book contains just the 30 sec reval of performance of the hedger. The idea is that this can be used to assess hedging performance. Please see footnote *2
hedging.booking.watchRiskBook = book hedgers are watching risk from
hedging.booking.sweepToBok = book hedgers sweep their positions to
risk.riskParty = risk book
risk.hedgingParty = hedging book
risk.clientParty = client book
hedging.orderServiceConfiguration [tradeInBook} - the book the hedger will trade in
hedging.arb.orderServiceConfiguration [tradeInBook} - the book the arb hedger will trade in
Dashboard configuration & Analytics Books
multiTenant.compassTenantProfiles - this defines which books relate to a risk warehouse or Compass Tenant.
pnlBook - which book to read the tenants pnl from
varChartBook - which book to read the tenants risk from
positionChartBook - which book read the tenants positions from
volumeChartBook - which book to read the client trade volumes from
Internal Mahi Only
Code relating to brokering allocations.
*2 This can be more cheaply computed. It also exercises the hosue position server which is the critical path for system throughput. We could consider removing this.
TROUBLESHOOTING ERRORS
2024-06-25 09:52:39,558 ERROR TradeSummaryPersisterWriteBehind-Drain-1 o.h.e.j.b.i.BatchingBatch HHH000315: Exception executing batch [java.sql.BatchUpdateException: Duplicate entry '1717916917413538625-YIELD_PROFILE' for key 'PRIMARY']
The above error may be a genuine duplicate id or riskPath is tracking the same books. Double check