From 09dff72ec12afbc49d2d51c8d5a328f2df80f928 Mon Sep 17 00:00:00 2001 From: Liam Horne Date: Mon, 2 Feb 2026 22:30:07 -0500 Subject: [PATCH 1/2] Reorganize exchange docs Amp-Thread-ID: https://ampcode.com/threads/T-019c2186-633a-772f-83e0-6cd66b266286 Co-authored-by: Amp --- src/pages/protocol/exchange/index.mdx | 2 +- src/pages/protocol/exchange/pathUSD.mdx | 79 -------------------- src/pages/protocol/exchange/quote-tokens.mdx | 68 +++++++++++++++++ src/pages/protocol/exchange/spec.mdx | 2 +- vocs.config.ts | 4 +- 5 files changed, 72 insertions(+), 83 deletions(-) delete mode 100644 src/pages/protocol/exchange/pathUSD.mdx create mode 100644 src/pages/protocol/exchange/quote-tokens.mdx diff --git a/src/pages/protocol/exchange/index.mdx b/src/pages/protocol/exchange/index.mdx index a6ff9078..aa48036a 100644 --- a/src/pages/protocol/exchange/index.mdx +++ b/src/pages/protocol/exchange/index.mdx @@ -10,7 +10,7 @@ Tempo features an enshrined decentralized exchange (DEX) designed specifically f 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](/protocol/exchange/pathUSD) as their quote token. See the [Stablecoin DEX Specification](/protocol/exchange/spec) for detailed information on the exchange structure. +Trading pairs are determined by each token's quote token. All TIP-20 tokens specify a quote token for trading on the exchange. See [Quote Tokens](/protocol/exchange/quote-tokens) for more information on quote token selection and the optional [pathUSD](/protocol/exchange/quote-tokens#pathusd) stablecoin. See the [Stablecoin DEX Specification](/protocol/exchange/spec) for detailed information on the exchange structure. The exchange supports three types of orders, each with different execution behavior: diff --git a/src/pages/protocol/exchange/pathUSD.mdx b/src/pages/protocol/exchange/pathUSD.mdx deleted file mode 100644 index 86f978a9..00000000 --- a/src/pages/protocol/exchange/pathUSD.mdx +++ /dev/null @@ -1,79 +0,0 @@ ---- -description: pathUSD is a USD-denominated stablecoin serving as an optional quote token for DEX trading pairs and fallback gas token on Tempo. ---- - -# pathUSD - -## Abstract - -pathUSD is a USD-denominated stablecoin that can be used as a quote token on Tempo's decentralized exchange. It is the first stablecoin deployed to the chain, and is used as a fallback gas token when the user or validator does not specify a gas token. Use of pathUSD is optional. - -## Motivation - -Each USD TIP-20 on Tempo can choose any other USD TIP-20 as its [quote token](/protocol/exchange/spec.mdx#quote-tokens)—the token it is paired against on the [native decentralized exchange](/protocol/exchange/spec.mdx). This guarantees that there is one path between any two tokens, which reduces fragmentation of liquidity and simplifies routing. - -While on other chains, most liquidity accrues to a few stablecoins, or even one, Tempo offers a USD-denominated stablecoin, pathUSD, that other stablecoins can choose as their quote token. PathUSD is not meant to compete as a consumer-facing stablecoin. Use of pathUSD is optional, and tokens are able to list any other token as their quote token if they choose. - -pathUSD can also be accepted as a fee token by validators. - -## Specification - -### Contract - -pathUSD is a predeployed [TIP-20](/protocol/tip20/spec.mdx) at genesis. Note that since it is the first TIP-20 contract deployed, its quote token is the zero address. - -| Property | Value | -| ------------- | --------------------------------------------------------------------- | -| address | `0x20c0000000000000000000000000000000000000` | -| `name()` | "pathUSD" | -| `symbol()` | "pathUSD" | -| `currency()` | "USD" | -| `decimals()` | 6 | -| `quoteToken()` | `address(0)` | - -## How It Works - -When you create a USD stablecoin on Tempo, you can set pathUSD as its quote token: - -```solidity -TIP20 token = factory.createToken( - "My Company USD", - "MCUSD", - "USD", - TIP20(0x20c0000000000000000000000000000000000000), // pathUSD - msg.sender, - bytes32("my-unique-salt") // salt for deterministic address -); -``` - -This means: -- Your token trades against pathUSD on the decentralized exchange -- Users can swap between your token and other USD stablecoins that also use pathUSD, or ones that are connected to it by a multi-hop path - -### Tree Structure - -This creates a tree structure where all USD stablecoins are connected via multi-hop paths. - -``` - USDX - | - pathUSD -- USDY -- USDZ - | - USDA -``` - -The tree structure guarantees that there is a single path between any two USD stablecoins, ensuring simple routing, concentrated liquidity, and efficient pricing, even for thinly-traded pairs. - -### Example: Cross-Stablecoin Payment - -1. Market makers provide liquidity for USDX/pathUSD and USDY/pathUSD pairs -2. User wants to send USDX to a merchant who prefers USDY -3. DEX atomically routes: User's USDX → pathUSD → Merchant's USDY -4. Single action, no manual swaps - -This is critical for payments between parties with different stablecoin preferences. The user and merchant never touch pathUSD; it is used only as a routing mechanism. - - - - - diff --git a/src/pages/protocol/exchange/quote-tokens.mdx b/src/pages/protocol/exchange/quote-tokens.mdx new file mode 100644 index 00000000..4c9178fa --- /dev/null +++ b/src/pages/protocol/exchange/quote-tokens.mdx @@ -0,0 +1,68 @@ +--- +description: Quote tokens determine trading pairs on Tempo's DEX. Each TIP-20 specifies a quote token, with pathUSD available as an optional neutral choice. +--- + +# Quote Tokens + +Each USD TIP-20 on Tempo specifies a single other USD TIP-20 as its quote token. The quote token is the token it trades against on the [stablecoin exchange](/protocol/exchange/spec). This guarantees exactly one path between any two tokens, reducing liquidity fragmentation and simplifying routing. + +Tokens can choose any other USD TIP-20 as their quote token. Tempo provides pathUSD as an optional neutral quote token that other stablecoins can use. Use of pathUSD is not required. Tokens can list any other token as their quote token. + +## pathUSD + +pathUSD is a USD-denominated stablecoin that can be used as a quote token on Tempo's stablecoin exchange. It is the first TIP-20 deployed to the chain and serves as the fallback gas token when the user or validator does not specify one. pathUSD is not intended to compete as a consumer-facing stablecoin. + +### Contract + +pathUSD is a predeployed [TIP-20](/protocol/tip20/spec) at genesis. Since it is the first TIP-20 deployed, its quote token is the zero address. + +| Property | Value | +| -------------- | -------------------------------------------- | +| address | `0x20c0000000000000000000000000000000000000` | +| `name()` | `"pathUSD"` | +| `symbol()` | `"pathUSD"` | +| `currency()` | `"USD"` | +| `decimals()` | `6` | +| `quoteToken()` | `address(0)` | + +### Usage + +When creating a USD stablecoin on Tempo, you can set pathUSD as its quote token: + +```solidity +TIP20 token = factory.createToken( + "My Company USD", + "MCUSD", + "USD", + TIP20(0x20c0000000000000000000000000000000000000), // pathUSD + msg.sender, + bytes32("my-unique-salt") // salt for deterministic address +); +``` + +This means: +- Your token trades against pathUSD on the exchange. +- Users can swap between your token and other USD stablecoins that also use pathUSD, or ones connected by a multi-hop path. + +### Tree Structure + +Quote token relationships form a tree structure where all USD stablecoins are connected via multi-hop paths: + +``` + USDX + | + pathUSD -- USDY -- USDZ + | + USDA +``` + +The tree structure guarantees a single path between any two USD stablecoins. This ensures simple routing, concentrated liquidity, and efficient pricing even for thinly-traded pairs. + +### Example: Cross-Stablecoin Payment + +1. Market makers provide liquidity for USDX/pathUSD and USDY/pathUSD pairs. +2. A user wants to send USDX to a merchant who prefers USDY. +3. The exchange atomically routes the payment: USDX to pathUSD to USDY. +4. This happens in a single transaction with no manual swaps required. + +The user and merchant never hold pathUSD directly. It exists only as routing infrastructure. diff --git a/src/pages/protocol/exchange/spec.mdx b/src/pages/protocol/exchange/spec.mdx index 25fe2565..a940eee2 100644 --- a/src/pages/protocol/exchange/spec.mdx +++ b/src/pages/protocol/exchange/spec.mdx @@ -57,7 +57,7 @@ This forces liquidity into a tree structure, which in turn implies that there is USD tokens can only choose USD tokens as their quote token. Non-USD TIP-20 tokens can pick any token as their quote token, but currently there is no support for cross-currency trading, or same-currency trading of non-USD tokens, on the DEX. -The platform offers a neutral USD stablecoin, [`pathUSD`](/protocol/exchange/pathUSD), as an option for quote token. PathUSD is the first stablecoin deployed on the chain, which means it has no quote token. Use of pathUSD is optional. +The platform offers a neutral USD stablecoin, [`pathUSD`](/protocol/exchange/quote-tokens#pathusd), as an option for quote token. PathUSD is the first stablecoin deployed on the chain, which means it has no quote token. Use of pathUSD is optional. #### Swaps diff --git a/vocs.config.ts b/vocs.config.ts index b9c657ad..eda1ed21 100644 --- a/vocs.config.ts +++ b/vocs.config.ts @@ -401,8 +401,8 @@ export default defineConfig({ link: '/protocol/exchange/spec', }, { - text: 'pathUSD', - link: '/protocol/exchange/pathUSD', + text: 'Quote Tokens', + link: '/protocol/exchange/quote-tokens', }, { text: 'Executing Swaps', From 9c1f365dbd5fab0b87e0d9bdbf8972a107ee9d51 Mon Sep 17 00:00:00 2001 From: Liam Horne Date: Mon, 2 Feb 2026 22:31:24 -0500 Subject: [PATCH 2/2] Add redirect for old pathUSD URL Amp-Thread-ID: https://ampcode.com/threads/T-019c2186-633a-772f-83e0-6cd66b266286 Co-authored-by: Amp --- vocs.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vocs.config.ts b/vocs.config.ts index eda1ed21..9723cd0d 100644 --- a/vocs.config.ts +++ b/vocs.config.ts @@ -710,6 +710,11 @@ export default defineConfig({ destination: '/protocol/tip20/overview', status: 301, }, + { + source: '/protocol/exchange/pathUSD', + destination: '/protocol/exchange/quote-tokens#pathusd', + status: 301, + }, ], twoslash: { twoslashOptions: {