5 ms·
Much appreciated! I am still learning.
by is0tope 5y ago
Much appreciated! I am still learning.
- Exuma 5y agoI just sent your article to a lot of different people trying to learn. You have a natural gift for teaching, I'd highly recommend you keep making posts. I went down the rabbit hole learning a lot of this stuff about 1/2 a year ago and good information is quite challenging to find, it's all hyper dumbed down or hyper generalized and vague (investopedia).
- is0tope 5y agoThanks a lot, I am glad it is useful. If you have any ideas for topics that were hard to understand before, please do let me know!
- Exuma 5y agoHonestly I think the hardest thing to date that is nearly impossible to find information on is how a market maker actually works. I've googled for hours before only to get very vague definitions, nothing concrete with actual examples/formulas.
- is0tope 5y agoThank you, i will put "how market making works" on my list. Obviously that is a very detailed subject, but I think the basics can be covered pretty easily.
- Exuma 5y agoI agree, I'm sure it is wildly complicated, but something more than "market makers provide liquidity!!!" would do wonders. Something on par with the detail of your existing 2 posts would be 10/10...
- evo 5y agoHere's my understanding, starting with some background terminology: Everything that's tradable on an exchange (an "instrument") has a bid/ask spread that represents the highest price someone's willing to pay to buy (the bid), and the lowest price that someone's willing to pay to sell (the ask). There is _always_ a bid/ask spread, because as soon as anyone places an order that would reduce the spread to zero, that means they're willing to pay what someone's asking, or vice-versa, and therefore the exchange immediately converts it into a trade--done deal!--and now there's a spread again. Incidentally, executing a trade this way is "crossing the spread", you're opting to "pay the difference" between the bid and ask to get your trade done. Someone that crosses the spread is said to be "taking liquidity." They're willing to pay the surcharge of the bid/ask spread to get their trade executed right now. On the other hand, someone that sits at the bid/ask spread, waiting for someone to cross to execute, is said to be "offering liquidity," they're willing to patiently wait in order to save money equal to the spread. Now, a market maker is a participant that is _solely_ interested in making money off that bid/ask spread, basically like a sports bookie. They're willing to always be in the market, on both sides, and take the spread whenever someone crosses over. So if say AMZN is trading at 3332.95 x 3333.05, they'll be offering to buy at 3332.95, and sell at 3333.05, and any time people take those offers, they make a dime. Do this thousands of times a day, on many different instruments, and you've got a business. That said, there's real risks in market making, and understanding them requires the idea of "informed" versus "uninformed" trading. An uninformed trader comes to the market simply because they want to trade for some external goal unrelated to trading. Maybe they're selling stock for a house downpayment, or buying agricultural futures because they make potato chips and don't want to deal with the price shocks of a sudden drought. They're willing to cross the spread, and they don't particularly care if they lose a few pennies on the transaction, because that's not their goal. These traders are the meat and potatoes for market makers, because they don't move the fundamental price of the instrument, they're effectively noise. In a market of nothing but uninformed traders, you would expect your position as a market maker to fluctuate around zero, because you're buying roughly as much as you're selling. An informed trader, on the other hand, "knows something". They're aware of some material fact (or at least a strong hypothesis) that indicates the price of the instrument is going to move dramatically in the near future. They're willing to cross the spread, because they know the spread is going to move with them anyway. These are danger for market makers, because they will all pile in on one side of the trade, all buying, or all selling, and now the market maker will end up in a losing position--short when the price is going up, or long when the price is going down. Imagine running a Gamestop store: on a normal day, you might see half your customers buying a PS4 and half selling a PS4, but on the day that the PS5 is announced, suddenly everyone wants to sell their PS4 at the same time before you lower what you're offering. The classic market maker algorithm looks at "inventory", basically your absolute outstanding position, and tries to keep inventory as low as possible. When uninformed trading is taking place, your inventory is around zero, and you can stay very close to the minimum spread. As your inventory grows, and you become either increasingly more long or short, you start pulling your bids or asks away from the best bid/ask to try and bias future trades back into a 50/50 ratio. All market makers doing this simultaneously means the bid/ask spread starts to widen as there's increased uncertainty about the price. Another key element to market making comes down to trade volumes. You could, today, start market making, all you need to do is put in limit orders at the bid and ask and wait. However, you'd probably not make that much, because you're losing money to various trading commissions, exchange fees, roundtrip network latency, etc. Professional market makers make tens of thousands of automated trades in a day, and as a result, are able to negotiate substantially lower costs that make it worth doing. Many exchanges even have "designated market makers" that have special trading permissions in exchange for guaranteeing that they will _always_ provide some best bid/ask offer even in the worst case conditions, otherwise you in a sufficiently large event you could get a "liquidity crisis" (i.e. there's no one willing to buy or sell that instrument at any price). That ended up being more text than I thought it would--apologies.
- ReggieCommaRose 5y agoI work in a vanilla MM space and have had limited exposure to systems/technical side in the crypto space, would love to see the weird/cute crypto-specific problems that exist. For instance I was surprised to learn the other day that FPGAs are becoming standardized in the crypto space now as well, since to my knowledge network bottlenecks are more difficult to be precise about due to the common usage of websockets, the non-standardized colocation services offered, etc. But what crypto MMs are using FPGAs for, is to do actual JSON (maybe it's FIX by now?) parsing since that became a common bottleneck due to the lack of binary protocols from crypto exchanges.
- is0tope 5y agoThat's very interesting! I myself have not worked as a MM before so I don't know much about it. I can imagine it is possible since these days there is a lot of cross pollination between traditional finance and crypto. Most exchanges will do Json, though I know of several who have FIX interfaces also.
- Exuma 5y agoSo quick question: is it correct to assume that FIFO/LIFO doesn't matter if you want to get your overall profit (sum the cost column which consists of side x quantity x price for each trade)? In other words, FIFO/LIFO only applies when trying to find the profit of a single trade, but as a whole it doesn't matter? Or is that incorrect. Thanks Edit: Nevermind, I forgot this is for REALIZED gains. I feel like what I wrote above would only make sense if the entire position was closed flat. Ultimately I was trying to figure out the difference between summing the cost column (which seems to be profit/loss depending on sign?) vs matching trades with FIFO/LIFO but I have a hunch it has to do with realized vs unrealized gains.
- is0tope 5y agoSo all of these methods converge when the position is fully closed out. They are actually designed mostly for regular businesses that are buying and selling items, but it works for anything. You always end up making the same amount of money, but when you need to figure out profit, it is hard to do before you have sold all of your stock! These systems provide different ways of answering the question: "What is my profit _so far_?). Summing up all of the costs will give you the cost so far, but if you are half way through selling all of your items, it is not that useful, as you have no way of telling if you are making a profit or not on your sales! FIFO vs LIFO can matter depending on what you are trying to "show". I am not an accountant, but imagine if you bought a bunch of stock really cheap in the first half of the year, and in the second half bought a bunch more stock at a higher price. If you use FIFO, you will realise a big profit initially, followed by a smaller profit or loss in the second half when you start to use up your more expensive stock. With FIFO, you do the opposite (big loss up front), and with Average Cost it's more spread out. If you have mid year report coming up, and you want to look good, you might be tempted to use FIFO, in order to show that you made a higher profit initially. I'm guessing real accountants see right through this though!
- Exuma 5y agoOoooh, great point. Thank you, that makes perfect sense. So that's an interesting point that I never actually realized (pun intended 1000%)... is that FIFO/LIFO doesn't actually change your profit amount when the position is fully closed, it only matters, as you said, when "showing" that profit, ie... if you are trading over multiple years and you need to do your taxes, the tax years up front might show more profit, but less in later years, or vice versa, but over all the years the profit would be the same. That's obvious in retrospect, and I can't believe I didn't get that before. Thanks!
- Exuma 5y ago> By definition, this order must be the top of the book, because it’s price already had to be aggressive, and there could be no other bids above us. Therefore, the new best bid increases from $99 to $102, since that is the limit price of our order. I really wonder here, in this part of "Introduction to Limit Orders", how they handle race conditions. Do you think they use a synchronous queue that queues orders while it's transacting, or do they try to also handle inserting orders during the process of filling orders?
- is0tope 5y agoOrder books will almost always be single threaded or something similar. Only one order action is allowed at a time in each book, otherwise it would be chaos. Exchanges are very strict on "fairness" since if there is a (legal) edge to be had, you can bet that someone will find it and try and exploit it. That's just the game.