Position Engine

Positions for all products other than position-based products (but including cash positions for position-based products) are computed by the Position engine which aggregates trades by book and by product (and additional user-defined criteria as needed).

The Position engine calculates positions based on the position configuration.

 

1. Position Engine Configuration

The Position engine is configured in the Engine Manager of Web Admin: event subscription and engine parameters.

The Position engine can subscribe to the following events: PSEventTrade, PSEventPriceFixing, PSEventProcessTrade, PSEventRateReset, and PSEventFXRateReset.

 Ⓘ   [NOTE: If you have set HANDLE_FUTURE_LIQ_CASH_FLOWS = true, PositionEngine also needs to subscribe to PSEventPLPosition PSEventAggPLPosition]

The Position engine does not use any filter.

 

The behavior of the Position engine may be modified with the following engine parameters and environment properties.

If a parameter is not available for setup, you can register it in the domain "engineParam".

Environment properties are specified in your Environment.

Parameters and Properties

Description

EXCLUDE_STATUS

Engine Parameter

For performance enhancement, this is to facilitate filtering out Trades based on their status. The positions will be built with trades that are not in the excluded Status.

You can add a status such as PRICING.

CANCELED trades are automatically excluded.

IGNORE_ACTION

Engine Parameter

Comma-separated list of trade actions to be ignored by the engine.

POS_CASH_FLOWS

Environment Property or Engine Parameter

Set to Y to activate the cash feature in the Position Engine, so that the engine generates cash positions.

Default is N.

Pricing_Env

Engine Parameter

Pricing environment used by the engine. If not set, the default Pricing Environment of the user running the engine will be used.

SAVE_SETTLE_POSITION_CHANGES

Engine Parameter

True to enable storing settle position change history.

The history information contains the new settle position after the update and the delta change from the previous update.

SAVE_SETTLE_POSITION_BUCKETS

Environment Property

Set to Y to use the settle position buckets feature. The Position Engine calculates positions by settle bucket according to the valuation times that you define at the global or book level.

Default is N.

USE_POSITION_ENGINE

Environment Property

Default is Y.

VALUATION_TIMES

Engine Parameter

Comma separated list of valuation times for which position snapshots can be run.

You can enter the time in the format HHMM (hours and minutes) or HHMMSS (hours, minutes, and seconds). When using the format HHMM, the seconds are set to zero.

If the VALUATION_TIMES book attribute is defined, it overrides the VALUATION_TIMES engine parameter.

VALUATION_TIMEZONES

Engine Parameter

Comma separated list of valuation timezones that correspond to the times listed in the VALUATION_TIMES parameter, if multiple time zones are used. You need to match the number of times and the number of timezones. If the number of timezones falls short of the number of times, the server timezone will be used for times that do not have matching timezones.

TWO_PHASE_ENGINE_NUMBER_OF_RETRY

Environment Property

Number of times the engine will retry to process the list of events in the TwoPhaseEngine used by Inventory engine, Margin Call Position engine and Position engine. Default value is 3.

 

2. Starting the Position Engine

The Position engine can be started from the Engine Manager in Web Admin.

Please refer to Calypso Web Admin documentation for complete details.

 

3. Creating Position Snapshots

The scheduled task CREATE_POSITION_SNAPSHOT allows creating position snapshots based on positions computed by the Position engine.

 Ⓘ   [NOTE: It is recommended to create position snapshots every day at EOD as they are required for running position-based risk reports]

You can also elect to store position changes between snapshots by setting the position engine parameter SAVE_SETTLE_POSITION_CHANGES to true.

 

Common Attributes

Common attributes have no effect except for Timezone, Valuation Time and Valuation Date Offset.

 

Task Attributes

"Snapshot Date": Enter a snapshot date (optional) - If no snapshot date is specified, the snapshot date is set to the valuation date of the scheduled task minus the number of business days specified in "snapshot date offset".
"Snapshot Time": Select a snapshot time from the snapshot times defined in the position engine parameter VALUATION_TIMES. The associated time zones are set in the position engine parameter VALUATION_TIMEZONES.

There should be the same number of snapshot times and time zones, if you specify more than one snapshot time.

"Override Existing Snapshot": Set to true to override existing snapshots, or false otherwise.
"Snapshot Date Offset": Enter a number of business days to adjust the valuation date in the past.
"Snapshot Date Offset Holidays": Enter the holiday calendars used to determine the business days. This can be a list of comma-separated holiday calendars.

 

The snapshot process considers positions to include in the snapshot, based on the "entered-datetime" of the position. The "entered-datetime" must be on or before the snapshot time.

For reference, the "entered-datetime" of the position is set when the position is computed by the Position engine based on the trade's "entered-datetime". Note that if the trade keyword "LateTradeDatetime" is set to accommodate late FX trades, it is used instead to determine the "entered-datetime".

Positions that have already been matured are aggregated into a single “matured bucket” record, thus reducing the total size of the snapshot table in the database.

 

3.1 Viewing Position Snapshots

You can view position snapshots that have been created from Main Entry > Reports > Nostro/Custodian Positions > Cash Position provided the Start and End Dates are the same as the position snapshot date.

You can also view position snapshots when running risk analyses on position snapshots.

 

3.2 DB CLeanup

You can delete snapshot entries using Main Entry > Utilities > Maintenance > Monitoring > Clean-up > Clean-up Database - Positions Snapshot panel.

 

You can also use the PURGE_POSITION_SNAPSHOT scheduled task to delete position snapshots.

Please refer to Calypso Automated Processing (Scheduled Tasks) documentation for details.