Building an OpenBB App with Databento's CME futures data

Author portrait of Darren Lee, Guest Author Darren Lee, Guest Author
September 30, 2025
Title picture for Building an OpenBB App with Databento's CME futures data

This guest blog was written by Darren Lee, Community Manager at OpenBB. OpenBB enables financial institutions to build custom AI-powered analytics applications that integrate proprietary data with AI agents, giving organizations complete control over their workflows while maintaining enterprise security standards.

In this guide, Darren demonstrates how to integrate CME Globex futures data from Databento into an OpenBB Workspace application. He walks through the process of connecting to the historical API, building an instrument catalog, requesting OHLCV data, setting up a database, and powering visualizations with TradingView and other widgets. The result is a flexible, production-ready environment for analyzing futures data with AI-assisted tools.

Something I enjoy doing is exploring a new dataset. Each one brings its own unique challenges, from the initial request to parsing raw data and finally presenting the results. By the end, you really get to know the data and its API.

Working with Databento makes it easier to get started because many of these hurdles have already been addressed. Their purpose-built, open-source client takes care of authorization and request handling, so you can skip the setup and dive straight into the data. That’s what I did with this dataset.

My goal was to build a demo OpenBB Workspace application—the analysis and visualization layer—using Databento's real-time and historical data on liquid futures contracts traded across the CME Group’s four exchanges.

Databento demo futures dashboard 8fb45ec82c png

OpenBB provides a flexible UI layer and infrastructure for AI-assisted data analysis. With a generous free tier, you can seamlessly integrate your existing data sources, private APIs, or internal systems into the OpenBB Workspace. Teams can build custom applications using production-ready visualizations like AG Grid, TradingView, and Plotly, creating unified interfaces that connect your data ecosystem to AI capabilities.

2 databento openbb ec99cde9ce png

In order to build this OpenBB application, we'll need to gather all the data required and structure it in a way that allows it to be served to the app.

The first task is to create an instrument catalog, which will serve as the metadata layer our app uses to power the TradingView UDF symbol lookup and dropdown menus.

Databento offers a quick way to access all listed instruments on CME Globex. Using the Python historical client, we request definition data from the CME Globex MDP 3.0 dataset (dataset ID: GLBX.MDP3) for point-in-time updates across all symbols. This provides reference information like the asset (product root symbol), the raw symbol, instrument ID, expiration, contract size, and more. A complete list of fields can be found in Databento's documentation.

While these instrument definitions are available as a time series, we only need the latest record per instrument to build a current catalog. The code snippet below demonstrates this process.

from datetime import datetime, timedelta, timezone
import databento as db

client = db.Historical("YOUR_API_KEY")
start_date = (datetime.now(tz=timezone.utc) - timedelta(days=1)).date()

# Get instrument definitions for all CME symbols
data = client.timeseries.get_range(
  dataset="GLBX.MDP3",
  schema="definition",
  symbols="ALL_SYMBOLS",
  start=start_date
)
all_symbols = data.to_df().reset_index(drop=True)

To improve readability, we can enrich the data with display names from CME's Quote Vendor Codes file and join them back to the catalog.

We merge the CME product names into the definitions DataFrame on the asset (the product root, e.g., YM) column to add an asset_name column for labels like "E-mini Dow Futures." This code can be found in metadata.py.

This first step typically completes in under thirty seconds and provides a catalog that serves as the source of truth for UDF symbol lookups, dropdown menus for widgets, and requests through the Databento client. Here’s an example for YM, which shows only the next two contract months for brevity. The catalog includes all listed expirations.

| raw_symbol          | YMM5                          | YMU5                          |
| ------------------- | ----------------------------- | ----------------------------- |
| asset_name          | E-mini Dow Futures - 2025-06  | E-mini Dow Futures - 2025-09  |
| unit_of_measure     | IPNT                          | IPNT                          |
| unit_of_measure_qty | 5.0                           | 5.0                           |
| instrument_id       | 42003068                      | 42003287                      |
| expiration          | 2025-06-20 08:30:00-05:00     | 2025-09-19 08:30:00-05:00     |

We'll build a table of daily OHLCV candles by requesting the front-month with continuous contract symbology for each asset. We'll request this OHLCV data using Databento's historical API with the ohlcv-1d schema and stype_in value set as continuous. This functionality can be found in historical.py.

Mapping the OHLCV time series data to the instrument catalog ends up looking something like this:

| asset                    | ES                                       |
| asset_class              | Equity                                   |
| exchange                 | XCME                                     |
| exchange_name            | Chicago Mercantile Exchange              |
| contract_unit            | Index Points                             |
| contract_unit_multiplier | 50.0                                     |
| min_price_increment      | 0.25                                     |
| name                     | E-mini S&P 500 Futures - 1st Contract    |
| currency                 | USD                                      |
| symbol                   | ES.c.0                                   |
| open                     | 6018.75                                  |
| high                     | 6051.25                                  |
| low                      | 5987.75                                  |
| close                    | 6014.5                                   |
| volume                   | 1143708                                  |

The repo’s database.py file defines the tables the app reads from. Keeping everything in one place makes the UDF routes simple and predictable. We’ll now see these tables:

  • futures_symbols — instrument catalog
  • asset_names — CME product names for readability
  • ohlcv_1d_continuous — daily OHLCV

We can populate the database one continuous contract at a time using the helper in CmeDatabase. It loads the front month contract by default, but additional contracts can be added if needed.

# Build the local database with OHLCV candles
from openbb_databento.utils.database import CmeDatabase

db = CmeDatabase()

# Quick start: daily front month for all supported assets (start=2013-01-01)
db.download_historical_continuous()

# Add more coverage (run these as needed)
## Second/third contracts
db.download_historical_continuous(contract=1)  # .c.1 
db.download_historical_continuous(contract=2)  # .c.2

# Limit symbols or date range for a faster pass
db.download_historical_continuous(symbols=["ES", "NQ", "YM"], start_date="2024-01-01")

TradingView charts in the OpenBB Workspace use the standard UDF API. When you run the app, a FastAPI service exposes /udf/config, /udf/symbols, /udf/search, and /udf/history. Those endpoints read from the database you just built, map fields to the UDF keys, process dates as Unix timestamps, and return data for each candle.

3 databento openbb f7b74868a2 png

You can run this application by downloading the code from the OpenBB Workspace example library here. Follow the instructions in the README.md file to install, authenticate, create a database, launch, and open the application.

Take the code and make it yours. It's meant to be extended in whatever direction your workflow needs.

5 databento openbb 9e333f6fac png