Skip to content
Open
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
101 changes: 101 additions & 0 deletions src/components/StorageSavingsSummary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
'use client'

import { Container } from './Container'

const numberFormat = new Intl.NumberFormat('en-US')

function formatGas(value: number) {
return `${numberFormat.format(value)} gas`
}

function formatPercent(value: number) {
return `${value.toFixed(1)}%`
}

function reduction(before: number, after: number) {
return ((before - after) / before) * 100
}

function barWidth(value: number, max: number) {
return `${Math.max((value / max) * 100, 3)}%`
}

function BeforeAfterRow(props: { label: string; before: number; after: number }) {
const saved = props.before - props.after

return (
<div className="space-y-2">
<div className="flex flex-wrap items-baseline justify-between gap-2">
<span className="font-medium text-gray12 text-sm">{props.label}</span>
<span className="text-[13px] text-gray11">
{formatGas(saved)} lower ({formatPercent(reduction(props.before, props.after))})
</span>
</div>

<div className="space-y-1.5">
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">Before</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div className="h-full rounded bg-gray7" style={{ width: '100%' }} />
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.before)}</span>
</div>
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">After</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div
className="h-full rounded bg-accent"
style={{ width: barWidth(props.after, props.before) }}
/>
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.after)}</span>
</div>
</div>
</div>
)
}

export function StorageSavingsSummary() {
return (
<Container
headerLeft={
<h4 className="font-normal text-[14px] text-gray12 leading-none">
DEX savings at a glance
</h4>
}
footer={
<span>
This is the StablecoinDEX benchmark. Benchmark non-DEX contracts before making the same
claim.
</span>
}
>
<div className="grid gap-5 lg:grid-cols-[1.2fr_0.8fr]">
<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Same-maker repeat orders</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
The saving shows up when the maker who earned it later places another eligible order.
</p>
</div>
<BeforeAfterRow label="After cancel" before={2_075_413} after={868_756} />
<BeforeAfterRow label="After filled order" before={1_828_213} after={621_456} />
</section>

<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Allocation rule</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
Savings should follow the user who cleared the storage.
</p>
</div>
<ol className="m-0 grid list-decimal gap-2 pl-5 text-gray11 text-sm">
<li>A maker cancels or fully fills an eligible order.</li>
<li>The DEX records reusable savings for that maker.</li>
<li>Only that same maker can use the saving on a later eligible order.</li>
</ol>
</section>
</div>
</Container>
)
}
127 changes: 127 additions & 0 deletions src/components/T7BenchmarkVisual.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
'use client'

import { Container } from './Container'

const numberFormat = new Intl.NumberFormat('en-US')

function formatGas(value: number) {
return `${numberFormat.format(value)} gas`
}

function formatPercent(value: number) {
return `${value.toFixed(1)}%`
}

function reduction(before: number, after: number) {
return ((before - after) / before) * 100
}

function barWidth(value: number, max: number) {
return `${Math.max((value / max) * 100, 3)}%`
}

function BaseFeeRow(props: {
label: string
value: string
width: number
tone: 'before' | 'after'
}) {
return (
<div className="space-y-1.5">
<div className="flex items-baseline justify-between gap-3 text-sm">
<span className="text-gray11">{props.label}</span>
<strong className="text-gray12">{props.value}</strong>
</div>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div
className={`h-full rounded ${props.tone === 'before' ? 'bg-gray7' : 'bg-accent'}`}
style={{ width: `${Math.max(props.width, 3)}%` }}
/>
</div>
</div>
)
}

function BeforeAfterRow(props: { label: string; before: number; after: number; unit?: 'gas' }) {
const saved = props.before - props.after

return (
<div className="space-y-2">
<div className="flex flex-wrap items-baseline justify-between gap-2">
<span className="font-medium text-gray12 text-sm">{props.label}</span>
<span className="text-[13px] text-gray11">
{formatGas(saved)} lower ({formatPercent(reduction(props.before, props.after))})
</span>
</div>

<div className="space-y-1.5">
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">Before</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div className="h-full rounded bg-gray7" style={{ width: '100%' }} />
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.before)}</span>
</div>
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">After</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div
className="h-full rounded bg-accent"
style={{ width: barWidth(props.after, props.before) }}
/>
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.after)}</span>
</div>
</div>
</div>
)
}

export function T7BenchmarkVisual() {
return (
<Container
headerLeft={
<h4 className="font-normal text-[14px] text-gray12 leading-none">Fee impact at a glance</h4>
}
footer={
<span>
Bars are normalized within each comparison. Exact benchmark numbers are listed below.
</span>
}
>
<div className="grid gap-5 lg:grid-cols-3">
<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Base fee</h5>
<p className="m-0 mt-1 text-gray11 text-sm">Example cost for a 50,000 gas transfer.</p>
</div>
<BaseFeeRow label="Today fixed fee" value="$0.0010" width={100} tone="before" />
<BaseFeeRow label="New fee cap" value="$0.0006" width={60} tone="after" />
<BaseFeeRow label="Quiet-period floor" value="$0.00003" width={3} tone="after" />
</section>

<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Payment channels</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
Repeated channel opens can reuse payer-scoped savings.
</p>
</div>
<BeforeAfterRow label="Open existing channel" before={1_055_229} after={294_425} />
<BeforeAfterRow label="Open first channel" before={1_302_429} after={791_625} />
</section>

<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">DEX repeat orders</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
Returning makers can reuse order-storage savings.
</p>
</div>
<BeforeAfterRow label="Same maker after cancel" before={2_075_413} after={868_756} />
<BeforeAfterRow label="Same maker after filled order" before={1_828_213} after={621_456} />
</section>
</div>
</Container>
)
}
4 changes: 4 additions & 0 deletions src/pages/docs/guide/issuance/distribute-rewards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import { Cards, Card } from 'vocs'

# Distribute Rewards

:::warning[Rewards deprecation planned]
This change is planned for testnet on July 2, 2026 and mainnet on July 9, 2026. After activation, new Tempo Token Rewards opt-ins and distributions become no-ops. Already-accrued rewards remain claimable through the existing `claimRewards()` flow. See the [T7 network upgrade](/docs/protocol/upgrades/t7) for the full timeline and scope.
:::

Distribute rewards to token holders using TIP-20's built-in reward distribution mechanism. Rewards allow parties to incentivize holders of a token by distributing tokens proportionally based on their balance.

Rewards can be distributed by anyone on any TIP-20 token, and claimed by any holder who has opted in. This guide covers both the reward distributor and token holder use cases. While the demo below uses a token you create, the same principles apply to any token.
Expand Down
1 change: 1 addition & 0 deletions src/pages/docs/guide/machine-payments/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Tempo's transaction model is designed for agentic payments using MPP:

- **~500ms finality** — Deterministic confirmation fast enough for synchronous request/response flows
- **Sub-cent fees** — Low enough for micropayments and per-request billing
- **Lower repeated channel lifecycle costs** — T7 adds payer-scoped storage credits for MPP payment channels. In the [v1.10.1 release benchmark](https://github.com/tempoxyz/tempo/releases/tag/v1.10.1), channel-reserve open calls are 72.1% lower for the open-existing path and 39.2% lower for the open-first path.
- **Fee sponsorship** — Servers can cover gas on behalf of clients so they only need stablecoins
- **2D and expiring nonces** — Parallel nonce lanes prevent payment transactions from blocking other account activity
- **High throughput** — Supports the on-chain settlement volume that payment channels generate at scale
Expand Down
13 changes: 13 additions & 0 deletions src/pages/docs/guide/machine-payments/pay-as-you-go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ Build a payment-gated photo gallery API that charges $0.01 per photo using `mppx
Unlike [one-time payments](/docs/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[T7 payment-channel savings]
The [T7 network upgrade](/docs/protocol/upgrades/t7) adds payer-scoped storage credits for MPP payment channels. When a payer closes or withdraws a finished channel, the reserve can record a channel storage credit for that payer. If the same payer opens another channel later, that payer can reuse the credit. Other payers cannot spend it.
:::

In the [v1.10.1 release benchmark](https://github.com/tempoxyz/tempo/releases/tag/v1.10.1), channel-reserve open calls are lower after T7:

| Channel reserve path | T6 | T7 | Gas change |
|----------------------|---:|---:|-----------:|
| Open existing | 1,055,229 | 294,425 | -760,804 (-72.1%) |
| Open first | 1,302,429 | 791,625 | -510,804 (-39.2%) |

These are call-level gas numbers and exclude separate approval gas. They matter most for session services where the same payer opens, closes or withdraws, and later opens channels again.

## How sessions work

<MermaidDiagram chart={`sequenceDiagram
Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/guide/stablecoin-dex/providing-liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ Add liquidity for a token pair by placing orders on the Stablecoin DEX. You can

In this guide you will learn how to place buy and sell orders to provide liquidity on the Stablecoin DEX orderbook.

:::info[Planned storage savings for active makers]
After the T7 network upgrade, active makers may pay less gas when they cancel or fully fill eligible orders and later place new eligible orders. See [Storage Credits for Repeated Workflows](/docs/guide/t7-storage-credits) for the DEX benchmark and allocation pattern.
:::

## Demo

<Demo.Container name="Place an Order" footerVariant="source" src="tempoxyz/examples/tree/main/examples/exchange">
Expand Down
Loading
Loading