Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
39 changes: 39 additions & 0 deletions e2e/orderbook-guide-content.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { expect, test } from '@playwright/test'

const __dirname = dirname(fileURLToPath(import.meta.url))

test('orderbook guide uses post-T5 flipped order state', () => {
const guide = readFileSync(
join(__dirname, '..', 'src', 'pages', 'guide', 'stablecoin-dex', 'view-the-orderbook.mdx'),
'utf-8',
)

expect(guide).not.toContain('Coming with T5')
expect(guide).not.toContain('pre-T5 examples')
expect(guide).not.toContain('Until T5 activates')

expect(guide).toContain(':::info[Changed with T5]')
expect(guide).toContain('FROM orderflipped')
expect(guide).toContain('latest_order_state')

const indexSupplyQueries = guide.match(/<IndexSupplyQuery[\s\S]*?\/>/g) ?? []
expect(indexSupplyQueries.length).toBeGreaterThan(0)

const activeBookQueries = indexSupplyQueries.filter((query) => query.includes('latest_order_state'))
expect(activeBookQueries).toHaveLength(3)
for (const query of activeBookQueries) {
expect(query).toContain('FROM orderflipped')
expect(query).toContain('"OrderFlipped"')
expect(query).toContain('orderfilled.block_num > latest_order_state.block_num')
}

const recentTradesQuery = indexSupplyQueries.find((query) =>
query.includes("title={'Recent Trade Prices for USDC.e'}"),
)
expect(recentTradesQuery).toBeDefined()
expect(recentTradesQuery).toContain('FROM orderflipped')
expect(recentTradesQuery).toContain('"OrderFlipped"')
})
4 changes: 2 additions & 2 deletions src/pages/guide/issuance/create-a-stablecoin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Create your own stablecoin on Tempo using the [TIP-20 token standard](/protocol/
TIP-20 tokens are designed specifically for payments with built-in compliance features, role-based permissions,
and integration with Tempo's payment infrastructure.

:::info[Coming with T5]
After the [T5 network upgrade](/protocol/upgrades/t5), the TIP-20 factory exposes a new 7-arg `createToken` overload that accepts an on-chain `logoURI` at creation ([TIP-1026](https://tips.sh/1026)). Wallets and explorers can read the icon directly from the token contract via `logoURI()`, without going through the [tokenlist registry](/quickstart/tokenlist). The previous `createToken` overload is unchanged. Per [TIP-1026's recommended formats](https://tips.sh/1026#recommended-formats), use a square, single-frame rasterized image (PNG or WebP) for `logoURI`. SVG is allowed by the scheme allowlist but not recommended. See the [Optional logoURI in TIP-20 section of the T5 page](/protocol/upgrades/t5#optional-logouri-in-tip-20-tip-1026) for the full surface area.
:::info[Changed with T5]
The [T5 network upgrade](/protocol/upgrades/t5) added a 7-arg `createToken` overload that accepts an on-chain `logoURI` at creation ([TIP-1026](https://tips.sh/1026)). Wallets and explorers can read the icon directly from the token contract via `logoURI()`, without going through the [tokenlist registry](/quickstart/tokenlist). The previous `createToken` overload is unchanged. Per [TIP-1026's recommended formats](https://tips.sh/1026#recommended-formats), use a square, single-frame rasterized image (PNG or WebP) for `logoURI`. SVG is allowed by the scheme allowlist but not recommended. See the [Optional logoURI in TIP-20 section of the T5 page](/protocol/upgrades/t5#optional-on-chain-logouri) for the full surface area.
:::

## Demo
Expand Down
4 changes: 2 additions & 2 deletions src/pages/guide/issuance/manage-stablecoin.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import { Cards, Card } from 'vocs'

Configure your stablecoin's permissions, supply limits, and compliance policies after deployment. This guide covers granting roles to manage token operations, setting supply caps, configuring transfer policies, and controlling token transfers through pause/unpause functionality.

:::info[Coming with T5]
After the [T5 network upgrade](/protocol/upgrades/t5), an admin holding `DEFAULT_ADMIN_ROLE` can update the on-chain `logoURI` field on any TIP-20 via `setLogoURI(string newLogoURI)` ([TIP-1026](https://tips.sh/1026)). Wallets and explorers can read the icon directly from the token contract via `logoURI()`. Per [TIP-1026's recommended formats](https://tips.sh/1026#recommended-formats), use a square, single-frame rasterized image (PNG or WebP) for `logoURI`. SVG is allowed by the scheme allowlist but not recommended. See the [Optional logoURI in TIP-20 section of the T5 page](/protocol/upgrades/t5#optional-logouri-in-tip-20-tip-1026) for the full surface area.
:::info[Changed with T5]
The [T5 network upgrade](/protocol/upgrades/t5) added the on-chain `logoURI` field to TIP-20, which an admin holding `DEFAULT_ADMIN_ROLE` can update via `setLogoURI(string newLogoURI)` ([TIP-1026](https://tips.sh/1026)). Wallets and explorers can read the icon directly from the token contract via `logoURI()`. Per [TIP-1026's recommended formats](https://tips.sh/1026#recommended-formats), use a square, single-frame rasterized image (PNG or WebP) for `logoURI`. SVG is allowed by the scheme allowlist but not recommended. See the [Optional logoURI in TIP-20 section of the T5 page](/protocol/upgrades/t5#optional-on-chain-logouri) for the full surface area.
:::

TIP-20 tokens use a role-based access control system that allows you to delegate different administrative functions to different addresses. For detailed information about the role system, see the [TIP-20 specification](/protocol/tip20/spec#role-based-access-control).
Expand Down
8 changes: 4 additions & 4 deletions src/pages/guide/issuance/use-for-fees.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ First, create and mint your stablecoin by following the [Create a Stablecoin](/g

### Add fee pool liquidity

:::info[Coming with T5]
After the [T5 network upgrade](/protocol/upgrades/t5), the FeeAMM supports multihop routing ([TIP-1033](https://tips.sh/1033)). Issuers no longer need to provision a pool against every validator payout token — pairing your token against a single liquid quote (e.g., `pathUSD`) is enough, and multihop routing connects it to any validator payout token that has its own `pathUSD` pool. Until T5 activates, the per-validator-token setup described below still applies.
:::info[Changed with T5]
The [T5 network upgrade](/protocol/upgrades/t5) added FeeAMM multihop routing ([TIP-1033](https://tips.sh/1033)). Issuers no longer need to provision a pool against every validator payout token — pairing your token against a single liquid quote (e.g., `pathUSD`) is enough, and multihop routing connects it to any validator payout token that has its own `pathUSD` pool. Existing per-validator-token pools continue to work, but new issuers can usually pair against one liquid quote token instead.
:::

Before users can pay fees with your token, you need to provide liquidity in the Fee AMM between your token and each of the tokens accepted by validators.
Before users can pay fees with your token, you need to provide liquidity in the Fee AMM between your token and a liquid quote token, or directly against validator payout tokens where you want explicit direct-route coverage.

To determine which validator tokens are needed, sample recent blocks and check the miner's preferred fee token using `getValidatorToken` on the FeeManager contract. For example, on Moderato testnet, validators accept fees in pathUSD and AlphaUSD. On mainnet, this token mix is different and subject to change.

Add liquidity to your token's fee pool for each validator token:
Add liquidity to your token's fee pool:

:::code-group

Expand Down
4 changes: 2 additions & 2 deletions src/pages/guide/machine-payments/pay-as-you-go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Build a payment-gated photo gallery API that charges $0.01 per photo using `mppx
Unlike [one-time payments](/guide/machine-payments/one-time-payments), sessions open a payment channel once and use off-chain vouchers for each subsequent request — vouchers are processed in pure CPU-bound signature checks, not bottlenecked by blockchain throughput.
:::

:::info[Coming with T5]
Comment thread
max-digi marked this conversation as resolved.
The [T5 network upgrade](/protocol/upgrades/t5) ships an enshrined `TIP20ChannelReserve` precompile at [`0x4D50500000000000000000000000000000000000`](https://explore.tempo.xyz/address/0x4D50500000000000000000000000000000000000) (ASCII `MPP`) that replaces the application-level escrow contract for new MPP integrations ([TIP-1034](https://tips.sh/1034)). The existing escrow contract continues to work; SDKs that target the precompile additionally save gas thanks to [implicit approvals](/protocol/upgrades/t5#tip-1035-implicit-approvals-list) — the channel can pull TIP-20 tokens without a prior `approve` transaction. New `mppx` releases that target the precompile will be linked under [Compatible SDK releases](/protocol/upgrades/t5#compatible-sdk-releases).
:::info[Changed with T5]
Comment thread
max-digi marked this conversation as resolved.
Outdated
The [T5 network upgrade](/protocol/upgrades/t5) shipped an enshrined `TIP20ChannelReserve` precompile at [`0x4D50500000000000000000000000000000000000`](https://explore.tempo.xyz/address/0x4D50500000000000000000000000000000000000) (ASCII `MPP`) that replaces the application-level escrow contract for new MPP integrations ([TIP-1034](https://tips.sh/1034)). The existing escrow contract continues to work; SDKs that target the precompile additionally save gas thanks to [implicit approvals](/protocol/upgrades/t5#implicit-approvals) — the channel can pull TIP-20 tokens without a prior `approve` transaction. New `mppx` releases that target the precompile will be linked under [Compatible SDK releases](/protocol/upgrades/t5#compatible-sdk-releases).
:::

## How sessions work
Expand Down
2 changes: 1 addition & 1 deletion src/pages/guide/node/network-upgrades.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ For detailed release notes and binaries, see the [Changelog](/changelog).

### Who is affected?

All node operators need to upgrade before the T5 activation timestamp. Non-upgraded nodes will fall out of consensus once T5 activates.
All node operators needed to upgrade before the T5 activation timestamp.

Integrators, indexers, wallets, explorers, and SDK maintainers should review the [T5 network upgrade](/protocol/upgrades/t5) page for the post-T5 surfaces and migration notes.

Expand Down
4 changes: 2 additions & 2 deletions src/pages/guide/stablecoin-dex/managing-fee-liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ The Fee AMM converts transaction fees between stablecoins when users pay in a di

Browse current pool reserves and route availability in the [FeeAMM explorer view](https://explore.tempo.xyz/fee-amm).

:::info[Coming with T5]
After the [T5 network upgrade](/protocol/upgrades/t5), the Fee AMM supports multihop routing ([TIP-1033](https://tips.sh/1033)) — one fee conversion can route through two pools when a direct pair between the user's fee token and the validator's payout token doesn't exist or has insufficient liquidity for the user's transaction. Pool mechanics for adding and removing liquidity are unchanged, but a single fee conversion may now reserve and consume reserves from two pools you provide liquidity to instead of one.
:::info[Changed with T5]
The [T5 network upgrade](/protocol/upgrades/t5) added Fee AMM multihop routing ([TIP-1033](https://tips.sh/1033)) — one fee conversion can route through two pools when a direct pair between the user's fee token and the validator's payout token doesn't exist or has insufficient liquidity for the user's transaction. Pool mechanics for adding and removing liquidity are unchanged, but a single fee conversion may now reserve and consume reserves from two pools you provide liquidity to instead of one.
:::

<Demo.Container name="Manage Fee Liquidity" footerVariant="source" src="tempoxyz/examples/tree/main/examples/issuance">
Expand Down
6 changes: 3 additions & 3 deletions src/pages/guide/stablecoin-dex/providing-liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@ console.log('Quote Token:', metadata?.quoteToken) // returns `pathUSD` address

### Flip order

:::info[Coming with T5]
The [T5 network upgrade](/protocol/upgrades/t5) changes flip-order behavior in two ways:
:::info[Changed with T5]
The [T5 network upgrade](/protocol/upgrades/t5) changed flip-order behavior in two ways:
- `flipTick == tick` becomes valid ([TIP-1030](https://github.com/tempoxyz/tempo/blob/main/tips/tip-1030.md))
- A filled flip order keeps the same `orderId` and emits a new `OrderFlipped` event instead of a fresh `OrderPlaced` ([TIP-1056](https://github.com/tempoxyz/tempo/blob/main/tips/tip-1056.md))

Until T5 activates, the behavior described below still applies. Developers updating indexers, SDKs, or contract code should see the [T4 → T5 migration appendix](/protocol/exchange/providing-liquidity#t4--t5-migration) on the Providing Liquidity spec page.
This changed with T5; developers updating indexers, SDKs, or contract code should see the [T5 network upgrade](/protocol/upgrades/t5) page and the Providing Liquidity spec page.
:::

Flip orders automatically switch between buy and sell sides when filled, providing continuous liquidity. Use viem's [`dex.placeFlip`](https://viem.sh/tempo/actions/dex.placeFlip) to create a flip order call.
Expand Down
Loading
Loading