What is DEX and how it works

Learn what a decentralized exchange (DEX) is, how it differs from centralized platforms, and how STON.fi enables direct token swaps on the TON blockchain.

You’ve probably already heard of decentralized exchanges before. Names like Uniswap, Curve, Sushi come up often when people talk about DeFi. But what do these platforms actually do and why are there so many of them?

circle-info

A decentralized exchange, or DEX is a system of smart contracts that allows users to swap one crypto asset for another directly on a blockchain, without intermediaries like banks or centralized exchanges. There are no accounts, no custody, and no order books in the traditional sense: everything happens on-chain.

Instead of trusting an exchange to hold your assets, you interact with smart contracts that execute swaps according to predefined rules.

What makes a DEX different from a centralized exchange

On a centralized exchange (CEX):

  • You create an account

  • Deposit funds into the exchange

  • Trades happen inside the exchange’s internal system

  • The exchange controls custody and execution

On a DEX:

  • You control your assets via your own non-custodial wallet. Read more on what a crypto wallet isarrow-up-right.

  • There is no registration or account balance held by the platform

  • Every swap happens on-chain via smart contracts

  • You approve each transaction yourself

In short: on a DEX, you stay in control from start to finish.

Are DEXs locked within one blockchain?

DEXs can operate on a single blockchain or across multiple blockchains:

  • Single-chain DEXs are built specifically for one network. For example, Uniswap originally launched on Ethereum, Jupiter operates on Solana, and DeDust is native to TON.

  • Multi-chain DEXs support swaps on several blockchains, either by deploying the same protocol on multiple networks (like Uniswap on Ethereum, Polygon, and Arbitrum) or by routing liquidity across chains using bridges and messaging layers.

Despite these differences, most DEXs rely on a similar core mechanism: liquidity pools. Instead of matching buyers and sellers, users swap against pools of tokens provided by other users. Prices are determined algorithmically, based on pool balances and predefined formulas.

How swaps work on a DEX

DEXs don’t use order books where buyers and sellers wait to match. Instead, swaps happen against liquidity pools.

circle-info

A liquidity pool is a smart contract that holds two tokens and allows users to swap between them instantly. Prices are determined algorithmically based on the ratio of assets in the pool.

When you make a swap:

  • You choose the token you give and the token you receive

  • The smart contract calculates the rate

  • The swap executes immediately, using pool liquidity

  • The result is written to the blockchain

Why smart contracts matter

Smart contracts are programs stored on the blockchain that automatically execute actions when conditions are met.

On a DEX, smart contracts:

  • Calculate swap outcomes

  • Enforce rules consistently

  • Execute transactions without human intervention

  • Make all operations transparent and verifiable

This is what allows a DEX to function without a central operator.

What you need to use a DEX on TON

To use a DEX on TON, you need:

  • A TON wallet (non-custodial)

  • Tokens in that wallet

  • A small amount of TON to cover blockchain fees

That’s it.

How TON DEX mechanics differ

DEX mechanics on TON follow the same fundamental DeFi principles, but the underlying blockchain architecture introduces some important differences.

TON was designed for high throughput and low-latency transactions, with fast block times and asynchronous message passing between smart contracts. As a result:

  • Swaps on TON feel closer to “instant” execution from a user perspective

  • Smart contracts interact differently compared to EVM-based chains like Ethereum

  • Liquidity and routing logic must be adapted to TON’s message-driven model

Because of this, TON-native DeFi protocols are not simple copies of other blockchains designs. Liquidity pools, swap routing, and transaction flows are implemented with TON’s architecture in mind.

STON.fi is a DeFi protocol built natively on the TON blockchain that provides decentralized exchange functionality as part of a broader on-chain financial infrastructure. Our role is to provide reusable on-chain components that make core DeFi operations possible, predictable, and composable for users, wallets, and applications across the TON ecosystem.

Last updated