Sending Transactions Fast with bloXroute’s Blockchain Distribution Network (BDN)
By bloXroute Labs Strategy & Operations Eleni Steinman
It is no secret that speed is everything in traditional finance; microseconds can determine who makes money and who loses it. If you thought this race hasn’t made its way to DeFi, you’d be mistaken. While the race may not be down to microseconds, yet, speed still matters.
This article will focus on why DeFi Traders should care about fast transaction propagation and how to take advantage of bloXroute’s Blockchain Distribution Network (BDN) for fast transaction propagation.
WHY DEFI TRADERS SHOULD CARE ABOUT TRANSACTION SPEED
Simply put, because you can make more money.
The importance of speed is particularly apparent for protocols that have a “race component,” which is often used to incentivize an action and is accompanied by an economic reward. For example, on Compound, Liquidators are incentivized to liquidate collateral when loans are underwater by repaying the borrowed funds, and in return receive the liquidated collateral with some discount.
To be successful, Liquidators must be the first to act on a liquidation opportunity, thus speed of transaction execution can be the defining factor of who wins a liquidation race.
And there’s a lot of money on the line. According to DragonFly Research, “Over the lifetime of these protocols, we’ve seen nearly $5MM in profits for liquidators. In certain cases, we’ve seen some liquidators net over $100k in a single liquidation.” Even more so, there is only one winner per liquidation, thus every Liquidator that tries to win the race not only loses the liquidation, but also wastes ETH on gas and liquidation calls.
Arbitrage opportunities arise when there is a pricing mismatch between two different exchanges. Traders can take advantage of this price mismatch by purchasing the asset on one exchange and simultaneously selling at a higher price on another exchange, profiting the difference. The quicker a trader can buy and sell the asset, the lower the risk of the trade and the greater the chances the trader can capture this opportunity. Put another way, if both trades are not executed in perfect synchrony, there is a chance that the second trade is completed by another actor, leaving the arbitrageur with an asset (the buy side).
For example, if the price to buy ETH with DAI on OasisDex differs from that on Uniswap, a trader can buy the undervalued asset (e.g. ETH with DAI on Oasis) and sell the overvalued (e.g. ETH for DAI on Uniswap) to capture this arbitrage opportunity. Speed of transaction execution will determine which trader gets to profit from this mismatch.
Like liquidation, there is a lot of money on the line. According to bloxy.info, since 2017 $11.8M has been made from arbitrage opportunities on Ethereum, with as much as $1.8MM made in a single transaction.
Increases Your Chance of Being Mined in Next Block
Faster transaction propagation means your transaction reaches miners sooner, increasing your chances of inclusion since a transaction a miner hasn’t seen has no chance of being included.
Let’s do some back of the envelope math.
In Ethereum, a new block is added roughly every 13 seconds, thus there is a 1% chance that the next block will come in the next 130 milliseconds (1-e^(-0.13/13) = ~1%). This means, given an appropriate gas fee is paid, every 130 milliseconds of speed will increase one’s chances of getting in the next block by roughly 1% (because there is a 1% chance a block will be mined and you will just miss it) and should increase the value of your trading strategy by 1%.
While faster transaction propagation speed alone does not ensure your transaction will be in the next block, albeit gas price likely plays a large role, having your transaction reach a miner sooner undoubtedly increases your chances of being included in the next block. This extra time may unlock new trading strategies and make current ones more valuable.
Lastly, speed is of particular importance when Ethereum is congested. During Black Thursday (3/12/2020), gas prices rose so fast that transactions quickly became stale and users raced to modify transactions to stay ahead of the rising price. A slight edge could have made the difference between a transaction being executed at all.
Hearing of Transactions Faster
While this article focuses on the sending side of the equation, it’s worth noting that hearing about transactions faster can also provide value to traders. This is because hearing about pending transactions may provide a signal to inform a more profitable trading strategy or allow Liquidators and arbitrageurs to identify opportunities slightly faster, and thus create a transaction sooner.
We’ll write another post about how to subscribe and take advantage of bloXroute’s transaction stream to directly hear about transactions faster. In the meantime, to show that transactions and blocks are heard faster from the BDN, we’ve made our BDN’s statistics publicly available here. Under BDN Efficiency, Users can see the percent of transactions and blocks that Gateways (described in more detail below) hear first from the BDN rather than P2P network (i.e. transactions that were propagated faster with the BDN).
In this 24-hour window, Gateways heard about blocks first from the BDN 88.8% of the time and transactions first from the BDN 70.3% of the time. Put another way, the BDN sent blocks faster to the Gateway than the P2P network sent to the Gateway 88.8% and 70.4% of the time, respectively. (Note: this number will never be 100 as the initial proposed block will always be sent from a node to the Gateway for propagation.)
CONNECTING TO THE BLOXROUTE BDN
Connecting to the bloXroute BDN can help traders send and hear of transactions faster.
bloXroute’s BDN consists of Relays, high-end servers that transmit blockchain messages (transactions and blocks) in an efficient manner, and an entry point, either a Gateway or bloXroute’s Cloud-API.
The bloXroute BDN is built to complement the peer-to-peer network, not replace it. It sits underneath the consensus mechanism, propagating data fast to boost the efficiency of the network. Integration is designed to be seamless and should take less than an hour.
Traders can take advantage of this fast highway by connecting either: 1) using a node, 2) using the bloXroute-cli, or 3) using the bloXroute Cloud-API.
Connecting From a Node
Users that run full nodes can access the BDN through a Gateway, a small piece of open-source software, typically implemented on a server with low latency to the blockchain client. From the perspective of the blockchain node, the Gateway is simply another peer in the network.
It is important to note that Gateways are not controlled by bloXroute — they are controlled by the User as they are run on the User’s infrastructure. On one end, a Gateway speaks the Ethereum “language” with an Ethereum full node, and on the other end it speaks the bloXroute “language” with bloXroute’s Relays.
Users send a transaction to their full node and the transaction propagates to peer nodes, as usual. However, one of these peer nodes is the bloXroute Gateway, which sends the transaction to the BDN for quick propagation and is received by all the other Gateways and nodes.
Another way a User can send a transaction to the BDN is to directly invoke the Gateway-API. The Gateway-API can be called from the bloxroute-cli or directly using a curl / https request. The bloxroute-cli is a command line interface to communicate with the bloXroute Gateway-API. A User can send a transaction directly to the Gateway for propagation without first sending the transaction to a full node. This option is slightly faster as one step is removed — the transaction does not have to be processed by a node . Users can still send transactions to the node before/after sending it to the bloXroute-API.
The bloXroute Cloud-API allows you to directly send your transactions to our BDN, bypassing the Gateway and, if desired, a full node. This option is perfect for Users who do not run a full node. Transactions can be sent from the bloxroute-cli or directly using a curl / https request. The bloXroute Cloud-API is a set of endpoints that allow users to send and receive data from the BDN. Users can send transactions to the Cloud-API in the same format as sending to the bloXroute-API.
We always want to hear from users. If you’re interested in using any of our services or have questions, please contact firstname.lastname@example.org
— — — —