-
Notifications
You must be signed in to change notification settings - Fork 53
Add T7 storage credit docs #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
max-digi
wants to merge
19
commits into
main
Choose a base branch
from
max/t7-storage-credit-docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+283
−24
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
06c2e41
docs: add T7 storage credit guidance
max-digi 06d9c80
docs: add T7 release benchmark highlights
max-digi 5d9da38
docs: remove internal benchmark references
max-digi 3d6f193
docs: add T7 benchmark visuals
max-digi 0c05a36
docs: simplify storage credit allocation wording
max-digi 8ba4cb0
docs: improve storage credits explanation (#617)
0xrusowsky 475906f
docs: update storage credits guide links
max-digi 9295715
docs: clarify filled order labels
max-digi ca7ca0a
Merge remote-tracking branch 'origin/main' into pr503-resolve-inrepo
max-digi 333c552
Update src/pages/docs/guide/t7-storage-credits.mdx
max-digi fd63e9e
Update src/pages/docs/protocol/upgrades/t7.mdx
max-digi 7e20b88
Update src/pages/docs/protocol/upgrades/t7.mdx
max-digi 3a6efa3
Update src/pages/docs/guide/machine-payments/pay-as-you-go.mdx
max-digi ed86d79
docs: address T7 review feedback
max-digi b85cfea
Merge remote-tracking branch 'origin/max/t7-storage-credit-docs' into…
max-digi 1f6ea87
docs: clean up T7 review suggestions
max-digi d3c6114
Remove standalone T7 storage credits guide
max-digi e2d27b2
Merge branch 'main' into max/t7-storage-credit-docs
0xrusowsky 2d4c0a4
Align T7 benchmark values with release notes
max-digi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.