Gap Analysis: Trade Execution for Cryptocurrency High-Frequency Trading
Plus a Deep Dive Into Orion Protocol
As part of a research sprint, GDA has set out to find working trade execution platforms with order book aggregation that can handle high-frequency trading (HFT). The intent is to focus on one solution and understand it, particularly examining any challenges they face..
While conducting this gap analysis, several options were considered to be the focus area of this sprint, notes below provide details as to why the final selection was chosen.
Polkadex is a highly interoperable platform boasting high transaction speeds of around 500,000 TPS. The core principle of Polkadex is to combine DEXs with CEX functionality via the implementation of AMM bots. However, Polkadex is still in development. A previous article of ours examines Polkadex in depth:
Research Sprint: Polkadex
This research sprint was undertaken as part of GDA’s gap analyses on development in the field of decentralized…
A solid platform previously explored by our team, but is not reviewed in further depth in this sprint on account of not including order book aggregation for HFT. Check out our article on Hummingbot here:
Research Sprint: Hummingbot
Why was Hummingbot created and can it be used as a quant trading system?
Another interesting solution previously explored, again glossed over in this spring on account of only offering CEX and spot trading.
Jump Trading is a high-frequency trading firm entering the crypto market, though Jump Crypto appears to still be in early stages. Documentation is relatively high level and alludes primarily to business and planning aspects.
Krypto Trading Bot
Krypto Trading Bot is a popular cryptocurrency high-frequency trading (AMM bot) repository on GitHub. It is a self-hosted trading bot written in C++, emphasising low latency. The bot is compatible with the following exchanges:
With Maker and Taker Fees:
- REST + WebSocket + FIX
- REST + WebSocket
- REST + WebSocket
- REST + WebSocket
- REST + WebSocket
- REST + WebSocket
- REST + WebSocket
- REST + WebSocket
Without Maker Fees
- REST + WebSocket
It is hard to evaluate the quality of the project without auditing the code or trying it ourselves, though as it is a public repository, both of these are possible.
Crypto Genius claims to offer high-frequency trading bots, though the legitimacy of the operation is questionable.
Bitbot is a robotic process automation (RPA) bot specializing in high-frequency cryptocurrency trading. Bitbot uses Ruby and Java microservices for its trading system, and Ruby on Rails for its backend. Bitbot uses built-in-house APIs to grab the following data:
- Exchange based balances
- Executed opportunities in last 30 days
- Average profit %, Largest profit %, Smallest profit %
- Potential opportunities
- Opportunities out of bounds
- History by days
- History by hours
- Values of dynamic parameters
The developers claim to have integrated machine learning into the trading system, however, there does not appear to be a lot of information on technical specifications such as algorithms or latency. The project does not appear to be readily available.
FINXFLO is a global cryptocurrency exchange aggregator. It features an “Exchange aggregation engine”, consolidated global order book and smart order routing. The consolidated order book aggregates liquidity from centralised and decentralised exchanges.
Like Orion protocol however, the platform does not offer futures/perp swaps, only spots.
TradeStation is an online trading and brokerage service not limited to just the crypto space. They offer limited liquidity aggregation, and do not include DEX access. They also do not offer many spots pairs, let alone any futures/perps.
Raydium is a liquidity aggregator for the Solana ecosystem with swapping and trading functionality. The AMM in the pools is directly connected to Serum’s central limit order book to give pools access to the order book and vice versa. This means that the best price will be quoted across the pools and order book.
Orion Terminal will aggregate every CEX, DEX, and swap pool into one decentralized platform. The platform is chain-agnostic, and currently seamlessly integrates Ethereum and BSC. More chains will be integrated in the future including Polkadot, Cardano, Avalanche, Fantom. The protocol is on chain, and it has swap functionality and a limit order book. Fees are paid in Eth or USDT at 0.3% or ORN, the native token for the platform, at 0.2%.
Regarding the platform as a HFT execution destination, they say this in their whitepaper:
Continuous development and constant optimization of the aggregator mechanism will provide the necessary speed and performance to meet the requirements of high-frequency trading (HFT). Algorithmic traders and other trading bots will be able to connect using unified APIs, allowing executions of trades at the most advantageous prices across a wide range of exchanges, all from a single platform. For large and high-frequency traders, special payment structures will be applied, which makes Orion very attractive compared to other exchanges.
What this platform lacks however, is tradable futures or perpetual swaps. When I asked about this in their community telegram, a dev got back to me saying that it is not something offered “at the moment”.
Deep Dive: Orion Protocol
What problems are they trying to solve?
In their white paper, Orion protocol bases their mission on a survey conducted by Encrybit, in which users ranked the importance of issues encountered when trading on existing cryptocurrency markets.
Orion Protocol offers more thorough explanations of specific target areas:
- According to CipherTrace, the total volume of cryptocurrency-related fraud and theft sum to $4.4 billion.
- Orion Protocol believes that the most vulnerable part of the modern cryptocurrency ecosystem is centralized exchanges — as transactions and withdrawals all route through the central servers of the exchanges.
Lack of Liquidity
- A lack of liquidity creates an imbalanced environment. Orders are not placed/executed on time, large holders have heightened potential for market manipulation and price volatility increases with slippage.
- Reduced liquidity also places more power into the hands of exchanges with high liquidity, enabling them to charge unreasonable fees for listing tokens — essentially selling liquidity to the projects.
Lack of Price Uniformity, High Trading Fees
- The price of cryptocurrency assets can vary dramatically across different exchanges, complicating the process of price charting and increasing market volatility.
Price Manipulation, Wash Trading
- The majority of cryptocurrency exchanges only employ light regulation to combat abusive manoeuvers. Reports suggest that some exchanges use bots to manipulate prices.
- A BitWise report from 2019 suggests that approximately 95% of Bitcoin trading volume is fictitious or non-economic in nature. This fictitious volume does not affect the real BTC spot market, which is smaller than stated and more regulated.
- Cryptocurrency delays happen, and sometimes are employed as a security device in response to suspicious activity such as fraudulent transactions or hacks.
How Do They Address These Problems?
Security and Centralization Concerns
Orion Protocol attempts to address concerns regarding security and centralization via their non-custodial policy, allowing users to store their funds how they choose, in personal wallets or cold storage.
Orion’s liquidity aggregator protocol is approaching DeFi’s liquidity problem by aggregating liquidity from across the entire cryptocurrency market into one decentralized platform. This is made possible by their cross-exchange order matching engine.
Orion Protocol’s proprietary staking mechanism is Delegated Proof of Broker, with the ORN utility token at its core. Using this token, all major platform activities can be paid for at a discounted price. By acting as a broker or providing liquidity (above the minimum deposit to participate), ORN can be staked in the decentralized brokerage, earning participants transaction fee revenue in return.
Non broker staking (NBS) allows users to stake ORN, using their staked amount to vote on brokers. NBS votes contribute to a broker’s total amount of staked ORN, increasing their chances of being chosen to fill an order. Brokers may incentivize voters by offering a portion of revenue in reward for their vote.
ORN holders also gain access to premium platform features such as margin trading, limit orders, stop market and stop-limit orders, stop loss and take profit; additionally, these users can be sent alerts for arbitrage opportunities and “other useful features”.
As payments within the Orion Protocol are handled in ORN, dApp developers uploading to the Orion marketplace may charge users for whatever service it is they provide, earning themselves more ORN.
What Obstacles Have They Encountered?
No institutional investors — the right problem for the wrong audience
While these platforms are setting out to solve an important problem, they do not fully understand the issue. Entities that are trading enough capital to require deep liquidity are typically your institutional investors. These market participants invest a lot of time and money into choosing and building relationships with the exchange/s they operate on in order to maximise their returns. Because centralised exchanges have been around the longest, have a large capital backing, and a contactable support and development team, they are well established in the crypto space. This makes it very difficult for new competitors, whether it be a centralised or decentralised solution, to gain a retail user base, and even more difficult for it to attract institutional users. For these users, there is just not enough incentive for them to transition to a new platform, especially if their in-house infrastructure is built for their current platform. If these new defi platforms like Orion and Raydium can attract institutional investors, then they would be in a much better position to compete with established centralised exchanges.
All of these platforms offer liquidity aggregation in some form. However, they still have poor liquidity on their aggregated order book. Most of this is due to early stage development. These platforms promise comprehensive market coverage across all (most) centralised and decentralised exchanges, however the reality right now is that this is not true. Many exchange connections have not been implemented yet.
No futures/perpetual swaps
At the time of this paper, no platform offers futures contracts or perpetual swaps. The only trading pairs that are available are on spot markets. The reason for this is likely tangent to the first problem identified regarding institutional investors. Because the platform is targeting/attracting retail investors, these traders mostly use spot markets which is why development focus is not on integrating futures or perps.
As is the nature of decentralised protocols that opt for an open source approach, development can be slow. Relying on community members to develop components of the platform in return for their own token can be a lacking incentive to fast track development.
What Services Do They Provide?
Orion Protocol attempts to address these issues in their services and architecture, which include:
- Based on Atomic Swaps
Decentralized Brokerage with Staking Mechanisms
Decentralized Finance Platform (DeFi)
Business-to-Business (B2B) services
Liquidity Aggregator (Liquidity Boost Plugin)
- Plugin for CEX and DEX exchanges to increase liquidity on their marketplace
- A custom designed matching engine connecting dozens of exchanges, using their combined order books to find the best spot prices
- Boasts the largest list of supported currencies on the market
Internal Price Matching Engine
- Peer-to-peer matching on internal DEX, decreasing reliance on third party exchanges
A Non-Custodial Platform
- Cold Storage and User-Controlled Wallets
- Funds may be transferred directly to user’s wallets, removing the need to store assets on the platform
- Optimizes price execution across exchanges from one account
- Facilitates high-frequency trades among multiple exchanges via a single API, reducing the time spent maintaining algorithms for HFT
- Revenue is generated through transaction fees and internal matching of orders
Portfolio Management Application
- A tool for tracking, rebalancing and trading assets
- Trade tracking tool
- Arbitrage opportunity signals
- Users can set up alerts for arbitrage opportunities
- Auto-rebalancing of holdings
- Users can select an asset mix and set criteria for rebalancing
- Revenue is generated through subscription fees, arbitrage trading fees and sales of analytics, research and signals
- Orion based applications and trading signals from independent developers are available on the dApp marketplace
- Arbitrage apps
- Algorithmic trading bots
- Investment funds
- Payment integration systems
- A widget allowing partnering firms and non-blockchain companies to integrate cryptocurrency trades directly on their applications and websites
- Large order split
- Best price available for the lowest fees
- Non-custodial liquidity provider
- Clients do not give away control of their funds
- Short selling
- Margin trades
- A platform for projects to launch their own DEX
The team behind the protocol have not released any information regarding an official transaction per second (tps) spec. From my understanding, the reason behind this is because it varies a lot depending on the chain the user is interacting with. Because different blockchains use different technologies and thus have different tps, quoting a tps for the platform would not be accurate.
Orion will enable fast trading among the connected exchanges through a single API call. This is extremely beneficial for traders executing HFT strategies. Live price feeds and order book data feeds are accessible in real time through web sockets and REST APIs. The APIs that provide connection to the platform will be standardised to provide a common ‘language’ for connecting to any exchange.
The Orion trading terminal is just one app built on the Orion protocol. It will offer an app store where community-made applications can be shared. Custom algorithms can also be implemented on Orion and distributed via the dApps marketplace. Other examples of dApps that could be built are arbitrage apps, trading bots, investment funds and payment integration systems.
Part of the protocol’s architecture is an order matching engine. The purpose of this component is to ensure trades achieve the most advantageous price by accessing the lowest asks and highest bids across all connected exchanges. The matching engine uses data from the price discovery module (another component within the architecture) to identify where the order should be sent, depending on the amount of the order and depth of the exchange.
Orders can have the following status:
- Partially filled
- Partially cancelled
The platform currently provides market and limit orders, however in their whitepaper they state that holders of ORN ( the platform’s token) will have access to advanced features including:
- Margin trading
- Stop market
- Stop loss control
- Take profit control
- Arbitrage alerts
Orion users can also control the following execution parameters:
- Start/End Time
- Price deviation
- Capital cost
- Choose the optimal order-splitting strategy
 Orionprotocol.io, 2021. [Online]. Available: https://www.orionprotocol.io/hubfs/whitepaper.pdf. [Accessed: 11- Nov- 2021]
 FINXFLO, 2021. [Online]. Available: https://www.finxflo.com/whitepaper.pdf. [Accessed: 12- Nov- 2021].