Author Archive for Duncan Shaw

An API (Application Programming Interface) is a mechanism for one system to talk to another. APIs are used as a communication channel between systems within the same organisation and/or used externally between systems of one organisation and another. Either way, the use of an API is an efficient and secure way (provided they have been developed appropriately) to exchange data. Hedgebook was built using private APIs (in-house APIs used to pass information between the back-end and front-end of the Hedgebook application) but this year has seen the launch of Hedgebook’s public API. Who cares? Well, if you are a bank or currency broker with hundreds/thousands of customers and you want to use Hedgebook to visualise and share your customers’ hedging position then an API allows the transfer of the deal data from your system to Hedgebook efficiently and securely. Your IT teams will certainly care that there is an API available.

The deal loading component of the API allows banks and FX brokers to provide their customers’ fx deal information straight into Hedgebook. No manual input. No CSV uploading. Information can be delivered to Hedgebook anywhere from once per day to real-time. The FX sales desks of banks/brokers are understandably not interested in the mechanics of how info is loaded (it just needs to be correct with minimal effort). It is the resulting level of insight at their fingertips that is the value proposition. The deal loading component of the API is a crucial linkage between the bank/broker systems and Hedgebook which leads to the visual representation and deeper understanding of the data. Sales teams don’t have to worry about manually representing the complicated option structures they sell. Hedgebook translates these structures in an easy to understand way which benefits both the bank/broker and their customers. The API works both ways i.e. it allows banks/brokers to send Hedgebook deal information but it also allows them to retrieve information on the deals and their valuations. The data can be fed into data warehouses which gives these organisations the ability to write their own reports and put their own slant on the information.

Providing Hedgebook to the bank/brokers customers pre-populated with their trade information is a fantastic value add tool for the customer. The insights and conversations are targeted. Strategy/decision making made easier. The API facilitates this.

Our testing environment enables development teams to safely experiment with our API, whilst our full documentation and customer support facilitates easy integration. Documentation and access to the UAT environment is available on request.

Talk to us to find out more.

The purpose of this post is to provide a worked example of how a Participating Forward is represented in Hedgebook’s Exposure Tool. A Participating Forward is a structured option which provides a known worst-case rate (Protection Rate) and the ability to participate in favourable movements for a portion of the structure (often 50%).

In this example, a UK based importer has USD costs that are being hedged with the following Participating Forward:

On expiry of the participating forward:

– If the spot rate is lower than the strike rate (1.1850) the importer will transact the Protection Amount ($1,000,000) at the strike rate (1.1850).

– If the spot rate is higher than the strike rate (1.1850) the importer will transact the obligation percentage amount ($500,000) at the strike rate (1.1850) leaving the remaining $500,000 to be transacted at the higher market rate.

Prevailing Market Rates

When the Exposure Tool is first launched, the displayed position is determined by the prevailing market rate. In our example the market rate was 1.2338:

The forward rate for Nov 2019 (the month the Participating Forward expires) is 1.2367. Hedgebook compares the forward rate to the strike of the Participating Forward to determine how the position is displayed. Since 1.2367 is higher than the strike rate (1.1850) 50% (the obligation percentage) of the Protection Amount is deemed to be transacted at the strike rate, 50% is assumed to be transacted at the more advantageous market rate.

The solid blue area of the bar represents the portion of the hedge that is transacted at the strike rate ($500,000 at 1.1850). The shaded area of the bar represents the portion of the hedge that would be transacted at the market rate ($500,000 at 1.2367).

In this scenario, the Exposure Tool shows $500,000 of hedging at the strike rate of 1.1850 and $500,000 of an “unhedged” amount i.e. the portion that can be bought at the more advantageous prevailing market rate. The combined rate, or Indicative Achievable Rate, is the weighted average rate of 1.21085 (average of 1.2367 and 1.1850). In our example the Forecasted Cashflow is equal to the Protection Amount of the Participating Forward.

If the Forecasted Cashflow was greater than the Protection Amount, the Indicative Achievable Rate would include the difference between the Forecasted Cashflow and the Protection Amount balance at the prevailing market forward rate. For example, if the Forecasted Cashflow was $2 million, $500,000 would be hedged at 1.1850 and the remaining $1.5 million would be transacted at the prevailing market rate.

In our example the prevailing market rates are higher than the strike of the Participating Forward, therefore, no matter how far to the right (stronger GBP) we drag the Exposure Tool slider there is only $500k hedged at the strike 1.1850, the balance will be transacted at the more advantageous/higher rates.

Currency P&L Impact

The Exposure Tool calculates the Currency P&L Impact of hypothetical movements in the exchange rate. When the Exposure Tool is first launched the Currency P&L Impact is zero i.e. the prevailing market rates set the base from which hypothetical movements are compared. So, initially, the Hedge Rate (current) and Hedge rate (scenario) overlap, so too the Achievable Rate (current) and Achievable Rate (scenario). Since we have only included a single month of exposure and hedging (Nov 2019) the rest of the Achievable Rate line tracks the scenario forward curve.

Hypothetical Exchange Rate Scenarios

When we simulate hypothetical exchange rate scenarios by moving the slider at the top of Exposure Tool, Hedgebook calculates the impact on the Participating Forward and the P&L impact.

Let’s consider the impact of a 5% weakening of the GBP/USD exchange rate:

The market rate (1.1750, the implied Nov 2019 forward rate) is below the strike of the option (1.1850) so the bar is solid blue indicating that the full Protection Amount of $1,000,000 will be exercised at the strike rate. The Hedged Rate and the Achievable Rate are the same (1.1850).

By moving the slider away from the prevailing market rate, we create a P&L impact:

The Currency P&L Impact is calculated by the difference in the Achievable Rates i.e. ($1,000,000/1.21085) – ($1,000,000/1.1850) = -£18,017. The importer is £18,017 worse off if the GBP/USD exchange rate falls 5% from current rates.

For the importer, a stronger GBP/USD exchange rate has a positive P&L impact as the amount of GBP required to purchase the same amount of USD is less. If we simulate a 5% stronger GBP we get the following profile:

A +5% movement implies a Nov 19 market rate of 1.2984. The solid blue represents the obligation amount at 1.1850. The shaded amount is assumed to be transacted at the more advantageous market rate. The implied Achievable Rate is 1.2417.
The difference between the current rates and the +5% scenario creates a positive P&L impact of +£20,516 (1,000,000/1.21085) – (1,000,000/1.2417).

Hopefully the above explains the methodology of the Exposure Tool when considering a Participating Forward. Any questions can be directed to


The reaction from our partners and corporate clients to the launch of Hedgebook’s Exposure Tool has been hugely satisfying. The Exposure Tool combines foreign currency cashflow forecasts with fx hedging derivatives to provide a clear visualisation of the company’s hedging position. Moving seemlessly between time horizons, currency pairs and hypothetical exchange rate movements enables users to gain a deeper understanding of their position under both prevailing market rates and hypothetical scenarios.

Sharing the information between the customer and their bank/broker/advisor allows discussions to focus on the gnarly stuff without wasting time getting to the starting position. Strategies can be formulated, impacts on the hedging position analysed (including against risk control limits) prior to entering new transactions.

For users of path dependent options where the amount or hedged rate can change under different market conditions the Exposure Tool brings absolute clarity. Experience has told us that businesses entering FX derivatives (for all the right reasons) often have difficulty articulating the structures and the potential outcomes that the business is exposed to. The Exposure Tool distills the complexity of FX hedging to easy to understand outcomes.  

Contact Us to find out more.

We are excited to form a new Partnership with TreasuryXpress, a leader of on-demand digital treasury management solutions. Customers using TreasuryXpress’s platform benefit from easy-to-implement electronic payment workflows that helps automate payments and remove payment risk. TreasuryXpress and Hedgebook share a common goal – bring cost effective treasury tools to customers of all sizes. Combining Hedgebook’s risk management modules with TreasuryXpress’s treasury operations and cash management platform creates a unique, powerful and economic option for mid-market organisations that have been under-served. The Partnership focuses on opportunities in Europe and the US.

Read about the Partnership here:



Founded in 2011, in New Zealand, Hedgebook is a dynamic, international financial software company delivering innovative treasury management solutions to SMEs and their treasury providers – such as banks and foreign exchange brokers.

Its mission is ‘simple’. To provide analytical tools which make life easier for financial professionals. People who otherwise would still be grappling with spreadsheets to shed light on complex financial instruments. It’s a huge market. One that Hedgebook was first to identify, and quick to own.

The new breed of Treasury Management System

Duncan Shaw, APAC Client Relationship Director, explains. “Yes, there are other Treasury Management solutions on the market, catering for the top end of town. With big-business price tags to match. But there was no TMS in the SME space, just good, old spreadsheets…. this is the void that we are filling.”

“We’re not competitors to larger, traditional TM systems. Our competition is the old-fashioned, unwieldy spreadsheet. Finance professionals have struggled to find a viable alternative to spreadsheets, until Hedgebook.”

Ian Ross, Chief Technology Officer (CTO), sums up the Hedgebook approach. “The big thing we have achieved is simplifying the complex. We take technology out of the equation, whilst putting big-business functionality in SMEs’ hands –at a fraction of the cost.”

Since its inception, Hedgebook had been successfully delivering TMS via hosted infrastructure, until its migration to Microsoft SQL Azure in March 2018. So, what precipitated this significant transition?

The relentless quest for performance gains and cost savings

Inherently, Hedgebook is thirsty for innovation, always looking for new ways to improve the functionality enjoyed by its customers. But as Ian Ross describes, it was the specific need to better service its larger clients that led to the company’s move to the cloud.

“For the level of functionality we were planning to introduce for our larger clients and distribution partners – Hedgebook needed to be super responsive and super scalable, without investing a whole lot of money upfront. Microsoft Azure quickly rose to the top of our list of cloud providers because the barriers to entry were so low.”

“We needed a safe environment, ticking the boxes of security, reliability, certification and accreditation. Microsoft gave us the feeling that we could ‘lift n shift’ from hosted infrastructure to the cloud – and quickly start to optimise our presence in that environment.”

“Previously, if I wanted to improve database performance, my biggest pain point was having to migrate from one virtual machine to another – with all the testing and heartache. With SQL Azure I drag a slider to the right, and suddenly I’m dealing with a much bigger database.”

“We migrated to Microsoft SQL Azure – and our customers didn’t notice”

Ahead of any significant shift in infrastructure, common sense dictates consideration to the possible knock-on effect on the end-user experience. Bryn Lewis, a Microsoft Most Valuable Professional (MVP) who has worked with Hedgebook since the early days, describes an initial migration without ‘any disturbance of the force’.

“Migration to cloud required minimal code or database changes, so we didn’t run up costs retesting code modifications. We simply dropped straight into the cloud and were up and running. Now we’re identifying performance improvements, cost reductions and reliability improvements at our leisure – rather than having to do it all up front.”

“We certainly achieved an ultra-responsive system, with far greater visibility and intelligence over the application. Which has allowed us to identify functionality with sub-optimal performance and fix them. Essentially saving money as we go.”

“And the clients scarcely noticed. Yet if they were to look at performance, the average user would notice the software running much faster than before.”

The technical journey behind ‘lift n shift’

Whilst Hedgebook describe the ease of migrating from hosted infrastructure to the cloud, the phrase ‘lift n shift’ perhaps trivialises the complexities behind the scenes. CTO Ian Ross picks up the narrative on the technical journey:
After several weeks’ preparation, we moved the Hedgebook Pro Software as a Service (SaaS) application from four dedicated servers hosted by SingleHop to Microsoft Azure.

The application is built using Visual Studio and consists of C/C++/C#/VB.Net code with a rich JavaScript web client. Data was stored in SQL Server 20012 and the core modules interacting via Microsoft Message Queue (MSMQ). (The Hedgebook application was originally developed on Windows Server 2008R2 and SQL Server 2000, but had been migrated to Windows Server 2012R2 and SQL Server 2012 R2.)
The initial focus was migrating the database from a dedicated SQL Server to SQL Azure. We repeatedly migrated the database using the Microsoft Migration Data Migration Assistant. Each migration focused on fixing a class of issues including: SQL ANSI-89 to ANSI 92 Syntax updates and moving off unsupported features.

The fixes were applied to the production database as part of the normal release cycle. Once the database could be migrated without any issues we moved to the application code & plumbing. In the hosted environment, the application was over provisioned to cope with EoM, EoQ, and EoY processing spikes which has significant cost implications.

Concurrently, we constructed a proof of concept (PoC) using an Azure Virtual Machine Scale Set (VMSS) to allow us to scale up & down the number of financial instrument pricing nodes in response to customer demand.

The VMSS nodes are provisioned using scripts based on the Azure VMSS Automation DSC sample. The scripts copy the necessary files from Windows Storage and install our pricing agent (a Windows Service) and dependencies (MSMQ etc.) on the standard Microsoft Windows Server 2012 R2 VM image.

Some of the VMSS provisioning configuration files were stored in Github and this caused us some issues in our trial live deployments. Between our PoC project (Jan 2018) and trial deployments to live Github disabled TLS V1.0 & V1.1 and required V1.2. In a standard Windows Server 2012R2 image V1.2 is not enabled so we had issues with connectivity. Migrating to Windows 2016 or moving configuration to Azure storage fixed were identified and confirmed as viable solutions.

With VMSS and the increased number of pricing nodes, we discovered a previously unknown threading issue in a cache implementation which required remediation. A .Net hash table had been used in a non-thread safe way and was causing application hangs and data corruption (in test), when a number of pricing nodes were running concurrently. Replacing the Hash table with a thread safe implementation and disabling the cache until it could be replaced with Redis were identified and confirmed as viable solutions.

The application has now been running for 18 weeks, during which there have been a couple of minor issues, unrelated to Azure, which we are in the process of investigating. The customer experience has improved with the initial performance testing indicating the pricing of a larger portfolio going from 35 to just under 20 seconds (depending on portfolio).

What’s the bottom line?

With the technical, performance and customer experience aspects of Hedgebook’s migration to Azure duly acknowledged, the company is also enjoying substantial, ongoing cost savings. Matching performance-to-performance on a standard month, Hedgebook reports saving an eye-opening 50-60% of their pre-migration costs for a like-for-like solution. Yet, as Ian Ross keenly observes, cost savings are not the bottom line – because Azure brings a wealth of inbuilt Microsoft benefits.

Microsoft – supporting companies in the post-GDPR world

“One of the first things we did when we got into the cloud was to turn on automated Transparent Data Encryption (TDE) – to take care of GDPR heartaches. Large customers ask all sorts of questions about hosting, and where data is stored (OLTP). These questions just disappear as soon as you say ‘we’re on SQL Azure’ because the platform has all the required compliance in place and is so well thought of by larger clients.”

“And that puts us in a tremendous position,” adds Ian Ross. “We now have the confidence to go after larger chunks of the market, globally, knowing that infrastructure won’t hold us back. With Azure, I’ve got the ability to scale the hardware almost instantaneously.”

A major step change –and the future’s bright

“Microsoft Azure has allowed us to build a product that we can put in front of some of the biggest distributors around, such as banks, FX brokers and accounting firms. The functionality we’re showing them is something they haven’t seen before, so it takes us to the next level. From a selling point of view, it’s really powerful – and I can’t say enough nice things about the amount of support Microsoft continue to give us.”

“Microsoft people are always happy to listen, and nudge us in the right direction. So we look forward to continuing to tie into emerging technology and adopt what we need to innovate as Hedgebook grows.”

Page 1 of 2712345...1020...Last »