Remember me

Register  |   Lost password?

The Trading Mesh

Why The OTC Markets Need a New Approach to Software Development

Tue, 25 Aug 2015 07:59:11 GMT           

As regulatory initiatives around the world drive today’s Over-the Counter (OTC) markets towards an ever more connected, more electronic trading model, firms operating in the space are having to rapidly adapt and evolve.


One of the net results of this evolution is that fundamental shifts are now taking place in how technology is utilised, requiring new approaches to software development.


As a specialist provider of OTC trading solutions, Baymarkets identified very quickly that we needed to adopt a technology development platform that would enable us to be continually responsive, helping our clients to adapt to changing market requirements and to remain competitive. To enable us to deliver software quickly and accurately, and to maximise our productivity, we chose Scala.



Removing Complexity


We started out around 2007 by successfully building the initial version of our product on a traditional Java-based stack with Spring and Hibernate. However, looking at our existing code base we saw that there was a need to simplify the architecture and to tame the complexity. These “technical debt “ issues, commonplace in software engineering, were holding us back in delivering new features and functionality to our clients at the critical pace we needed to maintain. We had to come up with something that could break us free from this complexity, so we explored various different programming languages to find the one that could provide us with the necessary tools to get back on track. 



Functional Programming


We quickly recognized that adopting functional programming constructs and ideas would be most beneficial, because it would give us new ways of structuring and reasoning about code, in particular when building highly concurrent and distributed systems. Even though functional programming (which has its foundations in mathematics and has often been seen as an academic playground by developers) is very different from object-oriented and imperative programming, it still contains concepts that allow developers to more accurately express the intent of ideas, thereby reducing much of the cognitive friction that is involved in between formulating a solution and writing it down. Raising the level of abstraction in this way allows for grater focus on the actual problem at hand, rather than the intricacies of trying to instruct the computer to understand one’s intent. 





Following an evaluation process, we decided upon Scala, the programming language used by Linkedin, Twitter and Netflix, amongst others. There are a number of functional programming languages to choose from, so why did we pick Scala? One of the key reasons is because it is a JVM-based language that is still fully interoperable with Java. The JVM is a well-tuned marvel of engineering that has been battle-proven over many years. It therefore made sense to build a new language on top of the JVM. And having full interoperability with Java also meant that our existing codebase could co-exist with Scala. 


Learning Scala can be challenging, since it is based on a different paradigm than that of object-oriented and imperative programming languages such as C, C++ and Java (among many others). However, Scala is a not a purely functional language, which means that you can gradually learn Scala and make the move to functional programming at your own pace. This was a critical factor for us, as we needed a path for making the transition without jeopardising our existing codebase. 





Since originally adopting Scala, we have rewritten and refactored much of our code, reducing our total lines of code by approximately half while still introducing many new features into the system. Our level of productivity has increased significantly and we also seeing less bugs being introduced because the code is now expressed more clearly in a functional way. Expressing complex algorithms, which is an important part of building OTC trading and clearing systems, has also become easier because you can more accurately prove that the code is correct with a functional mindset. Perhaps more importantly, the motivation for our team to grow and learn as developers has also been a big factor in this success. Scala is a language that attracts Java developers who want to take the next step in their profession and is therefore very useful when we seek new developers. It is safe to say that none of us will now go back to the old ways of thinking about code!





The journey has not always been an easy one but it has been well worth it. The real benefit to is that as the OTC market continues to evolve, our customers’ trading platform is also able to rapidly evolve to meet these requirements quickly and efficiently. No longer do they have to go through the more traditional time consuming upgrade process that still impedes much of the industry.


, , , , , , ,