{"id":723,"date":"2024-09-15T11:34:19","date_gmt":"2024-09-15T06:04:19","guid":{"rendered":"https:\/\/saurabhjain.dev\/?page_id=723"},"modified":"2024-09-15T11:34:19","modified_gmt":"2024-09-15T06:04:19","slug":"uti-generator-lib","status":"publish","type":"page","link":"https:\/\/saurabhjain.dev\/?page_id=723","title":{"rendered":"UTI Generator Lib"},"content":{"rendered":"\n<p class=\"has-medium-font-size\"><strong>Introduction<\/strong><br \/>Wholesale Energy markets in Europe are regulated by ACER (European Union Agency for the Cooperation of Energy Regulators). The agency has published Transaction Reporting User Manual (TRUM) to facilitate reporting. The TRUM is intended to provide market participants with guidance to make informed decisions about their transaction reporting obligations.<br \/>Please refer to the following link for details: <a href=\"https:\/\/www.acer.europa.eu\/remit-documents\/remit-reporting-guidance\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.acer.europa.eu\/remit-documents\/remit-reporting-guidance<\/a><br \/>Annex IV provides guidance on generation of UTI (Unique Transaction Identifier). Under this Annex, the Agency has developed and published an ACER algorithm which would enable market participants to generate an UTI from the economic terms of the bilateral trade.<br \/>This library (<a href=\"https:\/\/gitlab.com\/saurabhjain1537\/acer-uti-generator\">https:\/\/gitlab.com\/saurabhjain1537\/acer-uti-generator<\/a>) is Java implementation of the ACER UTI Algo version 2.2<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Deployment<\/strong><br \/>Client applications need to include uti-generator jar and dependency jars in class path. Then invoke  following method to get UTI based on Trade attributes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>reporting.utils.uti.UtiGenerator.generateUTI(TradeDetails)<\/code><\/pre>\n\n\n\n<p class=\"has-medium-font-size\">Please refer to the project ReadMe for Installation and Usage example.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-deployment.drawio.png\"><img loading=\"lazy\" decoding=\"async\" width=\"475\" height=\"362\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-deployment.drawio.png?w=475\" alt=\"\" class=\"wp-image-728\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Class Design<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-class-diagram.drawio.png\"><img loading=\"lazy\" decoding=\"async\" width=\"648\" height=\"515\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-class-diagram.drawio.png?w=648\" alt=\"\" class=\"wp-image-730\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>ACER Algorithm vs ACER Generator Excel<\/strong><br \/>ACER TRUM Annex IV v2.2 provides excel based implementation of the algorithm as well. However, there is a difference in handling of <strong>Price<\/strong> and <strong>Quantity<\/strong> columns between Algorithm and Excel implementation.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Price<\/strong><br \/>It is mentioned in the ACER guide that Price should be denoted in Currency Per QuantityUnit. Please see this snapshot:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-price-algo.png\"><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"129\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-price-algo.png?w=746\" alt=\"\" class=\"wp-image-734\" \/><\/a><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">The ACER provided excel implementation doesn&#8217;t follow this and divides price by quantity.<br \/>In the following example, input Price is 53.5 GBP Per MWh\/h.<br \/>Quantity Units MWh\/h is same as MW.<br \/>Expected Price in the concatenated string is 53.5 GBP Per MW.<br \/>The excel divides the Price by 1000 (which is the Quantity) and uses the Price 0.05350 GBP Per MW.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-price-example.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1813\" height=\"106\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-price-example.png?w=1024\" alt=\"\" class=\"wp-image-736\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Quantity<\/strong><br \/>Quantity should be converted to a standard unit. Please see this snapshot:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-quantity-algo.png\"><img loading=\"lazy\" decoding=\"async\" width=\"727\" height=\"210\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-quantity-algo.png?w=727\" alt=\"\" class=\"wp-image-738\" \/><\/a><\/figure>\n\n\n\n<p class=\"has-medium-font-size\">The ACER provided excel implementation always calculates Quantity as 1.0<br \/>In the following example, input Quantity is 24.0 MTherm\/d.<br \/>Equivalent to 24000000.0 Therm\/d<br \/>Expect Quantity in the concatenated string is 24000000.0 Therm\/d.<br \/>The excel divides the Quantity by Quantity and uses 1.0 Therm\/d.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-quantity-example.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1800\" height=\"113\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-quantity-example.png?w=1024\" alt=\"\" class=\"wp-image-740\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\">As per general understanding, Price and Volume values are same in all of the following rows.<br \/>Standard format should be S.No. # 3 as per the ACER guide.<br \/>Price = 12000 EUR per MW<br \/>Quantity = 0.02 MW<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table class=\"has-white-background-color has-background has-fixed-layout\"><thead><tr><th><strong><em>S.No<\/em><\/strong><\/th><th><strong>Price<\/strong><\/th><th><strong>Price Unit<\/strong><\/th><th><strong>Volume<\/strong><\/th><th><strong>Volume Unit<\/strong><\/th><th><strong>Monthly Amount<\/strong><\/th><th><strong>Amount Unit<\/strong><\/th><th><strong>Monthly Volume<\/strong><\/th><th class=\"has-text-align-center\" data-align=\"center\"><strong>Unit<\/strong><\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>12<\/td><td>EUR per Kwh<\/td><td>480<\/td><td>Kwh\/d<\/td><td>172800<\/td><td>EUR<\/td><td>14400<\/td><td class=\"has-text-align-center\" data-align=\"center\">Kwh<\/td><\/tr><tr><td>2<\/td><td>12<\/td><td>EUR per Kwh<\/td><td>20<\/td><td>Kwh\/h<\/td><td>172800<\/td><td>EUR<\/td><td>14400<\/td><td class=\"has-text-align-center\" data-align=\"center\">Kwh<\/td><\/tr><tr><td>3<\/td><td>12000<\/td><td>EUR per Mwh<\/td><td>0.02<\/td><td>Mwh\/h<\/td><td>172800<\/td><td>EUR<\/td><td>14.4<\/td><td class=\"has-text-align-center\" data-align=\"center\">Mwh<\/td><\/tr><tr><td>4<\/td><td>12000<\/td><td>EUR per Mwh<\/td><td>0.48<\/td><td>Mwh\/d<\/td><td>172800<\/td><td>EUR<\/td><td>14.4<\/td><td class=\"has-text-align-center\" data-align=\"center\">Mwh<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Configuration<\/strong><br \/>A properties file <em>uti-generator.properties<\/em> can be included in the client application classpath to configure a following properties: <\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li class=\"has-medium-font-size\"><strong>DBFilepath<\/strong>\n<ul class=\"wp-block-list\">\n<li>default value = acer-uti-gen.db<\/li>\n\n\n\n<li>The utility uses sqlite to keep track of generated UTIs.<\/li>\n\n\n\n<li>It is used to generate progressive number for equal trades on the same date.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li class=\"has-medium-font-size\"><strong>NormalizerType<\/strong>\n<ul class=\"wp-block-list\">\n<li>default value = Normalizer<\/li>\n\n\n\n<li>valid values = Normalizer, AcerNormalizer<\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Normalizer <\/mark>means the implementation of ACER Annex IV &#8211; Guidance on the Unique Transaction ID (UTI) v2.2.<\/li>\n\n\n\n<li><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">AcerNormalizer <\/mark>means the that generated UTIs exactly match the Generator excel provided by ACER.<\/li>\n\n\n\n<li>Ideally ACER guide and generator should have same logic. But Generator Excel always has the quantity as 1.0 in the concatenated string (as explained above).<\/li>\n\n\n\n<li>UTI generated by Excel is different from the algo.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Automated Unit Tests<\/strong><br \/>UTI Generator Lib has more than 100 jUnit tests providing more than 90% Line coverage.<br \/>jUnit 5 Nested annotation has been used to organize the unit tests which cover corner cases using ParameterizedTest annotation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-coverage.png\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"806\" src=\"https:\/\/saurabhjain.dev\/wp-content\/uploads\/2024\/09\/uti-generator-coverage.png?w=686\" alt=\"\" class=\"wp-image-748\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>Support<\/strong><br \/>Please contact via email: <a href=\"mailto:support.earlobe937@passmail.net\">support.earlobe937@passmail.net<\/a><br \/><\/p>\n\n\n\n<p class=\"has-medium-font-size\"><br \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>IntroductionWholesale Energy markets in Europe are regulated by ACER (European Union Agency for the Cooperation of Energy Regulators). The agency has published Transaction Reporting User Manual (TRUM) to facilitate reporting. The TRUM is intended to provide market participants with guidance to make informed decisions about their transaction reporting obligations.Please refer to the following link for &hellip; <a href=\"https:\/\/saurabhjain.dev\/?page_id=723\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">UTI Generator Lib<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"nosidebar-page.php","meta":{"footnotes":""},"class_list":["post-723","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=\/wp\/v2\/pages\/723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=723"}],"version-history":[{"count":0,"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=\/wp\/v2\/pages\/723\/revisions"}],"wp:attachment":[{"href":"https:\/\/saurabhjain.dev\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}