Front-running is a kind of insider trading with financial assets that long predates cryptocurrencies and cryptocurrency exchanges. If you are a broker, the idea is self-evident. Knowing that your client is going to make a large purchase on the exchange, which will naturally increase the asset value, you simply buy some for yourself first, then sell it at the higher price. Profit!

Front-running is even simpler on decentralized exchanges, where information about transactions (i.e. purchase and sale offers before they occur) is absolutely transparent. There is no need to possess any insider information; it is there, on the blockchain.

This is how it happens in practice on the DEXes that work on the Ethereum blockchain: Trader 1 sends an order to the blockchain, where Trader 2 (actually an automatic bot) sees it and comes forward with a higher “gas,” or commission. This way, Trader 2’s transaction is carried out first and Trader 1 doesn’t get the price they were counting on. The difference in price goes to Trader 2. Profit!

Cryptocurrency trading services consider front-running one of their main problems, even though they themselves often front-run their clients. As mentioned above, front-running is also a problem for exchanges, and they employ various countermeasures to fight it.

The STON.fi decentralized exchange works on the TON blockchain, where the pattern described above cannot be implemented, since the TON follows the FIFO principle (first in, first out). Therefore, front-running in its pure form is impossible on STON.fi.