How We Get the Best Price
Tristero's trade simulations enable world class trade execution
The best crypto trading prices on the market are on defi venues where fee competition is very robust, but it's not easy to find them and a lot can go wrong. Tristero has built a world class execution engine to make sure you actually get the best price. But its easy to say "we have the best prices", and harder to actually deliver:
How You Get Wrecked On Price
Suppose you go to make a trade on defi. Naively, you would probably start by going around to various defi venues to find one that supports your desired trade, get quotes, pick one with a good price, and try to execute it. Here's what would go wrong for you:
-
The actual best price at any moment may be in unintuitive routes or even private market makers with sub-second time limits that can only be accessed programmatically.
-
The quotes are probably "optimistic" overestimates; since the best quote typically gets the trade, venues overstate the quotes and then underdeliver.
-
MEV bots will frontrun your trade forcing you down to the lower end of your slippage tolerance. Your trade is vulnerable and sitting in the mempool for anyone with the right machinery to see and preempt.
We have engineered solutions to all of these problems, building a sophisticated system to execute your trades at the highest possible quality.
Our Liquidity Sources
When your trade comes in to Tristero, we can source liquidity from any of three possible sources:
-
Our own darkpool orderbook. As users place trades with us, we can match them up or string them together (including with our own automatic market making) to fill your trade with no middlemen and no possibility of frontrunning to extract MEV, meaning the best possible prices.
-
Centralized exchanges. We might rapidly fill your trade by a variety of means backed by centralized exchange venues like binance, hyperliquid, lighter, etc.
-
Off-the-shelf defi venues. We go find the best route through existing defi liquidity sources for your particular trade at any given moment. This is our main source of liquidity.
None of these will always be the best option. The last one has been our primary focus so far as the easiest source of great prices. But it's not trivial. As detailed above, there are many ways to lose money, and many systems we have had to design to ensure best results:
Our Execution Pipeline
We attack the problem of optimal defi trade execution with a number of innovations we apply as a trade moves through the phases of the execution process:
Phase 1: Candidate Route Finding
Our first step is to construct a list of candidate trade routes from the known supported routes of each venue. Candidate routes are usually just single-venue swaps, but could also involve chaining through multiple venues if the prices are advantageous or if the direct trade isn't available. We then narrow this down by various heuristics to a final candidate set.
Because our whole pipline moves quickly, we are also able to give you access to private market makers and other liquidity sources with very tight time limits in this search for candidates that would be otherwise inaccessible to human traders.
Phase 2: Trade Simulation
Instead of trusting the provided quotes for each candidate, we directly simulate the trade outcome on our nodes as if the trade had gone through at the end of the last block. The simulation uses the known calldata and known blockchain state, taking advatage of referential transparency. This gives us a very accurate and unbiased picture of what the trade will actually do, without quote distortions or MEV bot attacks. Using these accurate estimates, we select the best route for your trade.
Phase 3: Permit2 Quote Signing
We continuously re-run the simulation and selection to keep the prices updated until you act to authorize the swap. At that point we fix the quote with an authorized slippage tolerance of 50 bps. This authorization is signed privately off-chain, so it cannot be frontrun by adversaries. The slippage tolerance here is primarily protection from unexpected price movement, not adversarial front-running.
Phase 4: Wrapping In a Guard Transaction
Once the trade is authorized, we run the simulation one final time to get the most accurate possible estimate of what we expect the trade to output. Then we wrap the trade transaction(s) in a guard transaction that enforces very tight slippage tolerance, for example 10 bps. This makes it dangerous and unprofitable to attempt MEV attacks against your trade; if someone moves the price against you, your transaction just gets rolled back and they eat the fees. Extremely tight tolerances are possible because the simulation gives us a very accurate estimate of what the trade will actually do.
We also enforce the 50bps quote slippage tolerance here. Since the simulation and trade execution are so close in time, the tight slippage limit there only protects against MEV attacks and other execution anomalies, not price movement since you signed off on the quote.
Phase 5: Rapid Execution
On chains where there are flash blocks and other mechanisms to get the trades to run close in time to the previous block and thus to the simulation, we use them to increase execution certainty and protect you against bots and market fluctuations. Rapid execution meant also building great systems for high performance transaction construction, nonce-handling, latest block awareness, etc. Effectively, we built the machinery of a Maximum Extractable Value (MEV) bot, but for your benefit.