Skip to content

[codex] Fix StackingDAO admin swap fees#16

Open
caydyan wants to merge 1 commit into
BitflowFinance:mainfrom
caydyan:codex/fix-stackingdao-admin-swap-fees
Open

[codex] Fix StackingDAO admin swap fees#16
caydyan wants to merge 1 commit into
BitflowFinance:mainfrom
caydyan:codex/fix-stackingdao-admin-swap-fees

Conversation

@caydyan

@caydyan caydyan commented Jun 22, 2026

Copy link
Copy Markdown

Summary

Fixes the StackingDAO stableswap fee selection for admin vs non-admin swaps.

swap-x-for-y and swap-y-for-x both documented that admins should use the admin swap fee schedule, but the branch was inverted: admins were charged the regular buy/sell fees while non-admin users received the admin fee schedule. With the default admin-swap-fees set to zero, this meant ordinary users could swap without the intended normal fees.

This updates both swap paths so:

  • admins use admin-swap-fees
  • non-admin users use buy-fees / sell-fees
  • regression coverage checks non-admin swaps in both directions

This corresponds to the published stSTX/STX stableswap audit finding about the inverted fee branch.

Validation

  • clarinet check passes (12 contracts checked; existing repository warnings remain)
  • git diff --check
  • Clarinet console spot checks:
    • admin swap-x-for-y small amount: (ok u10000) with default zero admin fee
    • non-admin swap-x-for-y small amount: (ok u9995) with 3/1/1 normal fees
    • admin swap-y-for-x small amount: (ok u10000) with default zero admin fee
    • non-admin swap-y-for-x small amount: (ok u9995) with 3/1/1 normal fees

Note: this repo's test files use the older Clarinet/Deno test style and this checkout does not include a package.json; current Clarinet 3 provides clarinet check but not the old clarinet test subcommand.

@caydyan caydyan marked this pull request as ready for review June 22, 2026 11:28
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