Real-Time Market Insights — Powering Optiver’s Live Trading Dashboard with Databricks Apps and Dash
Summary
- Optiver's high-frequency trading infrastructure: Databricks Structured Streaming processes vast financial data streams with low-latency performance, enabling real-time market analysis and instant trading decisions.
- Dash integration for rapid development: Databricks apps combined with Dash empowered traders to build and deploy custom dashboards without heavy developer dependencies.
- Market-making execution architecture: Global liquidity provisioning requires detecting market patterns and responding instantly, a capability powered by Databricks' scalable streaming architecture.
Real-Time Market Insights — Powering Optiver’s Live Trading Dashboard with Databricks Apps and Dash

Talk by Huy Nguyen, Software Engineer, Optiver
In the fast-paced world of trading, real-time insights are critical for making informed decisions. This presentation explores how Optiver, a leading high-frequency trading firm, harnesses Databricks apps to power its live trading dashboards. The technology enables traders to analyze market data, detect patterns and respond instantly. In this talk, we will showcase how our system leverages Databricks’ scalable infrastructures such as Structured Streaming to efficiently handle vast streams of financial data while ensuring low-latency performance. In addition, we will show how the integration of Databricks apps with Dash has empowered traders to rapidly develop and deploy custom dashboards, minimizing dependency on developers. Attendees will gain insights into our architecture, data processing techniques and lessons learned in integrating Databricks apps with Dash in order to drive rapid, data-driven trading decisions.
Intelligent analytics for everyone: https://www.databricks.com/product/business-intelligence
BI meets AI: https://www.databricks.com/resources/ebook/business-intelligence-meets-ai
Explore the only unified platform for agent systems: https://www.databricks.com/product/artificial-intelligence
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements
Chapters
0:00Introduction0:48What is Optiver4:38Dashboard Journey9:55Optimizations16:14Dash App17:04Databricks Apps19:26Dash21:48Why Dash29:03Dashboard Optimization33:31Data Engineering Innovation
FAQs
How does Optiver handle real-time market data at scale?
Optiver leverages Databricks' Structured Streaming to efficiently process millions of market events while maintaining low-latency performance for time-critical trading decisions.
What is market making and why does it require real-time data?
Market makers continuously provide buy and sell prices to exchanges, regardless of market conditions—this requires instant analysis of market data to maintain liquidity and capitalize on opportunities.
How does Dash integration reduce development overhead?
By integrating Databricks apps with Dash, traders can rapidly prototype and deploy custom dashboards without waiting for developer resources, accelerating time-to-insight.
What data optimization techniques improved dashboard performance?
This video covers both ingestion-side optimizations for data pipeline efficiency and dashboard-side optimizations for rendering speed, enabling responsive trader experiences.
Full transcript
0:00 Introduction
Hello everybody. Thanks for coming. Uh today I'm going to talk about how we power opt market insights with data bricks apps. So I'm going to give you a bit of an overview of what I'm going to talk about today. First I'm going to give you guys a bit of about introduction about Optivos about who we are. Then I'm going to talk a bit about our dashboard journey and how we came about this project. Then I'm going to talk about various optimization techniques that we have done to uh improve user experience.
Uh first is on the injection side. Then after that is on the dashboard side. Uh before I continue uh raise your hand if you heard about Optiva before today. Oh wow. That's that's that's a lot more than I expected. Uh so for those who don't know about Optiva, if you go to our website, uh you will see that we are a high frequency electronic trading firms. We are a global liquidity and uh market makers. We trade in um various exchanges ac across the gloes and we also trade in various asset classes such as options, futures and ETF.
0:48 What is Optiver
So what is market makings? So so as a market makers we provide the buy and sell prices continuously to the exchange uh regardless of market condition. uh we're always uh willing to trade uh in all market condition. Uh if this still sound a bit abstract to you uh let me give you two examples. The first example is when the markets is very busy. Uh for example um for example during the US election where there's a lot of vitality in the market uh many market partition might want to pull out the markets because of the votality.
So this is uh we this is how we as market maker come in. Uh we always provide the buy and sell prices to helps uh the participants to make the trades. Another example is when the market is very quiet for example some instruments uh in some exchange might not get a lot of activity. uh in those situation the buy and the buyer and the sellers might not come into the exchange at the same time. So again this is where we as a market maker comes uh we provide the buy and the sale price to help uh this buy and sellers to make the trades.
So that is what market making is uh what does it take to be a successful market makers though. So for us data is very important uh because we need to make a lot of uh important decisions. Uh first we want to know uh which of our strategy is winning and by how much. Uh we also want to know where the next business opportunity is and we want to make sure that we are compliance in uh with all regulations. Because of this uh data bricks play a very crucial roles in our success.
We onboarded data bricks about a year ago and it has now grown into a pabyte scale data platform. We are also ingesting from more than 4,000 data sources in the form of CFKA topics or databases tables and with over 500 monthly active users is getting clear that data brick is widely adopted across the organization and we expect of these figures to grow by multiple times in the near future. So adoptiva data bricks play uh support key workflows across the organization.
It enables our quantitative researchers to perform analysis on complex data sets. It also powers large scale data processing with ease. It supports our machine learning developments and it helps teams to build dashboard for insights and decision making. And throughout this talk, I'm going to focus on the dashboarding aspect of this. So now I'm going to give you a brief uh a brief uh overview of our dashboard journey.
4:38 Dashboard Journey
Let me take you back about two years ago. At that time our d of our data was onrem. Uh all the data was scattered across different databases in multiple data centers across multiple countries. There was no centralized data platform and it make things really difficult. Not only that, most of the these databases were even analytical. They were transactional databases optimized for uh operation workflow but not for deriving insights.
Uh not only that uh there was friction everywhere especially from transitioning from research into productions. Here's how it used to look like. Our researchers would often prototype their code uh often in Pythons, but to go live the code needs often needs to be rewritten in C++ and that translation process slows down immensely. And if somebody wanted to build a new dashboard, they would need support from an engineer to visualize that either on the window apps or web apps.
So around the time our system wasn't built for speed or or iteration, everything felt very slow. Everything felt very hard. Fast forward one year when we onboarded data bricks and everything started to change. We saw what I like to call a dashboard revolution. There was an explosion in dashboard usage across the company. teams were suddenly building and sharing dashboard as if it was their second natures. And it wasn't just anecdotal we put a stats and it was clear that the usage of AI and BI dashboard has skyrocket.
Everybody was tapping into the data. And why is that? It was because access has finally become easy. This shift has led to the democratization of dashboarding. Now you no longer need a developer to build or maintain a dashboard. If you have a question, you can just explore the data and build your own insight. Even more impressively, thanks to Spark and data bricks, queries that were once thought to be impossible were now done by everybody.
However, with great success came growing pain. About eight months ago, we started to fill the cracks. Our dashboard was were no longer being used for research or analysis. They were now start being used for live use cases where latency and reliability really matters. We saw an overcrowding of our dashboard. Dashboard was refreshing constantly often within every seconds and this put a huge uh pressure on our infrastructures.
There was also a growing problem of uh versioning dashboard were changing very fast and often with our coordination and there was also a problem with the front end performance. As our dashboard grew more complex they need to render more data and our dashboard users starting to know notice slow loading time. So about six months ago, one of our trading desk approaches directly asking for help. Their use case has grown too complex for the O2.
They need something more robust. So we set sit down with them and we gather the requirements. So they told us that they needed a single digit uh seconds and to end latency. They also wanted a live refreshing sport. They also needed an easy way to go from research into production. didn't want to go back to the old world where everything needs to be reimplemented in C++. They also wanted fine access control to make sure that the right people was seeing the right data at the right time.
They also needed the ability to render a massive amount of data without compromising the front end experience. So uh so here's like an example of uh an end to end life cycle of our dashboard used to look like. So first our data producer would start publishing data into our CFKA clusters. From there we would have an ingestion pipeline that pull data from Kafka and write to delta tables. On the visualization side, research the researchers would use the AI and PI dashboard connecting to the SQL warehouse and quering the pulling the data from delta tables.
So we sit out and we realized that to achieve the SOA that the trading team asked for there were two main key area that we could optimize. The first part is on the injection side and the second part is on the visualization side. So I'm going to go a bit into detailed about the optimization that we have done on the injection side. So for the vast majority of our data, we have a C++ app that pull data from Kafka and lands arrow files into an S3 bucket.
9:55 Optimizations
From there we have an autoloader that incrementally load new files and write them into delta tables. The advantage of this design is that it's very efficient and very cost effective. However, the original purpose of this pipeline was to optimize for throughput rather than for latency. So so for very highly valuable data set especially the ones that the researchers last board relies on. Uh we instead build a more streamlined pipeline where a structure streaming jobs would read directly from Kafka did this would remove many steps along the way to get the data into data bricks as fast as possible and thanks to the data frame interface from data bricks not much logic was actually needed to change.
We mostly needed to switch the data source from S3 to Kafka and the rest would remains mostly the same. We also invest uh a lot of time to optimize uh spark configurations. Uh one of the first change we make is to uh increase the the partition values. Uh so by default spark would map each cafka topics partition to one spark partition. So if you have a very large spark cluster there's a good chance that the cluster is going to be underutilized.
So by increasing this mean partition value spark would provision most uh task to read from these cafka topics partitions. So thanks to the increased parallelism, this significantly improved our throughput and latency. Uh another optimization that we did is to increase the amount of data pool per fetch. What I mean by this is by default spark would pull a relatively small amount of data per fetch. However, for in for a use case where there's a relatively high latency between our Spark cluster and our Kafka cluster, uh these small fetches mean uh there means too many round trip, too much overhead and underutilized micro batches.
So we decided to increase both of these value to about 10 megabytes. Uh this allows Spark to pull larger chunks of data in each microbatch. uh we also decided to disable optimize right when latency is very important. So for those who are not familiar by default data bricks enable this optimize write feature which tries to compact the data before they write to delta table. So the purpose of this is to help with file management and downstream read performance.
However, for our use case, uh this behavior introduced extra surface steps and coordination between the executives and this slow down our right time and fortunately uh we didn't actually have to make the trade-off between right latency and read performance. Uh because when you use structure streaming with data bricks, data bricks enable auto compaction by default. this feature uh would try to compact uh the all the small files when the cluster is less busy.
So thanks to this feature we were both to keep the best of both world. So we managed to keep to get to keep low latency and very good uh uh read performance. Uh we also decided to reduce the suffer partition in spark. Uh so so what I means by this is by default uh spark set this sub for partition values to 200 but in streaming or small batch workloads that's that's far too high for us. So this leads to unnecessary start scheduling, excessive overhead and longer processing time per batch.
For our use case, all we notice that all these surface stages were actually from Spark reading the delta transaction logs. Because of this, we we know for sure that these tasks are very light and we confidence of uh reducing this mean partition values. And as you can see here the cluster become a lot less busy like all of this activity were just from all the overhead of scheduling this uh unnecessary task. Uh last but not least we also reduce the structure streaming uh locks versions.
So by default, Spark maintains uh the metadata and logs for the last uh 100 microbatches uh when using structure streaming. Uh the downside of this is over time especially for long running jobs. Uh this can lead to bloated checkpoints directory and degraded performance. Uh by reducing this number uh the number of microbatch locks this would reduce the number of microbatch locks keep in memory and disk. So from our all of our effort to rearchitecturing and this parameter optimization, we were able to reduce our injection latency from singledigit minutes to single digit uh seconds latency.
16:14 Dash App
Uh however uh in order to achieve this kind of S SOA from the trading teams optimizing the injection wasn't enough. We also need to optimize on the dashboard side as well. Because of this uh we decided to react reerform some rearchitecturing of our live dashboard. So at the core we build a custom dash app powered by flask hosted entirely on data bricks apps. So this give us full flexibility. This means no extra infrastructure to manage.
The dash app would connect directly to the data bricks warehouse. It would pull and pull in the data and serve visualizations. Uh so I appreciate that uh data bricks apps and dash might not be uh familiar with uh everybody here. So I'm going to just give a bit of a an overview some context of what they are. So datab bricks app is a new feature from datab bricks. It allow users to create uh apps uh on data bricks. Uh the kind of like the purpose of this is uh if you can if you are able to run your own Python app locally uh databicks would make it very easy to deploy it uh to production uh without too much effort and they would run exactly the same way.
17:04 Databricks Apps
So they would take care of all the infrastructure and uh deployment overhead for you. So this technology is mainly uh built for dashboarding and uh ML tools. Uh specifically for Optivus uh there were many benefits. First of all is uh everything is hosted on the cloud. This means that we were able to get both high throughput and latency when quering the data. Uh it also allow us to avoid the eress cost when transferring data to outside AWS.
Uh it is also very easy to use. It al only takes a few command lines and about 30 seconds to deploy your apps from uh local to productions. Uh and most importantly it has a good um built-in access control. Uh first of all you can control the access on the apps level. Uh just like how you would control like who can access your notebooks or your data brick jobs and so on. But more importantly, it respect Unity catalog permission uh by default.
So this is very important for us at Optiviver. So at Optiviver, we heavily use row filter when most users can only see a subset of our data uh due to compliance reason. Uh so with this uh feature by data bricks apps, everything would just work by default. uh if somebody want to see a visualization they would only see the visualization of the subset of data they have access to. Uh next is dash. So, Dash is a Python framework uh for building visualization and uh they were developed by plotly and uh the main usage of this is to help users to build dashboard uh and it provide a lot of rich visualization uh in the front end and like one advantage of that is that uh you only ever need to know Python no JavaScript uh knowledge really required. for Optivos uh it has a lot of benefits for us.
19:26 Dash
Uh at Optiviver is starting to become a standard uh technology to build a front-end uh web-based visualization. Uh it also allow us to render a lot of data through its GPU rendering. uh it's when we I try I try it on is uh like 10 to 100 time faster when uh compared to rendering uh with our GPU and it also support the data frame interchange protocol when we can plug and play with various data frame uh libraries behind the scene and I'm going to talk more about this point uh later on.
Back to the original high level design. Uh we will also consider some alternative solution. Uh when building this project, we were asking ourself uh is it better if we query everything directly from this data brick warehouse like in the top diagram or should we stream and pre-agregate everything first? What I mean by this is in the bottom diagram we would stream the data in perform incremental aggregation and write the pre-processed results into a delta table.
From there the dashboard would query a very lightweight already pre-agregated tables. Uh however at the end we actually decided to go with the first option which is seemingly more naive and let me explain to you why. So there were two main reason for this. The first reason is user friendliness. One of our main goal for this project is to helps users to self-service. So having an SQL as an interface is a lot easier for our traders and researchers to adopts uh compared to have asking them to manage a few and structure streaming pipelines.
21:48 Why Dash
It also very easy to modify stuff on the fly. So if our traders want to change their signals uh with SQL they only need to update the logics. But if it's structure streaming, they would have to redeploy the pipeline and back fill everything from the beginning which is very slow and lots of friction and it can handle unpredictable parameters as well. What I mean by this is a lot of our SQL logics takes in parameters uh from front end inputs.
So because of this parameter is very unpredictable. Uh having them in being interpolated within SQL is a lot easier than trying to anticipate uh this value in streaming. And another kind of counter intuitive reason is it's actually for use cases it's actually faster to reexecute this SQL query again and again compared to incrementally process them. So there are a few main reason. The first is it allow us to avoid um per performance issues with structure streaming uh with state management.
So we have seen this again and again when we scale structures string very large when we need to do straight stateful joins across many many big tables for example five or six tables with about 100 uh rows per second 100,000 rows per second. This is when the circus mean store start to breaks down and it's actually slow things down. Uh scaling is it the easiness to scale is another main big advantage. So uh for example when the market become very busy and we get we get a lot of data uh be thanks to the serless uh warehouse uh it only takes a few second for data bricks to add a few nodes to our cluster.
This kind of like uh uh allows to avoid all the headaches to that we don't need to anticipate the load or the capacity of our cluster which is very nice. Data caching is another big advantage for those who are not familiar uh with data bricks. When data bricks query a a data set from delta uh data brick was cache the underlying park files on disk for us it works very nicely because most of our data sets are time series append only data.
So if we need to re re-execute our query every x second, the cluster actually only need to load the extra x second worth of data and the rest of them is already cached on disk. So in practice basically the entire table only need to be loaded once for the tie day and photon is actually one of the biggest reason that make uh our dashboard feasible to meet this latency thanks to its very efficient execution engine and very efficient query optimizer.
It's allow it's it's allow our query to execute several time faster compared to open source spark. Let me give you an example uh of what I means. So we have seen uh this kind of behavior again and again for our use cases. So in this example we have two large data set data set A and B both are about 100 million rows. Uh however the filter that you see at the bottom here would eliminate about 90% of the data from data set A.
Data set A has no filter on it but it is still part of the joins. So in intuitively you would expect this query to be very slow because the query engine need to scan and suffer the entire data set be info because technically there's no direct filter on it. However, data bricks analyze the entire query plans and notice that the filter on data set B eliminate most of it data. Therefore, the join will only touch a small set of data on data set B.
So instead of scanning and surfing the entire T of data set B, Photon actually injects an implicit filter on it based on what it knows of what is needed uh after the joints. So on the right hand side here you can see it in actions. The filter in the in the red circle has been pushed down on the data set B even though we didn't explicitly ask for it. So thanks to this this means that there's less data suffer there's faster joins and there's much more efficient query plan and we didn't need to change a single line in our SQL query.
Let's take a closer look on how it works behind the scene. So at the core of this optimization is something called a bloom filter. So it's a compact data structure that allows Spark and Photon to quickly estimate whether a record would match without actually needing to suffer to do the full joins. So, so what how it works is photon uh adaptive query optimizer would use the runtime start to figure out whether the query would save time and the query optimizer would only applies only if one of one side of the join is very small and selective.
This this allow us to avoid suffling unnecessary data which in this kind of distributed query engine would compose the majority of the time span. First this allow us to increase the query performance by multiple times. So if you want to go a bit deeper in this topics the team behind photon actually published a great research paper here uh which explain the inner working of how this works. So if you uh look it up on the internet on the title of this uh adaptive and robust query execution for like house scale uh you'll be able to see uh how it works in detail.
29:03 Dashboard Optimization
Uh next I'm going to talk about several uh optimization on the dashboard side as well. So as we work on this project uh we know that there's a few problem that we need to solve. First of all, we need to find a way to easily manage our growing number of dashboard. Uh as time goes, the number of dashboard that we needs to be managing grow to about several hundreds. We also want to find need to find a way to for researchers and traders to easily modify it as well.
And we need to find a way to reuse SQL queries because uh dashboard overcrowding was becoming kind of a big problem. So to solve this dashboard sparing problem, we built something called a dashboard generator. So it's a tool that turn modular config into a fully interactive dashboard. So on the left here uh we have two components. First is a tommo file that define first the inputs like date or sampling rate and then uh the definition of the graphs that need to hand to renders for example their query key the layout color groupings etc. or in a declarative way.
We also have an SQL file that define the actual query logics which is parameized and reused across multiple dashboard. So together these two fit into our dashboard generator which produce an input form with sensible defaults a set of standardized visualization a live interaction through a callback layer connecting to the data brick SQL warehouse. Uh this design brings several benefits. First, the dashboard are modular and easy to maintain.
SQL logics are now being reused and not not duplicated and dashboard chains are now being made in config instead of in code which is very more accessible to our researchers. Uh as mentioned before uh one of the problem we faced previously was a dash uh dashboard overcrowding problem. This happens when multiple users triggering the same heavy SQL query. So at that time our data bricks warehouse would end up being overloaded because they need to reexecute the same logics again and again.
So to solve this dashboard overcrowding problem, we introduce a lock and cache mechanism. Here's how it works. So when we have multiple users needing to access uh needing to hit the dashboard at the same time, they are all trying to trigger the same query. However, instead of letting off the quer of the requests go straight to the warehouse, the apps would instead first check a disbase cache. If the result is still fresh, maybe within a certain set of TTL, it would we would surf it immediately.
If not though, the app would try to acquire lock. Only one of these require requests would go through that one claim the locks and run the query. And once that's finished, it's going to write the result to the cache. What about the rest? the rest of the request they will wait eventually they will get served from the cache when the cache is updated. So the benefit of this pattern is that it reduce the run the redundance queries.
It prevents the warehouse uh overloading issues and it's dramatically improve our dashboard responsiveness when there's a lot of concurrent users. Uh I also want to highlight some of the recent innovations in this uh uh data engineering space that allowed this dashboard to work really well. Uh so the first uh is uh a recent features from the data brick warehouse called cloud fetch. It would allow us to stream very large query result efficiently with high bandwidth and low latency.
33:31 Data Engineering Innovation
Uh polas is another recent innovation. Uh it's a new data frame library that can handle transformation with zero copy rate. This allow to reshape and filter the data with our memory duplication. Dash recently also integrated with a library called now. So now give us an abstraction over different underlying data frame library. Up until this change, if you pass in a data frame, any kind of data frame to dash, dash would actually convert that into a pandas data frame and then it would render the visualization.
Now, thanks to this recent improvement, uh tools like dash no longer strictly relies on pandas. This this means that we can plug in polarize instead for faster uh transformation performance and lower memory usage. And tying this all together is aperture arrow. It's a standardized columnware format that makes this component interoperable by design. So here's how it comes together. So first we have the data brick SQL warehouse using cloudfatch to send large query result directly to S3 and then we would stream this result directly to the disc cache that I mentioned before.
From there we would load the data into polas using zero copy rate for speed and efficiency. Then thanks to now we can plug polas directly to dash and now no longer conversion to pandas is needed. The result is that we have a fast and fluid dashboard the scale from the back end to the front end. And this whole workflow works because of the shared column format powered by the aperture arrow. This enables seamless performance across our stacks.
So as the result thanks to our optimization both on the inration side and the dashboard side we were able to we were able to reduce the latency from single digit second uh single digit minutes to single digit seconds and traders now can see data faster and reacts uh to the market trends more efficiently. It also allow us to free up developer developer time. So now they can spend more time to work on other initiative.
And we we have been receiving overwhelmingly positive feedback from our traders and researchers. And if any of the things that I describe sounds very interesting for you, uh we are actually hiring for a great software and data engineers. Uh so if you like to work on pabyte scale data platform and low latency data pipeline uh feel free to reach reach out to me or visit our uh career page and thank you for the talk and let me know if you have any Awesome.
Learn more about the Databricks Data and AI platform.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.