Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/pages/protocol/exchange/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
79 changes: 0 additions & 79 deletions src/pages/protocol/exchange/pathUSD.mdx

This file was deleted.

68 changes: 68 additions & 0 deletions src/pages/protocol/exchange/quote-tokens.mdx
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/pages/protocol/exchange/spec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions vocs.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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: {
Expand Down