Skip to content

fix(deploy): fail closed when a non-WETH pair relies on the default starting tick#23

Merged
mugrebot merged 1 commit into
mainfrom
liquid/guard-nonweth-default-tick
Jun 11, 2026
Merged

fix(deploy): fail closed when a non-WETH pair relies on the default starting tick#23
mugrebot merged 1 commit into
mainfrom
liquid/guard-nonweth-default-tick

Conversation

@mugrebot

Copy link
Copy Markdown
Contributor

What

deployToken's default starting tick (-230400) means "full supply ≈ 10 of the paired token" — which is only the intended 10-ETH market cap when the pair is WETH. For any other pair, the default silently pegs the launch FDV to 10× that token's market price: **$13.7k for DIEM at $1,375, $10 for a $1 token** — a number nobody chose. And since Liquid LP is permanently locked, a mispriced pool can't be fixed after launch.

This PR makes that path fail closed: deployToken now throws when pairedToken ≠ WETH (case-insensitive) and the caller didn't pass tickIfToken0IsLiquid, with an error that points at the right tool — createLiquidPositionsUSD(startingMarketCapUSD, pairedTokenPriceUSD).

Unchanged

  • WETH deploys (default or explicit) — untouched.
  • Non-WETH deploys that pass an explicit tick/positions (the launcher bot, deploy-diem-paired-token, cli-launcher) — untouched; they all already anchor explicitly.

Breaking?

Technically — a non-WETH deploy that previously relied on the default now throws. That behavior was the bug; the throw arrives before anything reaches the chain. Flagged as Changed/Breaking in the CHANGELOG under [Unreleased]; suggest shipping as 1.7.6 (it prevents irreversible mispriced pools).

Verification

  • 4 new tests, 227/227 passing, tsc --noEmit clean: blind-DIEM throw (writeContract never called), case-insensitive compare, explicit-tick DIEM pass-through, WETH default preserved.
  • Repo grep: no in-repo script/example hits the new throw.

🤖 Generated with Claude Code

deployToken's default starting tick (-230400) prices full supply at ~10
of the PAIRED token — calibrated for WETH (~10 ETH market cap). For any
other pair it silently pegs the launch FDV to 10x that token's price
(DIEM at $1,375 → ~$13.7k; a $1 token → $10) — an accident, never a
choice, and unfixable post-launch because LP is permanently locked.

deployToken now throws when pairedToken != WETH and tickIfToken0IsLiquid
is not provided, pointing at createLiquidPositionsUSD(startingMarketCapUSD,
pairedTokenPriceUSD) for the explicit USD-anchored path. WETH deploys are
unchanged; explicit-tick non-WETH deploys are unchanged.

4 new tests (227 total passing): throw on blind DIEM pair (nothing
reaches the chain), case-insensitive address compare, explicit-tick DIEM
pass-through, WETH default unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mugrebot mugrebot requested a review from moggedcapital as a code owner June 11, 2026 16:45
@mugrebot mugrebot merged commit 5ca5c49 into main Jun 11, 2026
4 checks passed
@mugrebot mugrebot deleted the liquid/guard-nonweth-default-tick branch June 11, 2026 16:53
mugrebot added a commit that referenced this pull request Jun 11, 2026
Version + CHANGELOG stamp for the already-published npm release (1.7.6
is live on the registry; this keeps main in lockstep). Ships #23: fail
closed when pairedToken != WETH without an explicit starting tick.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant