How a DEX works
A centralized exchange keeps your coins in its own wallets and matches buyers with sellers in an order book. A DEX does neither. The exchange is a set of smart contracts on the blockchain, and you trade from a wallet you control: you sign a transaction, the contract runs it, and the tokens land back in your wallet.
Most DEXes have no order book at all. They are automated market makers: each Trading pair has a Liquidity pool holding reserves of both tokens, and a formula sets the price from those reserves. You do not wait for another trader. You trade against the pool, and every trade moves its price a little. The bigger the trade compared with the pool, the more it moves: that is Price impact.
The reserves come from liquidity providers, ordinary users who deposit both tokens and get LP tokens back. They earn part of the fee every trade pays.
DEXes on TON and how DYOR tracks them
The main DEXes on TON are STON.fi, DeDust and TONCO. DYOR reads the pools and trades of all three straight from the chain, and that is where the volume, liquidity and price on a token page come from. The Markets table on each token page lists the pools the token trades in: the DEX, the pool, its liquidity, its 24-hour volume and the share of the token's volume it takes. From there you can open a pool's own page with its reserves, fee and fee APR.
A swap on TON is not one transaction but a chain of messages. When you sell a Jetton, your Jetton wallet sends the tokens to the DEX's jetton wallet with instructions attached; the DEX contract gets a notification, runs the pool's maths and sends the other token to your wallet. That is why a TON swap asks you to attach some GRAM for the network fee: whatever is left over comes back.
Every DEX trade is public. Search swaps finds them by token, wallet and size, which is how whale buys and sells get spotted. The table below shows the TON tokens with the most DEX volume over the last 24 hours.
DEX vs CEX
- Custody. On a DEX your tokens stay in your wallet until the trade. On a CEX you deposit them and the exchange holds them, so a hack or a frozen account hits you directly.
- Listing. Anyone can create a pool on a DEX, for any token, in minutes. That is why new tokens appear on a DEX first, and why scams and look-alike tokens do too.
- Access. A DEX needs no account and no KYC, only a wallet. A CEX asks for both.
- Price. A CEX price comes from its order book, a DEX price from its pool's reserves. On a thin pool a large trade can cost much more than the screen price because of Slippage.
Before you trade on a DEX
A DEX checks nothing. If a fake token sits in a pool, the contract sells it to you just the same. Check the contract address against the token page, run the token through Token check for liquidity, holder concentration and admin rights, and set a sensible slippage tolerance. To compare prices across several DEXes at once, use a DEX aggregator such as DYOR Swap.