DEV Community

Jian
Jian

Posted on

#014 | Standardising a multi-currency portfolio: Discovery

Overview

Having built and tested the Extract, Transforms & Load ("ETL") logic to process the Custodian Statement PDF and yfinance datasets, the building blocks to standardise a multi-currency portfolio to a common Base Currency are now in place.

To recap, the two datasets serve the following purposes:

  1. Custodian Statement PDFs: A portfolio's month-end Securities, Funds, Cash and Miscellaneous ("Security Types") holdings

  2. yfinance: Month-end foreign exchange rates ("FX rates") for selected Target Currencies relative to one Base Currency

The following flowchart visualises the end goal of this part of the MVP:

Endgoal

Portfolio Currency Standardisation Logic

The following logic is implemented to each Security Type:

  1. Aggregate and sum month-end values by currency

  2. Apply a mathematical formula to convert the summed data to a Base Currency. For example, US$1,000 / 0.25 (USD/MYR rate) = MYR4,000

The values from (2) are then summed to get the Portfolio NAV, which is now standardised to a common Base Currency.

This standardised Portfolio NAV paves the way for other MVP requirements to be fulfilled, such as calculating the Management Fee & Performance Fee.

The currency standardisation logic can be built via the Xano user interface. It helps that all the data is already sitting in the same platform.

As there is some repetitive logic, Xano's Custom Functions
can be leveraged to make it (the logic) reusable, much like a Python function.

Building a Custom Function is fairly straightforward. The challenge comes from ensuring the standardisation logic is correctly applied to the right data.

--Ends

Top comments (0)