Here we share our current projects, research ideas, events, news and anything else that comes out of our brainstorming sessions


VIVAT Insurances, part of the Anbang Insurance Group, is the company behind brand names like: Zwitserleven, Zelf, Route Mobiel, Reaal, Proteq Dier & Zorg en ACTIAM. VIVAT is a relatively new, but its brands have been around for a long time. Ugly Duckling is happy to be chosen as a supplier of consultancy service for the VIVAT group to assist with the risk management with the goal of consolidating the solidarity that VIVAT brands have provided to their clients for over 150 years.

Tapestry part VI - Testing a WEB API


In this blog we will show how a WEB API created using Tapestry can be tested. Testing a web service is not straight forward as the PageTester, the default way of testing in Tapestry, doesn't allow for testing API. To overcome this difficulty we must start a Jetty server with custom/test web.xml. The test web.xml allows us to control the construction of objects. In this example we show how a mock service object can be inserted for testing, while using the full implementation for production.

This blog is part of a series of blogs on Tapestry that explains how to build a "simple" hello world example html page and expose the functionality of the page(s) via a WEB API. In a previous blog we showed how to setup a web API that responses in either XML or JSON. If you haven't read it yet, it's probably a good idea to have a look at this blog first before proceeding.

This blog picks things up from another previous blog in the series on testing page. The basic of testing a webpage generated with Tapestry are explained there. In this blog we will build on the code previously created.


Continue reading

Standard Formula and Solvency Capital Requirements

We have recently finished a project with an international insurer whose headquarters is in the Netherlands Randstad area. The experience was extremely satisfactory, mainly due to the interactions with the quant development group, which was very knowledgable and provided a pleasant working environment, and the topic under investigation, which was the construction of a system to compute economic capital requirements of the firm. Hence it is interesting to remind ourselves of some of the regulatory requirements behind the insurance business.

Generically, economic capital requirements are attached to the solvency word, which denotes the degree to which assets exceed liabilities. The difference (if positive) is also known as own funds. Such Solvency Capital Requirements (SCR in short) are dictated the European Insurance and Occupational Pensions Authority (EIOPA), which will be referred to as the regulator in the rest of this post. In mathematical terms, capital requirements are Values at Risk (VaR's), hence variances at given confidence levels.

One such regulatory requirement is known as the Standard Formula. As the name suggests, this is a standardised calculation that all the firms are asked to implement. However, it might not exactly reflect the risk profile of any specific entity and moreover, some risks might be relevant for some entities only, while completely irrelevant for others. Our main reference for this post will be the original EIOPA documentation which can be found here or here.

In the the Standard Formula calculations the various sources of risks are organised into a hierarchical structure (see picture). The root node represents the Basic Solvency Capital Requirement (BSCR) for the whole firm.

SF risk hierarchy

A capital requirement is calculated for each module in the risk hierarchy. All the capital requirements at each level are then aggregated into the parent level by using correlation matrices. The correlation parameters are chosen in such a way that the calculated SCR best approximates the 99.5% VaR over a one-year period of the aggregated capital requirement. In formulas, for two risk factors X and Y, the correlation parameter rho minimises the absolute difference:

Aggregation with correlation

Let's now look at each risk source in more details. Continue reading

Tapestry part V - Testing a page


In this blog we will demonstrate how to test a webpage within the Tapestry framework. The framework comes with a few handy testing options. Here we will consider the PageTester object, which can be used to replicate interactions between user and application. It deals with all input and output on the pages. As such it is great for User Acceptance Testing and Unit Testing. To show how to use the PageTester we will add some tests to the Hello Tapestry example of the first blog in the series.


Continue reading

Using Safari To View XML Files

This blog explains how to get nicely-formatted XML in the Safari browser.


Recently we have been writing a series of blogs on the Tapestry framework showing how it can be used to create web applications. One of the blogs explains how to get the framework to return XML response for API integration. While creating the example we noticed that on OSX the Safari browser didn't give us back nicely-formatted XML files (see example)

initial in safari default.


In other browsers we did get the expected result. Since for most of the series we had been using screenshots from the Safari browser to illustrate the expected results, we wanted to stick with this browser. As it turns out, you can get nicely-formatted XML files in Safari, however this requires an additional one-time setup. Continue reading

Tapestry - Part IV: Extended API using XML


In a previous blog in our Tapestry series we showed that Tapestry can be used as an API. While we would advice to do this only for simple cases, it could be a good solution if you wanted to offer Web API for your existing Tapestry application. If you were interested in a fully-fledged Web API with all the bells and whistles it would probably be better to use a separate framework.

In a previous blog we build an API returning JSON. This raises the question: is it also possible to return XML? The answer turns out to be yes!

In this blog we will show how to do so.


Continue reading

Bankers' Oath is a Compliment

Since beginning of 2015 the bankers' oath is mandatory for all bankers in Netherlands. However, it doesn’t stop there as in some cases external contractors are also required to declare the oath. Of course this means dealing with a little bit of ceremony and paperwork to get the oath official. Traditionally small businesses and independent professionals don’t get too exited about doing "extra" paperwork. In this case there is a little bit more to it.

If you are asked to declare or swear the oath it means your work is considered to be of impact on the risk profile of the bank or that you deal with clients of the bank directly. (Be sure to check the Dutch law for an exact definition.) This can be translated as: the work you do is important for the bank. In this light the oath can be seen as a complement. Continue reading

Tapestry - Part III: Input Validation


In previous blogs we showed how to setup a simple “hello world” web application using Tapestry including an API. One of the issues we ran into is that some names are reserved in the application for page names, so they can’t be used as input names for the application. Here we will show how the input can be filtered and meaningful error messages can be created for the user. This approach allows you to create a better user experience and safer applications.


Continue reading

Ugly Duckling Welcomes Nationale Nederlanden as Client

We are happy to announce that Ugly Duckling will be supporting the Nationale Nederlanden Quant Development team. We will assist the team in writing code, tests and documentation. In addition existing code bases are to be migrated from legacy systems. In short,  we will support the team with the implementation of their quantitive finance requirements in a modern application that will transform raw data into business information for the wider organisation.

Tapestry - Part II: Simple WEB API using Tapestry


In this blog we will show you how to extend your Tapestry projects with a simple API. If you have a big project and need complex calls to expose your API functions, then this approach is not for you. Instead, if you have a couple of functions you would like to expose, this is a quick and simple approach to get it done.


  • This tutorial uses Eclipse with Maven
  • This tutorial builds on previous blog

We consider a setup where a request to \\\api should be replied with a JSON stream, where stream is just fancy way of saying text file. To do this in Java there are a few very good frameworks:

The last one is the easiest complete-integration framework for REST API that will work with Tapestry that we could find. However, if your have very simple requirements even the out-of-the-box frameworks might not be worth configuring. The alternative is to parse arguments during the rendering of a page and respond with XML or JSON. In this example we’ll show how to create an API for our hello-world application, which we build in our previous blog. Continue reading