Exchanging Stablecoins
Tempo features an enshrined decentralized exchange (DEX) designed specifically for trading between stablecoins of the same underlying asset (e.g., USDC to USDT). The exchange provides optimal pricing for cross-stablecoin payments while minimizing chain load from excessive market activity.
The exchange operates as a singleton precompiled contract at address 0xdec0000000000000000000000000000000000000. It maintains an orderbook with separate queues for each price tick, using price-time priority for order matching.
Trading pairs are determined by each token's quote token. All TIP-20 tokens specify a quote token for trading on the exchange. Tokens can choose pathUSD as their quote token. See the Stablecoin DEX Specification for detailed information on the exchange structure.
The exchange supports three types of orders, each with different execution behavior:
| Order Type | Description |
|---|---|
| Limit Orders | Place orders at specific price levels that wait in the book until matched or cancelled. New orders are queued and added to the book at the end of the block. |
| Flip Orders | Special orders that automatically reverse to the opposite side when completely filled, acting like a perpetual liquidity pool. Filled flip orders automatically create new orders on the opposite side during end-of-block settlement. |
| Market Orders | Execute immediately against the best available orders in the book (via swap functions). Swaps and cancellations execute immediately within the transaction. |
This execution model prevents MEV by making it impossible to backrun new orders or perform JIT liquidity attacks. For the complete execution mechanics, see the Stablecoin DEX Specification.
To get started with the exchange, explore these guides: