Titan Backtest Report
Published: 2024-11-19
Updated: 2024-11-19
To demonstrate Titan’s performance, we have prepared a backtest report to showcase the performance of Titan’s platform versus others.
This backtest was performed on data taken around slot 296946213. We used a time limit for determining the routes in this test to mimic real life latency requirements. As the the data in the test is static, this represents a best case scenario in terms of performance for both algorithms. In practice, both algorithms will perform worse than outlined here because the Solana ecosystem is not naturally static and the behaviour of pools varies as other users execute swaps through them.
Most DEX aggregators take some variation of shortest path style algorithms for solving the routing problem. By leveraging these algorithms, the aggregator has the advantage of using well researched and battle-tested algorithms which are relatively straightforward to implement and are known to be fast even on large networks.
These algorithms begin by representing the various tokens as nodes and the various pools as edges in a graph. Each pool has a spot price associated to it which represents the cost to travel from the current token to the neighbouring token. The simplest DEX aggregator would find the shortest path using some variation of Dijkstra’s shortest path algorithm and provide this route to the user. In general, some modifications must be made to these algorithms to account for negative cycles that naturally occur in cryptocurrency markets. These modifications must either sacrifice the running time (and thus the slippage), or the guarantees of optimality for the solution.
In addition, these routes are prone to slippage since they fail to capture the user’s price impact. As the user increases the volume they sell to a particular market in exchange for a new token, they will find that their average price paid worsens. To capture these effects, the graph can be expanded by breaking each individual edge into many edges. Each edge represents an average price paid, with a capacity set in order to approximate the price impact. In doing this, the problem is transformed into a kind of minimum cost flow problem.
This approach allows the user to maintain the benefits of using polynomial time graph algorithms. However, there is an increase in running time when increasing the size of the graph to account for price impacts. Proponents of this algorithm must try to balance the loss in precision without allowing the problem to grow to a scale where it can no longer be reasonably solved.
At Titan, we use our own proprietary approach to solving the routing problem which is able to avoid these pitfalls by making use of various techniques from convex optimisation. As a result, Titan is able to provide significantly better routes than others while simultaneously solving the problem to any desired precision the machine is capable of. Most importantly, our approach allows us to properly resolve the price impact the user will have when making a swap through a particular exchange. To begin, we consider a handful of popular tokens at the time of writing that exist with the slot that we are testing on.
Token List
We select a variety of tokens which we believe captures a wide variety of scenarios and demonstrates each algorithms capacity to peform in scenarios of highly liquid pairs. The purpose of this table is not to indicate any particular preference to various tokens but helps to capture the wide variety of trading that takes place in the Solana ecoystem.
Results
Naturally, the first question we are interested in asking is how our algorithm is able to perform against Jupiter. In order to keep the analysis as realistic as possible, we have left Jupiter unconstrained in its search for the optimal route in terms of which venues it could use.
To make clear how frequently we are able to outperform Jupiter, as well as give some indication of the range of performances observed, we provide a heatmap showing how the algorithms compare on each pair of tokens. We have chosen to swap approximately $1,000 USD in notional value for each token pair. We chose this in order to keep the value being swapped consistent across each token, at a common notional value traders usually trade at. This ensures that there is some price impact and complex optimization must actually be performed to find a good route, rather than just a search of spot prices.
In this experiment, Titan’s algorithm outperforms 87% of the time, up from the original 81% presented in October. We also find that the algorithm is able to perform significantly better than Jupiter in some cases, with a maximum outperformance of up to 25%.
Slippage against Volume
To give some idea of how Titan’s algorithm copes with various volumes, we consider four separate SOL pairs, SOL-USDC, SOL-USDT, SOL-WIF, SOL-BONK. By swaping various volumes ranging from $0.01 USD to $50,000 USD in notional values we can get an idea of how the algorithm deviates from the best possible price when swapping low volumes with nearly no price impact, versus large volumes where the price impact can be significant.
Generally, Titan is able to match or outperform Jupiter’s routing algorithm even at higher values. With most trades being clustered at lower notional values, users of Titan will be happy to find that Titan routinely outperforms by a wide margin.
Some Notes on Execution
Titan is once again taking a different approach to our competitors in regards to execution. Instead of sacrificing the performance of our quotes by shortening the routes, increasing the user’s exposure to sandwich attacks, or asking users to pay higher fees, we are building slippage awareness into the core of our optimisation algorithm.
By creating forecasts of how pools behave in the future, we can estimate the tail risk experienced along a particular route. Given that there is a delay between the time a user selects a route and performs the swap, this allows us to not only maximize their output, but also minimize their exposure to this tail risk. This will increase the outperformance users get on Titan as they continue to use Titan as their preferred platform.