Tezos DEX aggregator evolution: 3Route v2.
Baking Bad team is grateful to all users of the Tezos DEX aggregator 3Route! Almost 400 users have interacted with 3Route smart-contracts and made over 3,500 trades in 2022! We want as many Tezos DeFi users as possible to use 3Route, aiming to make their experience and results better than ever. Every user is part of an ecosystem that we strive to make more efficient! So feel free to tell us about your experience and share it with the community!
So, we released the new version of the 3Route v2 contract, and we want to shortly talk about its benefits.
Satoshi tokens on the contract balance. Why?
Now you can see the minimum amount of each token involved in the routes of the trade on the balance of the smart contract: tzkt.io/KT1Tuta6...ogLQ9/balances. This reduces the possibility of an error "Storage quota exceeded for the operation", which could cause some trades to fail (see example).
If there are no tokens on the contract’s balance that is involved in the route, the 3Route contract will leave a minimum amount of that token (0.00...01) during the transaction. Hope you won't be very upset if this happens during your trade. Amount is equal to the minimum token step and has almost zero value. This situation may arise in your path when we will add new tokens to 3Route.
So, we reduced the probability of a trade failure and at the same time reduced the cost of trading.
Front-running in Tezos
This is a common issue in trading any markets, either CEX or DEX. Front-running on DEX occurs when another trade in a block is inserted before your trade, which changes the market condition. 3Route executes on many DEXes at the same time, so a change of pool’s state on any of the DEXes at runtime could potentially cause a transaction to fail. As a result, your deal goes bust or executed at a worse price. We've added a
minOut parameter to the 3Route smart contract that looks at the totals of all routes as a whole, rather than each route separately, as it was in the first version of the contract. This does not completely rule out the possibility of front-running, but it does reduce the chance that your operation will fail, considering the Slippage settings (the default is 0.5%).
There are also some more mechanisms of front-running protection, which we will implement a little later and will definitely inform you about it. Make sure you stay tuned!
Tezos smart-contract events in 3Route
Added Events, which contain the parameters of each trade. Now you can easily get the history of all transactions in 3Route. It's more of an additional opportunity for our own analytics and the ability to draw charts in the future. However, if you found it useful for yourself, great!
Send us your ideas for events that would be useful to add in future updates of the contract.
We have optimized gas consumption by contract. Now the cost of contract calls has decreased a little. Not much, but we will work on further optimization!
Thank you for your attention and for staying with us!