fix(deploy): fail closed when a non-WETH pair relies on the default starting tick#23
Merged
Merged
Conversation
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
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
deployToken's default starting tick (-230400) means "full supply ≈ 10 of the paired token" — which is only the intended10-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:
deployTokennow throws whenpairedToken ≠ WETH(case-insensitive) and the caller didn't passtickIfToken0IsLiquid, with an error that points at the right tool —createLiquidPositionsUSD(startingMarketCapUSD, pairedTokenPriceUSD).Unchanged
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
tsc --noEmitclean: blind-DIEM throw (writeContract never called), case-insensitive compare, explicit-tick DIEM pass-through, WETH default preserved.🤖 Generated with Claude Code