Headline: Bot and Sold
Date: 4/23/2033
Body: The key to cryptocurrency, and what keeps me up at night if I owned any, is the extreme volatility of the prices. This is nothing new to readers of my blog and readers of any kind of article about cryptocurrency. But, the reasons why this extreme volatility exists might not be so visible. In the stock market, there was an arms race of who could get their orders fulfilled the fastest, and year after year, firms would invest millions of dollars to get a foot closer to the servers closing the deals. In terms of timing, this advantage was measured in nanoseconds or less, literally.
So, should it be any surprise that when dealing with something even more abstract, like cryptocurrency, the arms race begins on an even higher level? I hope that your answer was NO!! Back in the halcyon days of trading “real” stocks, there was a brief period (measured in microseconds) between a large institutional investor, say CALPERS, placing an order and getting that order filled. Some computers, were they fast enough, could “see” this large order coming and order the same stock first. This would guarantee them a lower sales price than CALPERS was getting, and then, microseconds after the big sale, they could sell their stock back at an inflated price, and pocket the difference. This is the essence of “front running” and in the realm of cryptocurrency, this has taken on Olympian proportions: perhaps that’s an understatement because, it is physically impossible for any human to do this accurately. (There is a great book about this called Flash Boys. Great read.) Enter the “bots.”
The bots are essentially small pieces of code that “see” a potential change in prices upcoming and try to take advantage of it. As you can probably guess, this army of code pieces adds significantly to the volatility in pricing of cryptocurrency. In fact, some experts have made this exact point.
“Under the surface of every transaction that finds its way to the blockchain, there are fierce wars over every bit of profit,” said Manuskin. “If you happened to come across an arbitrage opportunity, or even notice an error in some contract, it is very likely that it will be hard to extract this value without either operating a bot yourself to fend off the front-runners, connecting to and paying a miner to conceal your golden goose transaction, or making the transaction complex enough for the front-runners to not notice.”
This is hard to believe. Is there proof that these bots exist?
Good question. Researchers looked at this very question, in fact. They put together a large transaction that was engineered to be attractive to a bot like this. The Ethereum based contract was pending for about 3 minutes. Then in the same transaction block (before the engineered bait transaction) a similar transaction took place. Why did the Ethereum miners prioritize this transaction? The bot paid them 0.0001111 more gwei. (This is a currency paid for the miners to substantiate a transaction. This payment is also called “gas.”) The researchers engaged the services of an Analytics company and figured out that the bot had been used since 2018, and it had taken profits amounting to $10,000. Not quite enough to live on near DC, but, one single person can operate MANY different bots, and the results can multiply quickly. In the next stage, researchers hid their transaction behind a proxy server, and even with this protection, there was a different front-running bot that was not fooled. Arms race has officially begun!
So, we know there are front-running bots, so we can avoid them, right?
No such luck, I’m afraid. Said one researcher, “Each [bot] operates differently and might be triggered by different factors of the transaction,” he said. “The bots themselves are in competition with each other over who gets the reward. This is only the tip of the iceberg in the full picture of the bots out there, which makes it even more interesting.”
Enter the Flashbots
Of course, somebody out there put together a free, open-source “kit” from which you (or somebody with nefarious intent) can assemble your own bots, set to be attracted to the transaction parameters of your choosing, with instructions personalized to that bot. But, the stereotyped 19 year-old guy with thick glasses who lives in a used camping trailer under a highway bridge is not the only one who can do these shenanigans. The miners themselves can make choices about which transactions to put before other transactions, so, the arguments against these bots often fails at this point. Most experts seem to agree that the current situation is not ideal, but it has the potential to improve the system drastically, over time.
Has there a reaction to these Flashbots?
Binance is a well-known cryptocurrency exchange, and has put together a policy statement on how they will fight these Flashbots. Their defense is organized around the following areas:
Defense | Comment |
Fast matching of transactions within blocks. | If the transactions are verified and executed quickly, these bots have a much smaller window of time in which to operate. |
Transparent Match Engine | The rules for matching and executing transactions are known by all participants, and anybody can “replay” the verification of a block, to ensure that the prioritization rules have been followed. |
Periodic Auction Matching | When the Auctions are Matched later, the bots work perfectly, too perfectly. So, these can be traced back to individuals, and there can be consequences. |
This is not a perfect defense mechanism, but it does seem to work pretty well.
The Verdict
Whenever anything new under the sun is trotted out, there is one and only one thing that can be counted on: The crooks WILL try to take advantage of this new mechanism to enrich themselves. So, given this, we seem to have 2 choices to remain safe. The first alternative is to not play in the cryptocurrency sandbox at all. This would prevent any front-running bots completely. But, we would have to forgo the potential benefits too, and that could be substantial. The second is to choose your cryptocurrency exchange very carefully.
REFERENCES
https://docs.binance.org/anti-frontrun.html
https://www.morningbrew.com/daily/stories/ethereum-gas-fees
Editor’s Note: Please note that the information contained herein is meant only for general education: This should not be construed as Tax Advice. Personal attributes could make a material difference in the advice given, so, before taking action, please consult your tax advisor or CPA.