Tempo's Stablecoin DEX is a decentralized exchange built directly into the Tempo blockchain for trading between stablecoins of the same underlying asset, such as one USD stablecoin for another. It runs as a single precompiled contract at 0xdec0000000000000000000000000000000000000 and keeps an onchain orderbook that matches orders by price-time priority (Tempo Docs, Exchanging stablecoins).
The DEX is not a general trading venue for volatile assets. Tempo's specification says it currently supports trading only between TIP-20 stablecoins whose currency is USD (Stablecoin DEX Specification). This article explains how pairs are formed through quote tokens, how swaps route across them, what order types exist, how flip orders work, and what a trade costs. For background on the chain itself, see What Is Tempo Blockchain?
What is the Tempo Stablecoin DEX?
The Tempo Stablecoin DEX is an enshrined exchange, meaning it is part of the protocol rather than a contract deployed by a third party. Users and apps swap stablecoins against resting orders, and market makers post liquidity at chosen prices. Tempo says the design aims for good pricing on cross-stablecoin payments while limiting chain load from heavy market activity.
Tempo's docs describe the DEX as a singleton precompile at address 0xdec0000000000000000000000000000000000000 with separate queues for each price tick (Tempo Docs, Exchanging stablecoins). The specification's stated motivation is high-quality execution for cross-stablecoin payments while "avoiding unnecessary chain load and minimizing mid-block MEV surfaces" (Stablecoin DEX Specification, Motivation). The contract exposes functions to create pairs, place and cancel orders, execute swaps, produce quotes, and manage internal balances (Stablecoin DEX Specification).
How is the Stablecoin DEX different from the Fee AMM?
They are two separate systems. The Stablecoin DEX is the user-facing market where people trade at market prices. The Fee AMM is protocol liquidity that converts transaction fees into each validator's preferred stablecoin at a fixed price, and Tempo states it is not a trading venue.
Tempo's documentation lays out the split in a comparison table (Tempo Docs, DEX vs. Fee AMM):
Stablecoin DEX | Fee AMM | |
|---|---|---|
Purpose | User-facing stablecoin trading | Converting transaction fees into validators' preferred tokens |
Who initiates swaps | Users and apps | The protocol, automatically (plus arbitrageurs rebalancing) |
Pricing | Market-driven onchain orderbook, price-time priority | Fixed conversion price |
Liquidity | Limit and flip orders resting in the orderbook | LP deposits into per-pair fee pools |
Contract | Stablecoin DEX precompile (0xdec0...0000) | FeeManager precompile (0xfeec...0000) |
Tempo's guidance is direct: to trade stablecoins or read pairs, swaps, orders, and prices, use the DEX; to let users pay fees in a stablecoin, use the Fee AMM (Tempo Docs).
How do quote tokens decide which pairs exist?
Every TIP-20 token names one quote token, and a trading pair exists only between a token and that designated quote token. Because no circular quote relationships are allowed, liquidity forms a tree. That tree guarantees exactly one path between any two USD stablecoins on the DEX (Stablecoin DEX Specification).
The specification lists two requirements: each token picks a single other stablecoin as its quote token, and quote token relationships cannot have circular dependencies. USD tokens can only choose USD tokens as their quote token, and prices for each pair are denominated in units of the quote token (Stablecoin DEX Specification, Quote tokens). Tempo says this reduces liquidity fragmentation and simplifies routing (Tempo Docs, Quote tokens).
At the root of the tree sits pathUSD, a neutral USD stablecoin issued by Bridge and the first stablecoin deployed on Tempo, so it has no quote token of its own. Tempo describes it as a neutral option so that no single issuer has a privileged position in the liquidity graph, and notes that using it is optional (Tempo Docs, Why pathUSD?). OUSD, which Tempo calls its recommended stablecoin, uses pathUSD as its quote token (Tempo Docs). For more on pathUSD's role, see What Is pathUSD? Tempo's Fee Stablecoin Explained.
How does routing work between two stablecoins?
A caller can swap between any two USD TIP-20 tokens, even if they are not paired directly. The DEX finds the unique path between them through quote-token relationships and executes a multi-hop swap in one transaction. Neither party needs to hold the intermediate token (Tempo Docs, Quote tokens).
Tempo's specification states that if tokenIn and tokenOut are not directly paired, the implementation "finds the unique path between them" and performs a multi-hop swap or quote (Stablecoin DEX Specification, Swaps). Tempo's worked example: market makers provide liquidity for USDX/pathUSD and OUSD/pathUSD, a user sends USDX to a merchant who settles in OUSD, and the DEX routes USDX to pathUSD to OUSD atomically. The user and merchant never hold pathUSD (Tempo Docs, Example: Cross-Stablecoin Payment).
Within a pair, selling base for quote starts at the best bid and walks downward as ticks empty; selling quote for base starts at the best ask and walks upward. Fills inside a tick are first in, first out (Stablecoin DEX Specification).
What order types does the Tempo DEX support?
The DEX supports three order types: limit orders, flip orders, and market orders. Limit and flip orders rest in the book and provide liquidity. Market orders are executed through swap functions that fill immediately against the best available orders.
Tempo's documentation defines each one (Tempo Docs, order types):
Limit orders wait in the book at a set price until matched or cancelled, and are added to the book as soon as they are placed.
Flip orders automatically reverse to the opposite side when completely filled, which Tempo compares to a perpetual liquidity pool.
Market orders execute immediately via swapExactAmountIn or swapExactAmountOut, each with a slippage limit (minAmountOut or maxAmountIn) (Tempo Docs, Executing swaps).
Read-only quote functions, quoteSwapExactAmountIn and quoteSwapExactAmountOut, simulate a swap first. The specification requires quotes and swaps to use the same fill and rounding rules, though a successful quote does not by itself guarantee execution, because it skips token transfers and policy checks (Stablecoin DEX Specification, Swaps).
How do flip orders work?
A flip order acts like a normal resting order until it is fully filled. Then the DEX rewrites it in place, under the same order ID, on the opposite side of the book at a preset flipTick. This lets a market maker quote both sides of a pair repeatedly without placing new orders.
Tempo's example places a bid for 1000 USDG at $0.9990 with a flipTick at $1.0010. Once filled, the same order rests as an ask for 1000 USDG at $1.0010 and emits OrderFlipped; when that fills, it flips back to a bid (Tempo Docs, Providing liquidity). The flipTick must be greater than or equal to the tick for bids and less than or equal to it for asks (Stablecoin DEX Specification, Flip orders).
A flip draws funds only from the maker's internal DEX balance. If that balance is short, the DEX does not fall back to transferFrom and the flip simply does not occur. Because of flip orders, the DEX permits crossed books where the best bid is above the best ask (Stablecoin DEX Specification).
How are prices and ticks set?
Prices are expressed as integer ticks around a 1.0 peg, with one tick equal to 0.1 basis point. Orders can only sit on ticks divisible by 10, so the working grid is 1 basis point. Ticks are capped at plus or minus 2000, which limits orders to within 2% of peg (Stablecoin DEX Specification).
The formula from Tempo's docs is tick = (price - 1) x 100,000, so a $0.9990 price is tick -100 and $1.0010 is tick 100 (Tempo Docs, Understanding ticks). The specification sets PRICE_SCALE at 100,000, TICK_SPACING at 10, and a minimum order size of 100,000,000 base units, which is 100 tokens with six decimals (Stablecoin DEX Specification, Constraints).
Parameter | Value per Tempo |
|---|---|
Contract address | 0xdec0000000000000000000000000000000000000 |
Supported currency | USD TIP-20 stablecoins only |
Tick size | 0.1 bp (orders on a 1 bp grid) |
Tick bounds | Plus or minus 2000 ticks (plus or minus 2%) (DEX spec) |
Minimum order | 100 tokens (six decimals) |
Matching | Price-time priority, FIFO within a tick |
Values in this table come from the Stablecoin DEX Specification.
What does a swap cost on the Tempo DEX?
Tempo's documentation describes swap costs in terms of gas, and makers earn the spread between their bid and ask prices. Gas for a swap scales with how many orders and price ticks the trade crosses, so there is no fixed cost per unit of volume.
Tempo lists the components as a base swap cost, a per-order cost for each order filled, a per-tick cost for each price level crossed, and a per-flip cost if flip orders are triggered (Tempo Docs, Gas costs). On the maker side, Tempo says liquidity providers "earn the spread between bid and ask prices" when orders fill (Tempo Docs, Providing liquidity), and storage credits from the T7 network upgrade can reduce gas for active makers who repeatedly place, cancel, or fill orders (Tempo Docs).
What is a DEX balance?
A DEX balance is a per-token balance the exchange records for each trading account, separate from tokens held at the account's address. Fills credit proceeds there, and users withdraw when they want tokens back in their wallet. Keeping funds on the DEX avoids a token transfer on every trade.
When a user swaps or places an order, the DEX first uses the available DEX balance and pulls any shortfall from the wallet. The DEX has implicit approval, so no separate token allowance is needed, though the pull still checks balances, transfer policies, and access-key spending limits (Tempo Docs, DEX balances). Cancelled orders refund unfilled amounts to the DEX balance, and only the order owner can cancel (Tempo Docs, Cancelling orders).
Frequently asked questions
These short answers restate points from Tempo's exchange documentation. For network details such as chain ID and RPC, see Tempo Mainnet Launch Date, Chain ID, RPC and Upgrades, and for gas tokens see Does Tempo Have a Token?
Can I trade non-USD stablecoins on the Tempo DEX?
Not currently. Non-USD TIP-20 tokens can set a quote token, but the specification says there is no support yet for cross-currency trading or same-currency trading of non-USD tokens (Stablecoin DEX Specification).
Do I have to use pathUSD as a quote token?
No. Tokens can list any other USD TIP-20 as their quote token (Tempo Docs, Quote tokens).
Is the Tempo DEX an AMM?
No. It is an onchain orderbook where makers set exact prices, unlike traditional AMMs, according to Tempo Docs.

