On-Demand Webinar
TCA & Market Structure Analysis with MCP
In this workshop, Peter Simpson demonstrates how to accelerate the build of TCA and Market Structure Analysis by leveraging the OneTick Cloud Market Data on Demand service, including its MCP, through Claude Code, Cursor, and VS Code / GitHub CoPilot.
This session is designed for financial professionals interested in learning how MCP & AI Agents can accelerate quantitative analytics development by providing continuous support assistance.
Introduction to OneTick Cloud
OneTick Cloud is a high-quality, on-demand managed time-series data and analytics platform that provides instant, global, AI-ready market data, seamlessly fueling compute and analytics engines.
AI-Ready Market Data
Quants and AI teams spend 70 to 80% of their time cleaning feeds, mapping symbols, and aligning timestamps to prepare their market data for analytics. This is the Data Tax – the single biggest obstacle to agentic AI in capital markets today, and there is no short cut.
AI-readiness is crucial to avoid hallucinations and costly mistakes. Let’s say symbols aren’t reconciled across venues. The timestamps drift. A corporate action creates a phantom 75 percent crash. The backtest leaks future information. The agent confidently produces an answer the desk cannot trust, and the program stalls.
The model here is not the problem. It's the market data – it must be temporal, point-in-time, and AI-ready.
Benefits of a Managed Data Service
OneTick Cloud offers a single vendor end-to-end solution, significantly reducing the time to value. KX and OneTick are the only vendor delivering AI-ready, hydrated, temporal market data as a managed service. Our data is pre-normalized across 250+ venues and 30+ years of history, point-in-time with no look-ahead bias, machine-readable from day one, and fed natively into Python, SQL, and KDB-X.
Save time, money, and resources by letting the KX OneTick team clean feeds, map symbols, and align timestamps so your quants, analysts, and AI models can do their work.
Natural Language Processing Examples
The OneTick Cloud MCP is a support assistant for querying OneTick Cloud in both SQL and Python. Similar to the SQL and Python Documentation, and Examples Dashboards, you can enter a natural language question, and receive example code in response.
Common questions include:
- How do I calculate VWAP?
- How do I calculate TWAP?
- How do I calculate 1 minute bars?
- How do I retrieve bars?
- How do I retrieve corporate action adjusted prices?
- How do I apply a filter?
- How do I filter for specific hours?
Webinar Description
In this workshop, Peter Simpson demonstrates how to accelerate the build of TCA and Market Structure Analysis by leveraging the OneTick Cloud Market Data on Demand service, including its MCP, through Claude Code, Cursor, and VS Code / GitHub CoPilot.
Topics Include:
OneTick Cloud Datasets
- L1 through to L3
- Real Time, Intraday and Historic
- Global Equities, Futures, Spreads & Options
MCP & AI Assistance
- MCP Configuration in IDEs
- Immediate Support Assistance
- Market Data Coverage Understanding
Trading Analytics through SQL & Python
- SQL & Python Code Generation
- Natural Language Query Construction & Enhancement
- Correcting Existing Code
This session is designed for financial professionals interested in learning how MCP & AI Agents can accelerate quantitative analytics development by providing continuous support assistance.
Watch the Recording:
Webinar Transcript
Hello, and welcome to today's webinar. I'm Peter Simpson.
For today's workshop, we'll focus on the OneTick Cloud MCP service, and specifically how it can accelerate the writing of trading analytics whether focused on TCA or market structure for example.
The MCP service isn't a layer on top of our existing REST endpoints. It enables a support assistant that both understands syntax and coverage.
And by syntax, I mean how to write OneTick's SQL and Python queries, specifically SQL and Python designed to write trading analytics.
And by coverage, mean information on venues, databases, tables, schemas, and field enumerations. Now together, they accelerate analytics production. I'll set the contacts first, and then we'll dive into MCP usage.
Now OneTick cloud provides historical and real time market data as a service. We do all the data on boarding, management, infrastructure, storage. You can focus on the analytics.
Now our coverage consists of pretty much every equity, futures, spreads, and options market globally.
With the level one data through to level three book depth.
Additionally, for regions with fragmented liquidity, we create consolidated datasets.
Some of those were consolidating only a few markets. Others, Europe, were consolidating one hundred and sixty nine MICs across twenty one different countries.
We went back to the equity markets we can see this just keeps going on and on and on.
And the same goes for the derivative markets.
Let's log in to the service.
I've already authenticated, so I go straight into my profile page.
Center top are instructions for connecting to the MCP server, plus examples on querying with SQL and Python, r s endpoints for data analytics, plus for those that want it, how to retrieve Parquet from r s three bucket.
Now before we jump into MCP, I want to show the universe we're talking about.
Now as we saw briefly before, there are well over two hundred datasets across equities, ETFs, features, spreads, options, crypto, and FX reference pricing.
For each dataset, we're storing every symbol, so that's any kind of thirteen thousand symbols for US equities.
And we're storing all of the tick data together with derived AI feature sets. So each dataset has a series of databases. Each database has a set of tables.
Let's click on the trade table.
Each table has a set of fields, which we can see on the right hand side. Some of these fields, where I can see trade period, have a set of enumerations.
And I can see these enumerations here. So let's go down to trade period and see the possible values.
So if an exchange provides the data for a field, we'll make that available.
So in the case of trade type, that will be unique to each exchange. Now to allow querying across venues, we provide some standardized fields like trade period and book type.
For trade period, these are standardized across venues. We can see different trading sessions.
Book type will tell us the type of book we're on. So are we on the lit book during continuous trading, for example?
Or are we kind of off exchange or off book?
Now we also have public SQL and Python documentation and examples in both are available here.
And our documentation associate examples grow continuously based on customer feedback, and these become central to our MCP service, which provides an AI query assistant. Now you can access the same service in this example dashboard by just entering text into the AI query assistant box at the top.
So now we've seen the context, let's jump to MCP.
Released our connection instructions. Our MCP server is available at onetick.com/onetick-cloud/mcp.
And we've provided instructions for different IDEs and AI assistance, whether that's Versus Code, Cursor, PyCharm, or Claude, Cursor, Junie, GitHub Copilot for the AI assistants.
Now today, I'll focus on Versus Code and the Claude Code plug in.
So that's saying to add this line.
I'll copy that line.
And I'll go into my Versus code.
Call code is running.
Let's paste the line.
Yep. I want to add it.
Okay. It says it's added.
It says it needs authentication as we require authorization. If I go MCP service, I don't see it here yet.
Let's try MCP servers again.
Okay. Now it says it's loading. So it's connecting.
Let's try that again.
Seems Claude takes a little time to warm up.
And I've got it.
Click on the link.
Now I need to authenticate.
That will bounce me.
I can configure trusted domains, but I'll just open for now.
I'll open up my web browser, bounce me to the cloud login, where I'll say, yep, I want to accept access.
Authentication was successful, so I can close this tab back down and go back to Claude. Now I can see I'm connected and have a set of tools available.
Okay. So now I have my MCP configured. I can start with my prompts. So let's ask some questions.
First, let's say, how do I calculate T WAP?
Let's run that. And I'm not telling Claude to use the MCP server, so it's just thinking.
And it's going to go out to the Internet or go out to all the information that Claude knows.
Actually, this time it's actually chosen to use our documentation. And it came back with the correct answer.
Let's try this again.
This time, I'll specifically say that I want to use the MCP server and also whether I want my output syntax to be SQL or Python.
So I'll choose SQL.
So using MCP, how do I calculate TWAP in SQL?
Let's try that.
This time is going to the search SQL docs tool, finds that TWAP is available, and then comes back with a couple of examples.
Whether I'm looking across a period, grouping by exchange, having a rolling aggregate of TWAP, or I'm bucketing by a particular period.
That was SQL. Let's create a new session and try the same in Python.
This time, rather than TWAP, let's try VWAP. So using MCP, how do I calculate VWAP in Python?
That connects up.
Inserting our Python examples and Python docs, coming back that we have an aggregate called VWAP, and then it's coming back with an example.
In this case, a set of examples, again, depending on what you want to do.
Is it across the whole period? We're just defining our aggregate VWAP. Are we creating a bucket every sixty seconds?
Or are we creating a rolling aggregate?
Or are we trying to calculate the VWAP bid and ask we're trading through an order book, which is slightly different?
So when the questions are vague, there'll be possible answers here.
So that was some syntax questions. Let's say we, at OneTick, are storing all of our data as unadjusted time series, so as it was provided.
Let's say I want to return the adjusted data adjusted for corporate actions.
And I want to return know how to do that in SQL.
Now I know if I was just querying base data and doing everything in SQL manually, that would be a horrible query.
I'd have to pull adjustment factors back.
I'd have to calculate those, and then join those up.
Now in OneTick we have a corporate actions function.
You can see the definition of the function here and then we can see examples.
In this case, I'm pulling back the closing price, our US comp sample for Walmart.
I've got the original close and the adjusted close for corporate actions.
And I can see more examples how to do the adjustments.
So everything so far has been syntax based. Let's take this a step further, where we see I got a query that's not running. It's incorrect. I don't know why.
So let's see if I can ask the MCP server to help.
Okay. Using MCP, what's wrong with the following query?
I got my first price, my maximum price, my minimum price, my low price, my last price, my TWAP price, counting from my LSE daily database and my trade table for Vodafone with my time range and grouped by time bucket.
So it's not a trivial query. There's quite a lot going on here. I'm trying to create five minute buckets with TWAP from traits.
So now we're passing that query to the MCP server.
It's then checking table schemas, our SQL documentation, list of databases.
Now it's come back with why the query isn't running.
In this case, I tried to set TWAP using TWAP and actually the aggregation is TW underscore average.
Next, LSE Daily holds our day records. It's optimized for querying long daily time series. It doesn't have the trade table. The trade table is in LSE. Or if I want to look at some more data in LSE sample. So I need to change the database I'm looking at.
So now I've got these two together, I see my result.
And also, it's changed time bucket. That was also wrong.
It should be time underscore bucket. So now I've got a corrected query that will execute and pull back five minute bars for Vodafone across my time period, in this case, eight until four.
So let's kind of jump more rather than syntax to coverage.
So we've been looking at LSE in US, so let's try Italian.
I can't remember which database holds Italian equities, so let's ask. So what datasets hold Italian equities?
Okay. So it's going to the list databases tool, and it's found Milan.
And Milan's our dataset, but we have Milan plus Milan bars, Milan daily, and Milan latest, latest being for real time data.
But we also have some pan European datasets.
EU Comp, which is our European composite. There's a sample version, which just covers the first three months of 2024.
And then there are a whole set of ECNs or alternative venues of MTFs or alternative exchanges, which are also trading Italian equities. So Aquis, Bats, Chiax, turquoise, etcetera.
So I can choose where I want to go.
Now I'd like to understand which tables are available for Milan.
So let's just ask the question.
Okay. So it's going to our tables listing.
And now we see a list of tables and their descriptions.
And it's saying, want me to pull the field schema for trade or quote or pick that?
So let's try that.
What fields are available in the Milan trade table?
Okay, there are twenty eight fields in total.
And here are the fields, including both the field and the description.
Now I can see I've got lots of MMT fields. These are the MiFID related fields. I can see MMT Market Mechanism.
Now I'd like to retrieve the enumeration values for that.
You can see it's the string of one length.
Okay. So here are the possible values.
Now this market mechanism doesn't sound a common name, so I'd like to see which databases that field is present in.
So I'll let Claude work that out from our tools again.
Okay. So here we're saying market mechanisms available in all of these data sets.
And that makes sense given it's a MiFID related field, so it's gonna be covering European data sets.
But when I go to other markets like America or Asia, I'm gonna have an issue.
Now trade period is a similar field that we add across all our datasets, which performs a similar mechanism. It's dividing the different trade periods or trading sessions that a trade will occur in.
And we would devise you use that because then you can query the same across all venues.
Moving out a bit and saying if I want to see well when is Milan open, I would look at the trading hours.
Now we're calling our trading hours function and we can see our results.
Okay, so I've got hours now. I want to know when are the holidays. So I can filter out or at least identify when there's a trading day and when there's a half day or when the market is closed.
So let's have a look.
Again we're going to our calendar holidays tool, and now pulling back.
Okay, so all the recent holidays have been full holidays.
Different markets, potentially you're open at half days.
In the case of Milan, least recently it's been for holidays.
So I can have help on both syntax and coverage, so pulling all of this together, I'd like to understand how to retrieve, let's say, last Friday's total trading volume for Home Depot in the US.
Let's create a new so using MCP, how do I calculate last Friday's total volume for Home Depot in the US?
In this case, I haven't defined the symbol, I haven't defined the database, haven't really done a lot.
So what we're just going to our list of databases is then searching our simple universe, getting the list of tables, and looking for our examples.
Now working out. So it's worked out that HD is the symbol for Home Depot.
And we should be querying US comp.
There's also an end of day database which has the day record.
So US comp daily and that has the volume pre calculated.
So I can just, in Python, select US Comp Daily, select my day table, select my symbols, Home Depot, my date, and get my volume back.
Or I could start calculating from the trades.
And here I want to aggregate volume based on the trade sizes across the trading day.
Now volume in our daily database is also broken down by sessions. So during the main session, the pre session, the post session, off book, round lot, odd lot, opening auction, closing auction. So we can choose which type of volume we want, or we can start filtering by certain criteria.
So even if I don't ask much or provide much context, given the tools, I get the syntax for calculating or retrieving the total volume. But let's say I want to go further and calculate the ADV.
So let's stay in the same chat.
So using MCP, how do I calculate the ADV for home depot?
Sorry, ADB for Home Depot over the last month.
Okay.
So now it's looking at our examples, looking at the calendar holidays, and then going back.
So we can go to our day table again, and that's more efficient. Look at volume and look at the mean, so the average volume across the last month.
Or we can go to our trade table and then aggregate.
By day, that's our bucket interval.
And then we'll aggregate that again across the month.
Now this was in Python as I didn't specify the syntax, so let's see. Well, how do I do this in SQL?
Okay. So here's querying the end of day table.
Here's querying the trades, and then wrapping that up for my ADP.
So backing up, let's say I want to return the prevailing quote for each trait. How do I do that?
Let's create a new session.
And this time just ask another general syntax-y question.
So using MCP in SQL, how do I join trades to prevent any quotes for US equities?
So we'd like some help on which dataset to point to. And how to do this as of join, where I'm joining trades to the most recent quote that's prevailing at the point in time of the trade.
Let's go through.
Okay. So I have my join pattern.
It's saying as of join is with same time as existing.
And specifically for my trades and my quotes. It's also saying that for US equities, we should be using the MBBO rather than quote because quote will give us exchange specific results.
While the MBBO will give us the consolidated national best bidden offer across all of the venues.
So it's both given us example and given us an explanation of why we're doing this. So taking this a step further, if I want to check the average spread for each exchange for a given symbol, This time I won't specify the syntax or SQL or Python.
I'll just let it do its stuff. So let's say for a particular date, let's say twenty first, using MCP, how do I calculate the time weighted average spread per exchange for US equities and McDonald's MCD?
Okay. So this time, Claude is going through the tools.
It's picking our list databases tool, searching for Python examples, searching for SQL docs, database schemas, looking for the time weighted average, how to calculate the spread. And now it's saying, okay, I need US comp quote.
Which will have the exchange field.
And here's the SQL version of this.
So I'm calculating my spread across my time range, then I'm calculating the time weighted average of that spread. For each exchange, discounting the quote count.
In Python I'm doing a similar process where I'm getting my valid quotes, calculating my spread, then calculating the time weighted average, again grouping by exchange.
So this time I have both examples.
I can extend these to now sweep across all symbols.
So let's go a bit further.
I've looked at spreads per exchange. I've looked at prevailing quotes.
Let's try one last one.
So using MCP, how do we return the prevailing quotes based on input times and offsets in Python?
So rather than taking market trades, I want to say, at these times and these sets of offsets are going backwards and forwards in time, when do I have results?
Claude is searching through our tools, and we come back with examples. In this case with different offsets, and we're working our way through.
Let's go back to our coverage. Now we continue to add more venues and more book depth to our data universe.
As we can see we continue to add more derived data sets including minute bar and daily metrics both within a specific venue and also across venues for composites where we're generating market share statistics.
We also listen adding feature sets based on your requests.
I'm currently working on trade data.
And also kind of key metrics across each menu.
Now we also continue to expand the available analytics of the platform.
Our recent focus has been around order book metric generation.
And finally, we continue to add more documentation examples on how to take advantage of these new features and new datasets.
And import importantly, how to calculate from bottom up or how to retrieve the metrics from the feature sets we're creating.
These then become the expanded knowledge base of the MCP server.
So then from your IDE, you can ask your questions or highlight code and correct it and accelerate from not knowing anything about historical market data to building complex analytics.
Thank you for watching.
Thank you, Peter, so much for that presentation. We've gotten a couple of questions from our audience today that we can take these next few minutes to answer. The first is how is authentication slash data isolation asserted?
Okay. Let's start with the authentication piece. So we use single sign on. We're using OpenID Connect.
So whether you're connecting to our dashboards or you're retrieving data via rest or through Python, you're connecting through the same single sign on interface, entering your credentials and getting back data. And that same single sign on is used for the MCP server. And all of the requests are going over HTTPS.
Now going getting back to data, the AMCP server is returning queries, which you're then executing, and you're executing those queries with your context so you can see the datasets that you're permission to see and subscribe to.
Now if you're using RMCP server in your own environment, then no data leaves that environment.
If you're using our cloud MCP server, then how much data leads for subsequent queries really depends on what you're asking. So let's say if you're querying four lists of symbols, time stamps, and offsets, you're not really sending anything proprietary at all.
Or you could have queries that submit data frames. So you could have a table of trades internally, which is sitting in a client side data frame, and you're submitting that as part of an overall query, which joins with the market data to come back the performance of those traits with, say, particular TCA metrics.
In that case, the data frame is sent to us cloud service for execution.
That data frame is passed across. It's sent in encrypted form.
It's executed in your compute area, and it's never stored.
The third side is you can actually upload your own datasets.
They'll be stored on an s three bucket dedicated to you and stored in a Parquet format.
You could upload the source data for those datasets in a whole set of different formats, which might be kind of fixed drop copy, delimited text, JSON, XML, etcetera, and we can load those for you on your behalf. So on a daily process, you upload today's trades from your OMS or with trades order flow. We'll upload that into databases that are stored in areas dedicated to you and only you can see.
Again, that data will be encrypted. And then you can execute queries which combine data from you with data from the kinda commoditized market data and then get back the appropriate results.
Okay. What's the next question?
Next question. Let's see. We have, can an MCP server be used for on prem deployments of OneTick with only a subset of locally synced cloud databases available?
Yes.
Now we are in a kind of private preview for that function.
The kind of cloud MCP has been running without marketing over the last three months, and we've been kind of increasing its capabilities across that time.
We now have the software behind that cloud MCP available and deployed at three or four customers who are kind of evaluating that, and then we expect to launch that to all existing one tick kind of software customers in September.
In that case, the MCP server has to work slightly differently. It's it's potentially it's using the same datasets in terms of syntax, but the coverage information has to be unique to your sets of databases.
Okay, next question.
Okay, great. The next couple of questions are regarding specific pricing requests, so we'll be in contact with those folks directly following the event.
Peter, is there anything last Well, let's kind of go on just on on pricing and how that works.
So when we're providing access to the environment, You're signing up to historical data, and that's either per venue where you're saying, say, I want all of the US SIP or I want all of LSC or I want all of CME, or per symbol. For equities, like I want to sign up to a thousand symbols, I don't care where they are in the world. Or for derivatives, it could be per product. I want these five products.
The second setup is, well, how far back in history do you want to have access to? Is it the last year, the last five years, the last ten years, etcetera? Do you require book depth, or are you happy with just level one? If you're looking at derivatives, are you just looking at futures or also including spreads or options?
Then do you want to go from history to real time and retrieve data intraday? That real time focus could also be per venue or per symbol for equities or per product for derivatives.
Now if you're looking at real time data, there will also be additional exchange fees, which you'll have to think about. But you may not want to subscribe to, let's say, all of EURX. You may be interested in only the top treasury products in Eurex, so we can set that up for you.
Then finally, you're issuing compute. So there's a compute cost, and you can judge how much compute you need, and you can keep changing that month to month.
We also provide stats to you. So general reports and kind of live dashboards so you can always see how many queries are running, how much compute was used, are queries waiting because there's not enough capacity that you've allocated to yourself, and which instruments you've been querying. So you can judge, are you getting close to a limit or do you want to increase that?
Then, after the compute, do you want to add in your own custom datasets as was talked earlier?
And finally, you want to download data?
For customers that want to use compute, typically, you may be querying, a very large history of data, but only putting back your results, which is typically gonna be a lot smaller. Other customers don't want to use this for compute. They want to pull down Parquet files into their own environment or to their own their compute platform of choice. So in that case, there wouldn't be a compute fee, but there would be an a bigger data download fee because rather than, let's say, from a compute perspective downloading a few gigabytes of results, a month, you may be downloading terabytes of Parquet files during that month period.
So couple of steps, it's really what data you require and what compute you require, and we'll design the most cost effective solution for that.
And finally, on the costing of the MCP environment, that's just part of the service, both in terms of accessing OneTick cloud because it gets you to write analytics faster.
And in terms of, customers who deploy OneTick software locally, it hopefully gets you to run more queries and expand your query usage.
OK. Fantastic. Thank you. That's all the questions that we have today. Peter, any last last thoughts?
We are not standing still, so our next step is to add skills for Claude into our MCP environment, and that's happening over the next month or so.
And we're continuing to add data. So we just did a webinar couple of weeks ago on US book depth.
The next focus will be integration, with KDB so KX customers can query one to cloud. And we'll keep adding, to our analytics and data coverage capabilities over the coming months.
Fantastic.
Thank you all for your time today. To learn more about OneTick, please reach out to us at www.onetick.com or www.kx.com, or you can email info.ontick.com to learn more. Thank you so much, Peter.
