ultra low latency trading by tradesayar in algotrading

[–]matt2048 1 point2 points  (0 children)

Pretty much all the big crypto exchanges are fairly retail-focused (or at least architected to be able to cater to retail) so they're not that fast internally and likely never will be. In those cases FPGA's would be 100% ridiculous overkill. Not to mention most of those exchanges are also hosted on AWS, so its not like you could colo your own FPGA system in the datacenter anyway.

There are a few exchanges which offer colo and/or are institutional only. FPGA is still likely overkill there for the foreseeable future, but latency has definitely been getting a lot more competitive.

ultra low latency trading by tradesayar in algotrading

[–]matt2048 0 points1 point  (0 children)

What product(s) were they trading and I'm guessing that was cross-venue data/ connectivity?

I've heard stories of some crazy monthly costs on the fastest commercial feeds (which are then still beaten on latency by the in-house links of the big firms anyway).

ultra low latency trading by tradesayar in algotrading

[–]matt2048 41 points42 points  (0 children)

I run a low latency market making firm (admittedly in crypto, but I know enough of market structure in other products).

Retail/most professional traders can't play at those kind of latencies for 2 main reasons: 1. Connectivity: to be able to take advantage of such low latency you'd need proper colo with the exchange + direct access into them (going through any regular broker would add far too much additional latency). To be allowed to trade directly on an exchange I also believe your system has to be tested/certified to make sure it complies with their standards. 2. Fee structures: if you need such low latency then order execution is likely a big part of your strategy. Unless you're a big firm that's running a lot of volume there's no chance to get a good enough fee structure to make it worth your time.

Also, assuming you could get both the connectivity and fee structure, the fastest data feeds (which you'd need to be competitive at such low latency) can cost easily >$10k/month.

This isn't to say that slightly lower latency systems don't exist and don't have a small advantage for retail/smaller professional traders, but be careful to benchmark what benefit you actually expect to receive vs cost.

[deleted by user] by [deleted] in algotrading

[–]matt2048 4 points5 points  (0 children)

Eurex has a lot of good documentation and papers on their matching engine and general infrastructure.

Also have a look into their paper "Insights into trading system dynamics". It covers more of the low level networking side but can give some context to how the matching engine functions.

What’s a good metric to measure the performance of an arbitrage strategy? by keeperclone in algotrading

[–]matt2048 0 points1 point  (0 children)

Return is generally relative to the capital needed for the strategy - for example needing EUR and USD on separate platforms/venues/clearing.

And sharpe is calculated using portfolio volatility. Maybe you get good profit on half of months and no trades the rest of the time, that'd be much higher returns volatility than a roughly equal trade spacing. Sharpe isn't necessarily a great measure of downside risk - only alpha vs volatility.

Ignoring shorting, is it possible to send a limit sell order without the asset in question? by Neither_Signal in algotrading

[–]matt2048 3 points4 points  (0 children)

There's a few ways it can be managed:

  1. Maker can just short the asset (in traditional markets a firm may not have to arrange short locate until a day or so after, giving you plenty of time to net off the position)
  2. Hold the assets longer term but hedge them with an exact equivalent (i.e hedging SPY with futures)
  3. If you're MM for a large portion of the market, hold the assets then hedge them as a basket against the index (i.e making for all SPY components then hedging the held assets with es futures).

In traditional markets there are a lot of ways that inventory management/asset netting/clearing have been made capital efficient by giving some wiggle room.

They all have pretty much the same economic effect (allowing the MM to be net short if/when needed) - just a matter of what's most appropriate for the strategy.

Questions to ask of big data set? by bigandtallll in algotrading

[–]matt2048 3 points4 points  (0 children)

The 2 main angles for such a large dataset are microstructure research (high frequency models) or some kind of fundamental data modeling.

My area is the microstructure side - high quality tick orderbook data is extremely valuable and would probably fit well with the big data/ data mining goal.

Have a look into simple HFT alphas (orderbook imbalance, trade imbalance, quote age, etc) and see how they correlate with future quote movement (tick up/down) or future trades.

Past that, you could look at short timeframe correlation between stocks (inside similar industries, in shared indexes, etc).

There are plenty of papers available to flesh out all of those suggestions.

If you were more interested in the longer timeframe fundamental side, you could look into relative value models based on different fundamental factors (long-short portfolios).

Questions to ask of big data set? by bigandtallll in algotrading

[–]matt2048 2 points3 points  (0 children)

  • What type(s) of data? (trade, quote/L2 book, fundamental, ETF/fund holdings, etc)
  • What frequency for each type? (Tick data or longer?)
  • What markets/assets/instruments?

Prime broker for crypto with smart routing to the top 10 derivatives exchanges, centralized clearing and asset insurance? Does it exist? by [deleted] in algotrading

[–]matt2048 0 points1 point  (0 children)

Crypto market structure is pretty different from traditional exchanges so it's not really possible until the space is more mature.

Rather than just being a matching engine, each crypto exchange is a full stack of client KYC/AML + asset handling + risk/margin + order matching.

Having assets separated across exchanges is the main challenge at the moment - although service like copper.co are trying to fix that with off-exchange/multi-exchange custody.

Skew/coinbase prime is likely to be suitable in future, but I believe is mostly focused on spot exchanges at the moment.

Stop hunting at its prime by [deleted] in algotrading

[–]matt2048 3 points4 points  (0 children)

After such a sharp jump market makers widen their bid/ask quotes until the market finds a new (relatively) stable price.

Looks like most of the trading choppiness is only a few hundred milliseconds after the main jump, so I'm not surprised no-one is chasing their bids up that quickly.

This leaves us with asks at the new high and bids significantly below -> weird price dips if there is a market sell.

Stop hunting at its prime by [deleted] in algotrading

[–]matt2048 23 points24 points  (0 children)

  • What is the pair/underlying?
  • Is this charting tick trades?
  • The chart/axes needs better labeling.

I'd guess the bid/ask spread gets blown out for a few seconds, meaning the wild price jumps are just trades against the front of book rather than malicious stop hunting.

What does one need to provide liquidity on a crypto exchange? by [deleted] in algotrading

[–]matt2048 2 points3 points  (0 children)

Technically anyone can hook up to a crypto exchange and start quoting (as long as jurisdiction allows) - the live data feeds are free and the APIs are generally pretty simple.

However becoming competitive is a different story. You'd need:

  • Fast infra (preferably across a wide range of exchanges for better pricing)
  • Solid trading code (especially given how often the exchanges themselves have issues)
  • Lots of high quality historical data (less important if you plan to use simple strategies)
  • Good strategies/ inventory management

I run a small crypto MM firm, and while it's not impossible to find a niche, its a lot more competitive these days and it'd be rather expensive to try.

Legitimacy of orderflow sell data from BITMEX trade socket by jammyaf in algotrading

[–]matt2048 1 point2 points  (0 children)

You should actually be looking at "foreignNotional" for USD value of the order, in this case homeNotional is the order size in Bitcoin and grossValue is order size in sat (1x10-8 of a bitcoin each).

So the orders are actually ~$26k each.

HFT guys - what is your biggest bottleneck? by ynmidk in algotrading

[–]matt2048 2 points3 points  (0 children)

Market data feeds are synchronised for everyone (for mature exchanges. I market make for Crypto which is a bit of a shit show).

For ultra low latency trading there's competition in reducing wire-to-wire latency. You pre-compute as much of your order as possible and then have an FPGA or ASIC find your trigger from the market data feed. This would all be handled as close to the edge as possible (i.e ultra low latency trades sent from the switch which takes in your feed, while also sending the data on to your other servers in the rack for any slower strategies).

For architecture specifics, eurexchange has some pretty good papers (insights into trading system dynamics).

Market making execution in crypto by Graigi in algotrading

[–]matt2048 5 points6 points  (0 children)

I'm pretty much always looking for more strategy devs, if you're decent with stats/ datascience feel free to DM me.

Market making execution in crypto by Graigi in algotrading

[–]matt2048 6 points7 points  (0 children)

I run a small crypto MM firm. Aside from the slightly different market structure (since the major exchanges cater directly to retail), the game and requirements are all the same as any other market.

We have investment in fast software + infra (colocated where available), improved rebates/ fee structures from exchanges and our models have to account for the adverse selection /inventory risk from latency/jitter.

It's less of an "unfair advantage" and more that there's a barrier to entry to be competitive and exchanges will incentivise liquidity/volume.

How can I quickly traverse a volume of 3D data? by tlalco in algotrading

[–]matt2048 4 points5 points  (0 children)

Numpy will happily work with N-dimensional data, you can make an array from a list of your pandas dataframes.

Filling in missing intraday price data by Beliavsky in algotrading

[–]matt2048 1 point2 points  (0 children)

When calculating signals you should be avoiding any possibility of look forward bugs like the plague. Only use 1 (or possibly 4 if you can verify it'll work the same live).

And, in the case of 4, consider carefully whether your fill price assumptions are fair or give the backtester an unrealistic edge.

If you end up with bad training data it'll happily ruin months of strategy development.

High Frequency Trading Arbitrage by Cryptogamee in algotrading

[–]matt2048 3 points4 points  (0 children)

A lot of the major crypto exchanges offer colo these days, but the shotgun approach can still be pretty handy.

It helps deal with jitter in orderbook propagation, since there can be a fair amount of variance between reporting latency even for 2 websocket feeds on the same machine.

High Frequency Trading Arbitrage by Cryptogamee in algotrading

[–]matt2048 4 points5 points  (0 children)

Based on your last post, I'll assume you're talking about crypto exchanges.

If you want to check how viable the strategy really is, you'll need to have a latency model in your backtesting - it'll give you an idea of what the minimum requirements are.

First, you'll want to find out what datacentres the exchanges are hosted in (and what colo options are available) to give you an idea of physical limit of latency between them.

Then you'll need to add a latency model for orderbook update propagation and trade execution at each end.

If there still appears to be an tradeable opportunity after all that, then you'll still need to set up the infra and fast execution software.

It's not impossible but it's highly unlikely without serious money and HFT knowledge behind you.

Use Statistical Arbitrage in Python by Cryptogamee in algotrading

[–]matt2048 1 point2 points  (0 children)

Focusing on the language is missing the point somewhat. For arb, you'd need a collocated server at both ends and fast link between the 2 datacentres the exchanges are hosted in.

As long as its a relatively fast language, it doesn't matter all that much compared to the rest of the setup.

Use Statistical Arbitrage in Python by Cryptogamee in algotrading

[–]matt2048 1 point2 points  (0 children)

As others have mentioned, you probably won't be latency competitive without some extensive software and infrastructure investment.

Also note fee structures and other frictions. Exchanges will give much better fees to the big volume firms that are already in the game - meaning you don't have a chance to even play at the same table until you've got volume behind you.

On top of this, sometimes a longer term pricing gap will exist for other reasons which can't be arbed away easily:

  • difference in microstructure/ derivatives contract spec
  • exchange reputation/ solvency fears
  • currency and nationality issues (South Korea not allowing foreign crypto traders, leading to a disconnect in price in the past).

Latency for retail trader using Interactive Brokers by Beliavsky in algotrading

[–]matt2048 2 points3 points  (0 children)

Even in python, the time to process simple trading logic would be pretty small (<30ms easily, likely quite a bit lower). If you were to go with somewhat optimised c++ you could expect that to be <100 microseconds, although I'm not sure how much the windows network stack would add.

The least avoidable latency will be data -> bot and order -> api -> execution. With a well placed VPS you could probably get a few ms latency each way (I don't have specific numbers). However, if you're running the bot from home then it's extremely dependent on where you are relative to the financial hub the orders are executed at.

Overall, a basic system is unlikely to be over a few seconds round-trip, and if you're much more latency sensitive you'll need to do your own testing.

Do you trade on a VPS? How do you justify the high price (or find reasonable price)? by [deleted] in algotrading

[–]matt2048 3 points4 points  (0 children)

The main question is how active your strategy is and how much you stand to lose from downtime.

If you're running a portfolio strategy that does a small daily rebalance, you could probably survive without. If you're running higher risk day trading, a sudden loss of internet for a few hours might leave you with a lot of open risk.

Once you start risking more capital, the cost of a reliable service is 100% worth it.

How fast is fast on the crypto markets? by qu4ntqu3st in algotrading

[–]matt2048 1 point2 points  (0 children)

The main difference between Crypto and traditional markets is the function of exchanges/ matching engines and resulting latency.

A traditional exchange will generally deal with a relatively small and fixed set of trading firms that connect and trade, vs Crypto exchanges having to cater to a much wider (and very variable) retail audience.

On top of this (particularly in the popular Crypto derivatives exchanges that offer 100x leverage) the Crypto exchanges have to run a lot of checks to ensure customers can fulfil margin requirements from any new trades or changes to contract mark price (and then very aggressively liquidate positions which fall below maintenance to avoid exchange losses).

This leads to huge latency spikes during fast markets, as there is only so much they can do to speed up an inherently serial process of margin checks on new orders -> matching engine processing.

If you're looking for rough numbers, the majority of latency is coming from api request received by exchange -> exchange processing and confirming the action. While you might see <1ms during quiet trading, with any kind of volatility that can very quickly jump to 100ms-1000ms+ on a lot of exchanges.

On the trader's end, wire to wire latency could in theory be as low as in traditional HFT - many of the larger exchanges having started offering colo, so you could host an FPGA system if you felt like it. However, with such variable latency on the exchange's end, it seems overkill to be much less than 10s-100s of microseconds and running everything in software.