Published: March 26, 2023
16
45
323

1/ One critical aspect of crypto HFT is protecting your strategy from "market manipulation." These people make a living tricking automated strategies to extract profits For example here's an algo getting wrecked by a spoofer on a large exchange. A thread on what's going onЁЯз╡

Image in tweet by jeff.hl

2/ Disclaimer: I'm not passing judgment on these actions. I'm not a securities lawyer. This is just a fact of life that we had to protect ourselves against with when scaling up our strategies. It's the wild west out there and this is a part of the PvP game

3/ Ok so what's going on in that graph? This is some altcoin seesawing in a massive 10% range over the course of minutes on millions of dollars of volume. No way this is organic flow. It takes some first hand experience to know that this is an automated strategy getting tricked.

4/ In some ways fully automated strategies are dumb: with no discretion, their state machines can be tricked to do obviously silly things like repeatedly crossing the spread to bleed money How does this work? Basically the spoofer reverse engineers the inputs that trigger trades

5/ The simplest example is that resting orders predict future price returns. On average a resting bid means someone wants to buy, so the price will go up. One way to "spoof" is to place big orders on one side in hopes to get your orders on the other side filled. Rinse and repeat

6/ Different strategies use the market data differently, and these days you have to be pretty sophisticated to profitably cross the spread. However, the effect direction is obvious because we know the story behind the alpha: on average resting orders indicate a desire to trade

7/ Spoofers are probably a discretionary trader supervising an automated strategy. They can fiddle with parameters, change symbols, turn things on and off, until it works. Once it works, they leave it on until the algos adapt. Quite annoying for normal automated traders...

8/ What are some ways to protect against spoofers? The 80/20 when starting off is to detect it and then turn trading off automatically. We were content with this for a long time since it was more profitable to improve other aspects of trading and take the initial pnl hit here.

9/ Once you have this system, you can do more continuous adjustments. This approach can be quite noisy, and false positives and negatives are both extremely costly: Fail to shut down and you bleed money. Shut down incorrectly and you are probably missing a great time to trade.

10/ Some specifics on what we detected when looking into this: If you step through the book tick by tick, you'll see most spoofing is flagrant. They will flash massive orders repeatedly near the top of the book.

11/ They might trade small size on the opposite side too, though hard to know for sure if it's them. The intuition is that trade messages are more informative than book updates. Especially when book and trade messages align, this might push an automated strategy to follow.

12/ Hope this thread is helpful for traders deploying their strategies to production. I found it important to keep a positive attitude. Yes this is less "interesting" work you might not want to deal with, but being picky about what to work on is a sure way to never make money.

@chameleon_jeff You can also add a dampening effect so successive opposite side order book imbalance affects your mm algo less and then have the dampening effect decay over time as the book returns to normal behavior.

@Galois_Capital Yeah lots of interesting interplay between time and distance on the book, both for this task and in general

@chameleon_jeff If you're faster is it viable to pick off the spoofer? Or not possible on crypto exchange infra

@llllvvuu Yup, totally possible. Never looked into it, but pretty confident it would work. The spoofer usually has a manual component though, so they'd probably realize quickly and adjust, so the strategy might not scale that well

@chameleon_jeff WhatтАЩs the ticker bro

@TangTrades Don't wanna throw any exchanges under the bus. Besides it happens constantly on basically all of them

@chameleon_jeff i assume that is a spot ticker and not a perp..right?

@gutsareon Yeah, happens most on illiquid spot

@chameleon_jeff To be fair, MMs running these kind of algos are toxic as hell also, constantly undercutting the orders (sometime against one another...) to stop retail from buying/selling their alrdy illiquid assets

@cryptochinchil1 Agreed it's hard to be objective about what's good for the market. So there's some argument that default should be to encourage trading in general. I'll probably write a more opinionated thread on "ethical" markets later

@chameleon_jeff @arb8020 predictable behavior will be predictably exploited

@chameleon_jeff Is this why I always get stopped out and then it pumps ?

@chameleon_jeff Great viewpoint into what the less glamorous side of algo trading looks like in crypto. We haven't even gotten into sniffer algorithms and how the PVP area is becoming more like The Wilderness in Runescape...

@chameleon_jeff Pretty awesome! I should code something to detect this pattern and join the party :)

@chameleon_jeff рдХреНрд░рд┐рдкреНрдЯреЛ рдПрдЪрдПрдлрдЯреА рдХрд╛ рдПрдХ рдорд╣рддреНрд╡рдкреВрд░реНрдг рдкрд╣рд▓реВ рдЖрдкрдХреА рд░рдгрдиреАрддрд┐ рдХреЛ "рдмрд╛рдЬрд╛рд░ рд╣реЗрд░рдлреЗрд░" рд╕реЗ рдмрдЪрд╛рдирд╛ рд╣реИред рдпреЗ рд▓реЛрдЧ рд▓рд╛рдн рдХрдорд╛рдиреЗ рдХреЗ рд▓рд┐рдП рд╕реНрд╡рдЪрд╛рд▓рд┐рдд рд░рдгрдиреАрддрд┐рдпреЛрдВ рдХреЛ рдзреЛрдЦрд╛ рджреЗрдХрд░ рдЕрдкрдирд╛ рдЬреАрд╡рди рдпрд╛рдкрди рдХрд░рддреЗ рд╣реИрдВ рдЙрджрд╛рд╣рд░рдг рдХреЗ рд▓рд┐рдП рдпрд╣рд╛рдБ рдПрдХ рдПрд▓реНрдЧреЛ рд╣реИ

Share this thread

Read on Twitter

View original thread

Navigate thread

1/29