This repository contains a demo implementation of Real-Time Synchronised Settlement, as proposed in our submission to the ISO 20022 Hackathon hosted by the BIS Innovation Hub and SWIFT.
The demo simulates an incoming stream of PvP settlement requests in the form of ISO 20022 Foreign Exchange Trade Instruction (fxtr.014) messages and atomically settles them via mock ISO 20022 communication with the relevant liquidity pool (e.g. a central bank) to reserve the necessary liquidity from the delivery agents before instructing the actual payments.
View our solution at atomicwire.io/hackathon:
Note: Java 8 or Java 11 is required to run the demo.
There are two built-in options for running the demo locally.
For a simple demonstration, simulating at a rate of 1 settlement request per second and with message tracing enabled, run:
$ ./gradlew :run
And to run the simulation at the maximum rate with message tracing disabled, run:
$ ./gradlew :runUnlimited
On Windows, substitute ./gradlew.bat
as the command.
This demo is implemented as a stream processing application using Apache Flink, a high- performance and high-scale framework for developing streaming applications with consistency guarantees on the JVM. Please see the Apache Flink documentation for an introduction to its concepts.
Our demo application is implemented five stages, which are wired together in the application entrypoint, AtomicSettlement.
- Map the incoming logical ISO 20022 messages to their conceptual representation, then split out both Payment Obligations that constitute the transaction
- Collect the Payment Obligations by currency and delivery agent, send a liquidity reservation to the relevant liquidity pool, and await the response
- See ReserveLiquidity
- Join the liquidity reservations back to the original transaction, then split out the Payment Obligations again
- Instruct the payment for each leg independently and await the response
- Join the payment confirmations and emit the logical message indicating its success
Additionally, there are a handful of other packages containing supporting code:
context
contains the data classes used to move data throughout the applicationgenerator
contains code to simulate the incoming settlement requestsiso20022.logical
contains mock representations of the mock ISO 20022 logical messages used by the applicationiso20022.conceptual
contains mock representations of the mock ISO 20022 conceptual layer entities used by the applicationiso20022.bridge
contains code for deriving ISO 20022 conceptual entities from logical messages
To run in an IDE of your choice, you must install the Lombok plugin and enable annotation processing.
Copyright (c) 2021 Atomic Wire Technology Limited
All rights reserved.
Licensed under the Apache License, Version 2.0, found in the LICENSE file in the root directory of this repository.