5 ms·
when milliseconds mean millions
by htrp 1y ago
when milliseconds mean millions
- PufPufPuf 1y agoIf that was the case, why use Python in the first place?
- dmoy 1y agoWell there's gonna be people writing code who can't do it in say a high performance C/C++ setup. Not professional programmers, but professional <some finance discipline>. Sometimes it will be worth the tradeoff to put that person and a programmer together to code up a solution in another language. Sometimes it will be worth it to have the non-programmer write it in Python and then do Herculean things in the background to make it fast enough.
- instig007 1y ago> Sometimes it will be worth it to have the non-programmer write it in Python and then do Herculean things in the background to make it fast enough. Nim exists, Crystal exists
- dmoy 1y agoIt would not surprise me if some shops end up using less common languages to fill a niche (or hell, invent their own DSL). But it also wouldn't surprise me if a lot of shops land on python because that's what their hiring pool knows.
- skeledrew 1y agoWith insignificant ecosystems, compared to Python.
- procaryote 1y agoThe gulf between high performance C/C++ and Python is vast and includes most other programming languages, many of which are friendly to write or can be made friendly to write for a limited domain, with significantly less rocket science needed than making python faster.
- mhh__ 1y agoIt's not uncommon to have a fast core and then an API that alpha / research teams feed signals into if you are someone like HRT I presume the bulk of their money comes at very short holding periods so you have e.g. fast signals that work short term and then mid frequency alpha signals that spit out a forecast over a few timeframes i.e. it might not be that they buy (aggressively) really quickly but rather than someone sells to them and then they hold onto the position for longer than they would if they have no opinions. Similarly this shapes where you post your orders e.g. if you really want it then you want to be top of the book
- pgwhalen 1y agoEven at the speediest trading firms, the large majority of code is not latency sensitive. Systems and algos are structured such that the fast acting stuff is simple and contained.
- dumah 1y agoThere’s tons of latency sensitive code outside of the FPGA systems and it is not simple.
- kristjansson 1y agoThey’re not doing the fast stuff in python; nevertheless it’s worth their engineering to make the parts they do in python fast
- shepardrtc 1y agoHonestly if you're a millisecond too slow you might as well not trade at all. From my own experience with trying to get Python to go fast for crypto trading, you can get it pretty fast using Cython - single digit microseconds on an average AWS instance for a simple linear regression was my proudest moment. They're probably pushing it even faster because nanoseconds are where the money's at. Many HFT firms are down in the double digit nanoseconds, I believe. Maybe lower.
- charcircuit 1y agoFor crypto you pay the miners to put your transaction first. You don't need millisecond precission reaction time.
- KK7NIL 1y agoCrypto trading takes place on exchanges, not the blockchain though?
- scrlk 1y agoIn crypto, you have centralised (e.g. Coinbase) and decentralised exchanges (e.g. Uniswap). Decentralised exchanges operate onchain via smart contracts. This article from a16z explains the mechanics of reordering transactions for profit (MEV): https://a16zcrypto.com/posts/article/mev-explained/ https://a16zcrypto.com/posts/article/mev-explained/
- bobmcnamara 1y agoFor reference, a byte at 10gbps is almost 1ns long. Though the encoder runs 64/66bits at a time, so you really get around 8B every 7ns or so.
- ActorNightly 1y agoThose days are all over btw. Most trading firms are past the whole "beat the other guys to buy". Established large investment firms already have all that on lockdown in terms of infrastructure and influence to the extent where they basically just run the stock market at this point (i.e Tesla posts horrible quarter numbers, but stock goes up). Most of the smaller firms basically try to figure out the patterns of the larger firms and capitalize on that. The timescales have shifted quite a bit.
- dumah 1y agoNo, there are absolutely electronic trading markets where a difference of milliseconds of latency to certain events is worth more than a M PnL. That’s a long time.
- diziet_sma 1y agoI took the parent post to mean that a few large firms have emerged as clear winners of the speed game, and most other companies compete on (relatively) longer time scales now.
- nly 1y agoThe top trading firms are firing off orders in double digit nanoseconds, not milliseconds. In some cases the order leaving the card starts to emerge before the packet containing the market data event that they're responding to has even finished arriving. Waiting for a full microsecond for the packet to arrive before responding means you're already too slow The speed game is essentially over
- dumah 1y agoThat’s irrelevant to the fact that the expected PnL on a millisecond of latency improvement is a lot more than 1M in some markets. Obviously if you are getting what ever trade you are concerned with off in less than one millisecond, the question isn’t well posed. There are many more games to play than delta one takeout and the solutions certainly don’t fit on one or a handful of FPGA’s.