Skip to main content

How it works


Trades are events​

Each source is loaded into its own private event list, one event per trade, with the trade time as the event time. The Trade Capture extension has loaders for common sources, including Aligne, ABN, EEX, ETPA, Eurex and ICE.

The sources do not need to use the same field names or values. Each rule says which ETRM fields to compare with which fields of the external record. The examples in this guide use these event lists:

Event listSourceFields used
ETRM_TRADESETRM (master)product, buy_sell, absolute (contract), price, lots, venue, broker, clearer
ICE_ENDEX_TRADESICE Endex trade fileinstrument, side, absolute, price, lots
MAREX_CONFIRMSMarex broker confirmationscommodity, direction, absolute, price, volume
ABN_CLEARINGABN AMRO Clearing statementexchange_code, bs, absolute, price, quantity

A reconciliation runs for one day: it reads the events of that day from the master and from every matcher.


Models, matchers and rules​

A reconciliation model names the master event list and the matchers to compare it with. Each matcher has:

PartWhat it doesExample
EventThe event list holding the source's recordsICE_ENDEX_TRADES
Pre-rulesPrepare the data before matching, usually by choosing which ETRM trades belong to this sourceOnly compare ETRM trades with venue=ICE Endex
RulesEach compares one or more ETRM fields with fields of the external record, using a rule functionprice and price must be equal
Post-rulesRun after matching, for trades that do not compare one to oneAn ETRM quarter against three monthly exchange legs

Models are kept as private master data objects of type DATA_RECONCILIATION_SPEC.


Rule functions​

FunctionTypeRequiredMatches when
exact_matchRuleYesThe values are equal, field by field in the order selected
abs_numberRuleYesThe absolute values are equal, so a sell booked as -10 lots matches 10 lots
string_mapRuleNoA saved mapping says the two values mean the same thing, such as TTF Gas Futures in the ETRM and TFM on ICE Endex, or B and Buy
filter_master_dataPre-ruleKeeps only the ETRM trades matching the value, such as venue=ICE Endex, or book=GAS_FUT,GAS_OTC for either of two books
filter_matcher_dataPre-ruleThe same filter on the external records
stripPost-ruleAn ETRM quarter or year contract matches the monthly legs reported by the exchange, using the absolute field
stripDatesPost-ruleAn ETRM trade's delivery period (eventstart to eventend) covers the external trades' delivery periods. With a value such as lots=quantity, the external quantities must also add up to the ETRM quantity

Use exact_match and abs_number for the terms of the trade that must agree: contract, price and quantity. Use string_map where the sources name the same thing differently: product names and buy/sell codes.

Your own rule functions​

You can add rule functions of your own in a private JavaScript script, and list the script under Custom Scripts on the model. The script registers each function:

registerReconciliationFunction({
name: "price_within_tolerance",
category: "rule", // "rule", "pre" or "post"
required: true,
function: function(rule, meta, master, matcher) {
// master and matcher hold the values of the fields selected on the rule
return Math.abs(master[0] - matcher[0]) <= 0.005;
}
});

The function then appears in the list of functions when you edit a rule.


Results​

For each source, every ETRM trade gets one of these results:

ResultMeaning
MatchedEvery rule found the same single external record. The trade is confirmed.
PartialThe required rules (exact_match, abs_number) found candidates, but the rules do not all agree on one external record, or a string_map rule found no mapping. The trade needs a look.
UnmatchedAt least one required rule found nothing: the trade is missing from the source, or its contract, price or quantity disagree with every record.

And the source's own records can be:

ResultMeaning
Unmatched MatchersExternal records that are not a match or a candidate for any ETRM trade: trades the exchange, broker or bank has that your ETRM does not.

The result of a day is saved as the model's report for that date, which is what the dashboard shows.