Skip to content

[codex] Lock standard stableswap minimum liquidity#22

Open
caydyan wants to merge 1 commit into
BitflowFinance:mainfrom
caydyan:codex/lock-standard-stableswap-min-liquidity
Open

[codex] Lock standard stableswap minimum liquidity#22
caydyan wants to merge 1 commit into
BitflowFinance:mainfrom
caydyan:codex/lock-standard-stableswap-min-liquidity

Conversation

@caydyan

@caydyan caydyan commented Jun 22, 2026

Copy link
Copy Markdown

Summary

  • permanently lock u1000 LP tokens during standard stableswap pair creation
  • mint only the remaining initial LP supply to the pair creator while keeping total shares unchanged
  • reject initial liquidity that cannot cover the permanent lock

Why

The standard stableswap pool currently mints the entire initial LP supply to the creator, so the first LP can later burn all of their shares and fully empty the pool. Locking a small minimum LP supply follows the same protection added for the StackingDAO stableswap path and prevents total pool depletion.

Validation

  • git diff --check
  • clarinet check
  • clarinet console create-pair path confirmed creator LP u1999999999999000, contract-locked LP u1000, and full creator withdrawal leaves balance-x: u500, balance-y: u5, total-shares: u1000
  • clarinet console tiny initial liquidity path returns (err "err-initial-liquidity-too-low")

Note: the local environment does not have deno, so the TypeScript Clarinet tests were added but not executed here.

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